# Solve the PDE $xu_x + u_y+ yu=0$

It is asked to solve the PDE $$xu_x + u_y+ yu=0$$ where $u=u(x,y)$

**My attempt: **

Let $x=x(s), y=y(s), v(s)=u(x,y)$ such that $$\frac{dx}{ds}=x, \;\frac{dy}{ds}=1, \;\frac{dv}{ds}=-yv$$

$\Rightarrow\frac{dx}{dy}=x \Rightarrow \ln|x| = y + C_1$ $\Rightarrow\frac{dv}{dy}=-yv \Rightarrow \ln|v| = - \frac{y^2}{2} + C_2 \Rightarrow v = u = K e^{-y^2/2}$

As $u$ is constant in its characteristcs

$$u=K(\ln|x|-y)e^{-y^2/2}$$

BUt wolfram gave a different answer. What am I doing wrong?

Thanks!

@Edit Now I see that my solution is correct. We just need to substitute $y=\ln|x| - C_1$. Wolfram solved it for $x$.

$\dfrac{dy}{dt}=1$ , letting $y(0)=0$ , we have $y=t$
$\dfrac{dx}{dt}=x$ , letting $x(0)=x_0$ , we have $x=x_0e^t=x_0e^y$
$\dfrac{du}{dt}=-yu=-tu$ , letting $u(0)=f(x_0)$ , we have $u(x,y)=f(x_0)e^{-\frac{t^2}{2}}=f(xe^{-y})e^{-\frac{y^2}{2}}$