Solve the PDE by the method of characteristics.

I am trying to figure out where my solution went wrong. I am off by a factor of two.

$$u_x + u_y + u = e^{x+2y}$$

I first found that the characteristic curves are determined by $$\frac{dy}{dx} = 1 \implies y-x = C.$$

I then solved the ODE $$\frac{du}{dx} + u = e^{x+2y}$$

I found $u = \frac12 e^{x+2y} + e^{-x}K(C)$ giving $$u = \frac{e^{x+2y}}{2} + e^{-x}F(y-x)$$ as the general solution where $F$ is an arbitrary function. Where does my work go wrong?

The end solution should be half of what it currently is.

• Were you given any initial data? – mattos Jan 29 '15 at 2:57
• And from your solution for $u$ you actually get $$u_x + u_y + u = 2\exp(x + 2y) - \exp(-x)F(x-y)$$ not $$u_x + u_y + u = 2\exp(x + 2y)$$ – mattos Jan 29 '15 at 3:01
• Your problem lies in the fact that you solved the ODE $$\frac{du}{dx} + u = \exp(x + 2y)$$ incorrectly. – mattos Jan 29 '15 at 3:27
• Possible duplicate of Solve $u_x + u_y + u = e^{x+2y}$ – Yanior Weg Oct 4 '19 at 16:38

\begin{align} u_x + u_y + u &= e^{x + 2y} \\ \implies u_x + u_y &= e^{x + 2y} - u \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*)\\ \end{align}

Setting $u = u(x(s),y(s))$ we find

\begin{align} \frac{d}{ds} u &= \frac{\partial u}{\partial x} \cdot \frac{dx}{ds} + \frac{\partial u}{\partial y} \cdot \frac{dy}{ds} \\ &= \frac{\partial u}{\partial x} \cdot 1 + \frac{\partial u}{\partial y} \cdot 1 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (1) \\ &= e^{x + 2y} - u \end{align}

Where $(1)$ comes from our original PDE at $(*)$. Equating, we find

\begin{align} \frac{dy}{ds} &= 1 \\ \frac{dx}{ds} &= 1 \implies \frac{dx}{dy} = 1 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (2) \\ \frac{du}{ds} &= e^{x + 2y} - u \implies \frac{du}{dy} + u = e^{x + 2y} \ \ \ \ \ \ \ \ \ \ \ \ \ (3) \\ \end{align}

Solving $(2)$ and $(3)$

$$x(y) = x_0 + y \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (4)$$

\begin{align} \frac{du}{dy} + u &= e^{x + 2y} \\ &= e^{x_0 + 3y} \\ \implies (e^{y}u)' &= e^{x_0 + 4y} \\ \implies e^{y}u &= \frac{e^{x_0 + 4y}}{4} + f(x_0) \\ \implies u &= e^{-y} \bigg(\frac{e^{x_0 + 4y}}{4} + f(x_0) \bigg) \\ &= \frac{e^{x_0 + 3y}}{4} + e^{-y}f(x_0) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (5) \\ \end{align}

and using $(4) \implies x_0 = x - y$ we find

$$u = \frac{e^{x + 2y}}{4} + e^{-y}f(x - y)$$