TITLE: Solution to $u_x + y u_y = -u$ with $u(0, y) = \cos y$
QUESTION [2 upvotes]: I am studying for my PDEs test and I want to make sure I can solve this type of equations.
I used the method of characteristics.
$$\frac{\mathrm{d}y}{\mathrm{d}x} = \frac{b}{a} = y$$
Integrating I get
$$C = ye^{-x}$$
where $C$ is a constant.
I can make the substitutions
$$\xi = x$$
$$\eta = ye^{-x}$$
$$u(x,y) = w(\xi,\eta)$$
Substituting in the PDE, in terms of $w, \eta, \xi$ it becomes
$$\frac{\mathrm{d}w}{\mathrm{d}\xi} + w = 0$$
I used the Integrating factor method to solve this ODE, which gives
$$w = f(\eta) e ^{-\xi}$$
If we substitute back to $u, x, y$ this becomes
$$w(\xi,\eta)=u(x,y)=f(ye^{-x})e^{-x}$$
The initial conditions give
$$u(0,y)=\cos y =f(y)$$
Thus, the final solution is
$$u(x,y) = \cos (ye^{-x})e^{-x}$$
Is this correct? Thanks in advance.

REPLY [0 votes]: Thats correct 
$$u_x + y u_y = -u$$
$$u_x + y u_y +u=0$$
$$u_x + \frac {\partial}{\partial_y}(yu)=0$$
$$\frac 1 y\frac {\partial}{\partial_x}(yu) + \frac {\partial}{\partial_y}(yu)=0$$
$$\frac {\partial}{\partial_x}(yu) +y \frac {\partial}{\partial_y}(yu)=0$$
We have that $uy=c_2$
$$\frac {dx}1=\frac {dy}y \implies c_1=\frac {e^x}y$$
$$uy=f(\frac {e^x}y)$$
$$u(x,y)=\frac 1 y f(\frac {e^x}y)$$
$$u(0,y)=\frac {f(1/y)}y  \implies f(y)=\frac {\cos (1/y) }y$$
Therefore
$$u(x,y)=e^{-x}\cos (ye^{-x})$$
{"set_name": "stack_exchange", "score": 2, "question_id": 2928660}