To exactly calculate the work done by the system it is necessary to calculate the integral of the pressure with respect to volume. One can often quickly calculate this using the PV diagram as it is simply the area enclosed by the cycle.