Step 1: Apply First Law of Thermodynamics
The first law of thermodynamics states:
\[
\Delta U = Q + W
\]
where \( Q \) is the heat absorbed by the system and \( W \) is the work done on the system.
Step 2: Substitute Given Values
Given \( Q = 18 \) J and \( W = 12 \) J:
\[
\Delta U = 18 + 12 = 30 \text{ J}
\]