To Solve $\displaystyle q+xp=p^2$ using Charpit's Method p = ∂z/∂x
q = ∂z/∂y


My Attempt:

$\displaystyle \frac{dx}{-(x-2p)}=\frac{dy}{-1}=\frac{dz}{-p(x-2p)-q}=\frac{dp}{2p}=\frac{dq}{0}$

So, do I get.. $\displaystyle \log p=\log c_1 \implies p=c_1 $

$\displaystyle q=c_2 $

Going to $\displaystyle dz=pdx+qdy $

This won't give the desired solution

Now, I can't think ahead ..

The given answer is: $\displaystyle z=axe^{-y}-\frac{1}{2}a^2e^{-2y}+b$
$\dfrac{\partial z}{\partial y}+x\dfrac{\partial z}{\partial x}=\left(\dfrac{\partial z}{\partial x}\right)^2$

$\dfrac{\partial^2z}{\partial x\partial y}+x\dfrac{\partial^2z}{\partial x^2}+\dfrac{\partial z}{\partial x}=2\dfrac{\partial z}{\partial x}\dfrac{\partial^2z}{\partial x^2}$

$\dfrac{\partial^2z}{\partial x\partial y}+\left(x-2\dfrac{\partial z}{\partial x}\right)\dfrac{\partial^2z}{\partial x^2}=-\dfrac{\partial z}{\partial x}$

Let $u=\dfrac{\partial z}{\partial x}$ ,

Then $\dfrac{\partial u}{\partial y}+(x-2u)\dfrac{\partial u}{\partial x}=-u$

Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:

$\dfrac{dy}{dt}=1$ , letting $y(0)=0$ , we have $y=t$

$\dfrac{du}{dt}=-u$ , letting $u(0)=u_0$ , we have $u=u_0e^{-t}=u_0e^{-y}$

$\dfrac{dx}{dt}=x-2u=x-2u_0e^{-t}$ , we have $x=u_0e^{-t}+f(u_0)e^t=u+f(ue^y)e^y$
q+xp-p^2=0

∂f/∂p=(x-2p),

∂f/∂q=1,

∂f/∂x=p,

∂f/∂y=0,

∂f/∂z=0

dx/(-∂f/∂p)=dy/(-∂f/∂q)=dz/(-p ∂f/∂p-q ∂f/∂q)=dp/(∂f/∂x+p ∂f/∂z)+dq/(∂f/∂y+q ∂f/∂z)=(∂∅)/0

dx/(-(x-2p) )=dy/(-1)=dz/(-p(x-2p)-q)=dp/p=dq/0=(∂∅)/0
dy/(-1)=dp/p

log⁡p=-y+log⁡a      

p=ae^(-y)

q+xae^(-y)=(ae^(-y) )^2

q=a^2 e^(-2y)-xae^(-y)

dz=pdx+qdy

dz=ae^(-y) dx+a^2 e^(-2y)-xae^(-y) dy

dz=a(e^(-y) dx-xe^(-y) dy)+a^2 e^(-2y) dy

z=axe^(-y)-1/2 a^2 e^(-2y)+b