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.
You can easily check whether it satisfies your PDE. With $u(x,y)=\cos(ye^{-x})e^{-x}$ you get $$\frac{\partial}{\partial x}u(x,y)+y\cdot\frac{\partial}{\partial y}u(x,y)= -e^{-x}\cos(ye^{-x})e^{-x}=-u(x,y)$$ and also $$u(0,y)=\cos(y).$$ Thus YES, your result is correct.