I'm trying to solve the following PDE:
$$x z_x -xyz_y = z \quad with\quad z(x,x) =x^2 e^x \quad (x,y) \in \mathbb{R}^2.$$
I've proceeded as, $$\frac{dx}{ x} = \frac{dy }{-xy } \Rightarrow y = C e^{-x}, $$ so $$\frac{dz}{ dx} = z \Rightarrow z = G(C) e^x .$$
Using the given curve, $$ \begin{split} z(x,x) &= G\left(\frac{ x}{ e^{-x}}\right) e^x = x^2 e^x\\ \\ & \Rightarrow G(t) = t^2 e^{2x} (\text{ I am not sure this is the only possible form of }G). \end{split} $$ Hence,
$$z(x,y) = y^2 e^x,$$ but the thing is, this does not satisfy the given PDE: $$ x (y^2 e^x) - xy (2y e^x) = -xy^2e^x \not = z. $$ I'm assuming that there is a problem while finding the characteristic curve since I cancelled $x$s there, but not sure why would that cause a problem, so I'm looking for both a solution and an explanation what is wrong in my wrong solution.
You need to consider the full set of Lagrange equations $$ \frac{dx}{x}=\frac{dy}{-xy}=\frac{dz}{z} $$ so that indeed $ye^x=c_1$, but from the first and third equation you get $\ln x = \ln z +C\implies z=c_2x$, so that in conclusion the general solution form is $$ z=x\phi(ye^x) $$