Answer
a) $T_h = \frac{T_{h0}}{e^({\frac{P_0t}{-mcT_c+mcT_{h0}}})}$
b)$t=\frac{(-mcT_c+mcT_{h0})ln(\frac{T_{h0}}{T_c})}{P_0}$
Work Step by Step
a) We know the following equations:
$P=P_0\frac{T_h-T_c}{T_{h0}-T_c}$
$dW = Pdt$
$Pdt = \frac{(-mc\space dT_h)(T_h-T_c)}{T_h}$
Combining these two equations and taking the integral, we simplify to find that the value of $T_h$ is:
$T_h = \frac{T_{h0}}{e^({\frac{P_0t}{-mcT_c+mcT_{h0}}})}$
b) First, we simplify the above expression for t:
$T_h = \frac{T_{h0}}{e^({\frac{P_0t}{-mcT_c+mcT_{h0}}})}$
$T_h(e^{\frac{P_0t}{-mcT_c+mcT_{h0}}}) = T_{h0}$
$(e^{\frac{P_0t}{-mcT_c+mcT_{h0}}}) = \frac{T_{h0}}{T_h}$
$\frac{P_0t}{-mcT_c+mcT_{h0}}=ln(\frac{T_{h0}}{T_h})$
$P_0t=(-mcT_c+mcT_{h0})ln(\frac{T_{h0}}{T_h})$
$t=\frac{(-mcT_c+mcT_{h0})ln(\frac{T_{h0}}{T_h})}{P_0}$
We know that the engine will not longer work when $T_h$ and $T_c$ are equal, so it follows:
$t=\frac{(-mcT_c+mcT_{h0})ln(\frac{T_{h0}}{T_c})}{P_0}$