So I have got the following equation: $$x\frac{\partial u}{\partial x} - 2 \frac{\partial u}{\partial y} = 2u$$
I have tried to solve the following way. I was taught that LHS can be thought of as the directional derivative of $u$ in the direction of the vector $\begin{bmatrix}x \\ -2\end{bmatrix}$. Therefore, on the curves defined by $$\frac{dy}{dx} = \frac{-2}{x} ==> y = - 2ln(x) + K$$ the PDE reduces to an ODE of the form: $$\frac{du}{dx} = 2u ==> u = e^{2x}e^K$$ where $k$ is a constant. Therefore $u(x,y)$ must be: $$ e^{2x} f(y + 2ln(x))$$ where $f$ is any arbitrary function. However this solution is wrong (I have plugged in the equation and checked with Maple).
This line is not correct $$\frac{du}{dx} = 2u ==> u = e^{2x}e^K$$ It should be $$\frac{du}{2u} = \frac {dx}x \implies ..... $$
Here is my approach
$$x\frac{\partial u}{\partial x} - 2 \frac{\partial u}{\partial y} = 2u$$ Lagrange equation is $$\frac {dx}{x}=-\frac {dy}{2}=\frac {dz}{2z}$$ Integrating first equation $$ \int \frac {dx}{x}=-\frac 12 dy \implies \ln(x)=-\frac 12y +C_1$$ $$\implies C_1=\ln(x)+\frac 12y$$ Integrating second eqaution $$-\frac {dy}{2}=\frac {dz}{2z} \implies \ln(z)=-y+C_2$$ $$\implies C_2=\ln(z)+y$$ Therefore $$\ln(z)+y=f(\ln(x)+\frac12y)$$ $$\ln(z)=f(\ln(x)+\frac12y)-y$$ $$\displaystyle u=\displaystyle e^{f(\ln(x)+\frac12y)-y}$$ $$\displaystyle \boxed{u(x,y)=\displaystyle F(\ln(x)+y/2)e^{-y}}$$