Answer
$U_{2}=35.5kJ$
Work Step by Step
$W_{in}=500Nm=500J=0.5kJ$
Applying the energy balance:
$E_{in}-E_{out}=\Delta E_{system}$
$Q_{in}+W_{in}-Q_{out}-W_{out}=U_{2}-U_{1}$
$30kJ+0.5kJ-5kJ-0kJ=U_{2}-10kJ$
Solving for $U_{2}$:
$U_{2}=30kJ+0.5kJ-5kJ+10kJ=35.5kJ$