Solution (source code)

= Solution

On the straight sloping leg, $p=p_0(3-V/V_0)$ and $dp=-p_0dV/V_0$. Put $v=V/V_0$, which increases from $1$ to $2$. The reversible <heat transfer> is
$$
 dQ=p_0V_0\left(\frac{15}{2}-4v\right)dv.
$$
Thus \b[<heat> is absorbed for $1<v<15/8$ and emitted for $15/8<v<2$], with zero instantaneous <heat> at $v=15/8$. The switching point has $(p,V)=(9p_0/8,15V_0/8)$. In particular the net <heat> on this leg, $\tfrac32p_0V_0$, is not the total positive <heat> on it.