Solving $\displaystyle py+xq+pq=0$ To Solve: $\displaystyle py+xq+pq=0$, where $\displaystyle p=\frac{\partial z}{\partial x}, q=\frac{\partial z}{\partial y}$
My Attempt:
$\displaystyle p(y+q)=-qx$
$\displaystyle \frac{p}{x}=\frac{-q}{y+q} =a (say)$
$\displaystyle p=ax$
$\displaystyle q=\frac{-ay}{y+1}$
Now, $\displaystyle dz=\frac{\partial z}{\partial x}dx+\frac{\partial z}{\partial y}dy$
$\displaystyle dz=pdx+qdy$
$\displaystyle dz=axdx-\frac{ay}{y+1}dy$
Integrating this will give a different answer from the given answer, which is 
$\displaystyle 2z=ax^2-\frac{a}{1-a}y^2+b$
Where am I going wrong ?
 A: $y\dfrac{\partial z}{\partial x}+x\dfrac{\partial z}{\partial y}+\dfrac{\partial z}{\partial x}\dfrac{\partial z}{\partial y}=0$
$\dfrac{\partial z}{\partial x}\dfrac{\partial z}{\partial y}+y\dfrac{\partial z}{\partial x}=-x\dfrac{\partial z}{\partial y}$
$\dfrac{\partial z}{\partial x}\left(\dfrac{\partial z}{\partial y}+y\right)=-x\dfrac{\partial z}{\partial y}$
Let $u=z+\dfrac{y^2}{2}$ ,
Then $\dfrac{\partial u}{\partial x}=\dfrac{\partial z}{\partial x}$
$\dfrac{\partial u}{\partial y}=\dfrac{\partial z}{\partial y}+y$
$\therefore\dfrac{\partial u}{\partial x}\dfrac{\partial u}{\partial y}=-x\left(\dfrac{\partial u}{\partial y}-y\right)$
$\dfrac{1}{x}\dfrac{\partial u}{\partial x}=\dfrac{y}{\dfrac{\partial u}{\partial y}}-1$
$\dfrac{1}{x}\dfrac{\partial^2u}{\partial x\partial y}=\dfrac{1}{\dfrac{\partial u}{\partial y}}-\dfrac{y\dfrac{\partial^2u}{\partial y^2}}{\left(\dfrac{\partial u}{\partial y}\right)^2}$
$\dfrac{1}{x}\dfrac{\partial^2u}{\partial x\partial y}+\dfrac{y\dfrac{\partial^2u}{\partial y^2}}{\left(\dfrac{\partial u}{\partial y}\right)^2}=\dfrac{1}{\dfrac{\partial u}{\partial y}}$
Let $v=\dfrac{\partial u}{\partial y}$ ,
Then $\dfrac{1}{x}\dfrac{\partial v}{\partial x}+\dfrac{y}{v^2}\dfrac{\partial v}{\partial y}=\dfrac{1}{v}$
Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:
$\dfrac{dv}{dt}=\dfrac{1}{v}$ , letting $v(0)=0$ , we have $v^2=2t$
$\dfrac{dx}{dt}=\dfrac{1}{x}$ , letting $x(0)=x_0^2$ , we have $x^2=2t+x_0^2=v^2+x_0^2$
$\dfrac{dy}{dt}=\dfrac{y}{v^2}=\dfrac{y}{2t}$ , we have $t=\dfrac{f(x_0^2)y^2}{2}$ , i.e. $v^2=f(x^2-v^2)y^2$
A: Given
$$
py + xq + pq = 0,
$$
where
$$
p = \frac{\partial z}{\partial x},\ q = \frac{\partial z}{\partial y}.
$$

Note that there is a symmetry by exchanging $x$ and $y$, so
$$
z = z\Big( x + y, xy \Big)
$$

Note that we can write
$$
py + xq + pq = 0 \Rightarrow \Big( p + x \Big) \Big( q + y \Big) = xy.
$$
So we can write
$$
\left( \frac{\partial z}{\partial x} + x \right)
\left( \frac{\partial z}{\partial y} + y \right) = xy,
$$
which can be written as
$$
\left( \frac{\partial}{\partial x}
\left[ z + \frac{1}{2} x^2 + \frac{1}{2} y^2 + C \right] \right)
\left( \frac{\partial}{\partial y}
\left[ z + \frac{1}{2} x^2 + \frac{1}{2} y^2 + C \right] \right) = xy.
$$
Let us write
$$
\phi = z + \frac{1}{2} x^2 + \frac{1}{2} y^2 + C,
$$
then we can write
$$
\frac{\partial \phi}{\partial x} \frac{\partial \phi}{\partial y} = x y.
$$
And let
$$
\phi_x = \frac{\partial \phi}{\partial x},\ \phi_y = \frac{\partial \phi}{\partial y},
$$
then we obtain
$$
\frac{\partial \phi_x}{\partial y} = \frac{\partial \phi_y}{\partial x},
\ \phi_x \phi_y = xy.
$$
We may try
$$
\phi = \pm x^m y^n,
$$
so we obtain
$$
\phi_x = \pm m x^{m-1} y^n,\ \phi_y = \pm n x^m y^{n-1}.
$$
It is clear that
$$
\frac{\partial \phi_x}{\partial y} = \pm m n x^{m-1} y^{n-1},\ 
\frac{\partial \phi_y}{\partial x} = \pm m n x^{m-1} y^{n-1},
$$
So
$$
\frac{\partial \phi_x}{\partial y} = \frac{\partial \phi_y}{\partial x}.
$$
But
$$
\phi_x \phi_y = m n x^{2m-1} y^{2n-1} = x y,
$$
meaning that
$$
m=1,\ n=1.
$$
Therefore we obtain
$$
\pm x y = z + \frac{1}{2} x^2 + \frac{1}{2} y^2 + C,
$$
or
$$
z = \pm x y - \frac{1}{2} x^2 - \frac{1}{2} y^2,
$$
which can be written as
$$
z = - \frac{1}{2} \Big( x \mp y \Big)^2.
$$
