Using Maxwell Relations or any other mathematical or thermodynamic relations, prove that (∂Cp/∂P)=−T(∂^2V/∂T^2)

Prove that:
 $$\left(\frac{\partial Cp}{\partial P}\right)\_T = -T \left(\frac{\partial^2 V}{\partial T^2}\right)\_P$$


Since $Cp = (\frac{\partial H}{\partial T})\_P$


$$\left(\frac{\partial Cp}{\partial P}\right)\_T = \frac{\partial}{\partial P} \left(\left(\frac{\partial H}{\partial T}\right)\_P\right)\_T$$


Using the chain rule:


$$\frac{\partial}{\partial P} \left(\left(\frac{\partial H}{\partial T}\right)\_P\right)\_T = \frac{\partial}{\partial P} \left(\left(\frac{\partial H}{\partial S}\right)\_P\left(\frac{\partial S}{\partial T} \right)\_P\right)\_T$$


From:


$dH = TdS + VdP$


$(\frac{\partial H}{\partial S})\_P = T$


$$\frac{\partial}{\partial P} \left(\left(\frac{\partial H}{\partial S}\right)\_P\left(\frac{\partial S}{\partial T} \right)\_P\right)\_T = \frac{\partial}{\partial P} \left(T\left(\frac{\partial S}{\partial T} \right)\_P\right)\_T$$


Expanding the derivative:


$$\frac{\partial}{\partial P} \left(T\left(\frac{\partial S}{\partial T} \right)\_P\right)\_T = \left(\frac{\partial T}{\partial P}\right)\_S \left(\frac{\partial S}{\partial T} \right)\_P + T\frac{\partial}{\partial T}\left(\left(\frac{\partial S}{\partial P}\right)\_T\right)\_P$$


By the cyclic rule and subsequently Maxwell Relations:


$$-\left(\frac{\partial S}{\partial P}\right)\_T = \left(\frac{\partial T}{\partial P}\right)\_S \left(\frac{\partial S}{\partial T} \right)\_P = \left(\frac{\partial V}{\partial T}\right)\_P$$


Substituting these in, I get an extra term:


$$\left(\frac{\partial V}{\partial T}\right)\_P-T \left(\frac{\partial^2 V}{\partial T^2}\right)\_P$$


Above was my first approach to the question. Why do I get an additional term in this version of the proof?


I was able to later prove it by finding $\frac{\partial H}{\partial P} = T\frac{\partial S}{\partial P} + V$ and solving using similar steps to get the correct answer.


