I have a book that says that if $$ f(x,y,z) = g(p,q,z) $$
and
$$ h(x,y,p,q) = 0 $$
then f and g both have the form (for instance):
$$ \phi(x,y)\zeta(z) + \eta(z) $$
I'm guessing the proof has to do with integrating inexact differentials such as
$$ \frac{\partial f}{\partial x}\big)_{y,z}dx + \frac{\partial f}{\partial y}\big)_{x,z}dy = \frac{\partial g}{\partial p}\big)_{q,z}dp + \frac{\partial g}{\partial q}\big)_{p,z}dq $$
from cancelling (I think it's true, but can't quite prove) $\frac{\partial f}{\partial z}\big)_{x,y}dz = \frac{\partial g}{\partial z}\big)_{p,q}dz$,
subject to
$$ \frac{\partial h}{\partial x}\big)_{y,p,q}dx + \frac{\partial h}{\partial y}\big)_{x,p,q}dy + \frac{\partial h}{\partial p}\big)_{x,y,q}dp + \frac{\partial h}{\partial q}\big)_{x,y,p}dq = 0 $$
Any suggestions?
The book is Theoretical Concepts in Physics by Longair, p. 121
Thanks