# 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?

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}
• Why is $y(0) = 1$? – Taln Apr 4 '18 at 4:19
• Since you have the initial condition $u(x, 1) = x^2$, then it's natural to set $y=1$ at $s=0$. – Jacky Chong Apr 4 '18 at 4:20
Basically, you want your characteristic curves to pass through the line $(x,1)$ in $\mathbb{R}^2$.
Checking your solutions, $$\begin{cases} x(s)=s+x_0\\ y(s)=y_0e^s\\ u(s)=u_0e^{-s} \end{cases}$$ where it would be convenient to take $y_0=1$, since this brings us to the line on which we have boundary data. Then, we get $$u_0=u(0)=u(x_0,1)=x_0^2$$ and we derived the following system $$\begin{cases} x=s+x_0\\ y=e^s\\ u=x_0^2e^{-s} \end{cases}\\ \implies u(x,y)=\frac{x_0^2}{y}=\frac{(x-\log y)^2}{y}$$