# Advection equation with source u/x

I am trying to solve following equation:

$$u_t + u_x + \frac{u}{x} = 0$$

With initial condition: $$u(x,0) = 0$$

And with boundary condition given at x = 15: $$u(15,t) = sin (wt)$$

I tried to transform it to the form of: $$u_t + u_x =- \frac{u}{x}$$

And solve it with method of characteristics. However, 1) I am not sure how to treat x on the right side (all online examples have source term either x or u, never both). 2) I am not sure when and how to insert this boundary condition in this equation?

My kind of solution always include e, and solution provided by tutor does not contain any e terms.

I tried following this example Advection Equation with $f(x)\cdot u(x,t)$ source term, however I did not understand it completely, specifically part "which can easily be integrated to yield..."

## 1 Answer

Just follow the method of characteristics, which in your case reads:

$$dt = dx = \frac{du}{-u/x}.$$

From 1st and 2nd we have $t-x = c_1$ is a characteristic of the PDE. From 2nd and 3rd we would have that $u = c_2/x$ is the other characteristic curve. Put $c_2$ as a function of $c_1$ and you are done!

Cheers!

• Thank you for fast reply, but I am not sure what do you mean by "From 2nd and 3rd we would have that u=c2e−x2/2" From 2nd and 3rd I get dx/x = - (du/u), so it yield ln x = ln u, i.e. u = x + constant? – nevermind Oct 17 '14 at 9:27
• You are totally right! (except for the sign) – Dmoreno Oct 17 '14 at 9:47
• Heh, thanks, but that does not lead me a long way. Thx anyway, I will try to use ideas provided above. – nevermind Oct 17 '14 at 10:16
• Hi @nevermind! Consider accepting the answer in order to completely close your question. Thanks in advance! – Dmoreno Oct 22 '14 at 8:33