To solve this problem, remember that a gas confined inside a cylinder equipped with a piston can do work on the piston, and this work can be calculated by multiplying the pressure by the change in volume. If the volume doesn't change, no work is done. If the pressure stays constant while the volume changes (an “isobaric process”), the work done is easy to calculate – you just need to calculate the initial volume and the final volume, take the difference and multiply it by the pressure.  

As an aid in calculating the work done, it's a good idea to draw a pressure-volume graph (with pressure on the y axis and volume on the x-axis). If a system moves from one point on the graph to another and a line is drawn to connect the points, the work done is the area underneath this line.  

The P-V graph for this isobaric problem looks like this:

 

http://buphy.bu.edu/~duffy/PY105/30k.GIF

In this problem, we know that P = 413 kPa, so all we have to do is calculate the initial volume (Vi) and the final volume (Vf), take the difference and multiply the difference by the pressure. In other words, W = P(Vf – Vi).

To calculate the initial and final volume, we need to use the formula PV = nRT, where n is the number of moles, R = 8.314 J·K−1·mol−1, and T = the temperature in Kelvin. Another way of writing the equation is V = (nRT)/P. In this problem n = 1290 moles, since there are approximately 1290 moles in 22 kg of ammonia (one mole of ammonia weighs approximately 17.03 grams), and the initial value of T = 311.15 degrees Kelvin.

Vi = (nRTi)/P = (1290 mol * 8.314 J·K−1·mol−1 * 311.15° K )/413 kPa = 8080.15 Liters

Vf = (nRTi)/P = (1290 mol * 8.314 J·K−1·mol−1 * 373.15° K )/413 kPa = 9690.21 Liters

Now we can easily calculate the work done:

W = P(Vf - Vi) = 413 kPa (9690.21 L - 8080.15 L) = 413 kPa * 1610.06 L = 664,954.78 J = 665 kJ