<s>[INST] Solving for $u(x,y)$ for $u_x + y u_y = -u$, $u(x,1) =x^2$ I wish to solve for $u(x,y)$ from the PDE $u_x + y u_y = -u$, $u(x,1) =x^2$. Since this is a first order linear PDE, I think I should try the method of characteristics. Let $u = u(x(s), y(s))$. 
Then the char equations are $\frac{dx}{ds} = 1$, $\frac{dy}{ds} = y$ and $\frac{du}{ds} = -u$.
Solving: $x = s+c_1$, $y = c_2 e^{s}$, and $u = c_3e^{-s}$. Now I eliminate the $s$ parameter: $s = x - c_1$ which implies $y = c_2 e^{x- c_1}$ and $u = c_3 e^{-x + c_1}$. If I let $x(0) = x_0$, then $x_0 = c_1$. But i'm a little confused on how to proceed. Could anyone advize on this?
 [/INST] Using the fact that $x(0) = x_0$ and $y(0) = 1$, then we see that
\begin{align}
x= x_0 +s, \ \ y= e^s, \ \ \ u(x, y) = u(x_0, 1)e^{-s} = x_0^2e^{-s}.
\end{align}
Finally, since $s= \log y$ and $x_0 = x-s = x-\log y$, then we have that 
\begin{align}
u(x, y) = (x-\log y)^2\exp(-\log y) = \frac{(x-\log y)^2}{y}.
\end{align}
Check: Observe
\begin{align}
u_x= \frac{2(x-\log y)}{y}, \ \ u_y = \frac{-2(x-\log y)-(x-\log y)^2}{y^2} = \frac{-(x-\log y)(2+x-\log y)}{y^2}
\end{align}
which means
\begin{align}
u_x+yu_y = \frac{2(x-\log y)-(x-\log y)(2+x-\log y)}{y} = -\frac{(x-\log y)^2}{y}=-u.
\end{align}
</s>