Step 1: Apply the First Law of Thermodynamics
The first law of thermodynamics states:
\[
\Delta U = Q - W
\]
Where:
- \( \Delta U \) is the change in internal energy,
- \( Q \) is the heat transfer,
- \( W \) is the work done by the gas.
Step 2: Substitute known values
Given:
- Work done \( W = 50 \, \text{kJ} \),
- Decrease in internal energy \( \Delta U = -30 \, \text{kJ} \) (since it's a decrease, we take it as negative).
Substitute into the equation:
\[
-30 = Q - 50
\]
Step 3: Solve for \( Q \)
\[
Q = -30 + 50 = 20 \, \text{kJ}
\]
Final Answer:
\[
\boxed{+20 \, \text{kJ}}
\]