In this question you are asked to solve the initial value problem \begin{aligned} u_t +uu_x &= x,\\ u(x, 0) &= f(x) \end{aligned} using the method of characteristics. Using the parameters $s$ and $τ$, show that the solution can be expressed as
$$u(s, τ ) = \frac{1}{2}(f(s) + s) e^τ +\frac{1}{2} (f(s) − s) e ^{−τ}$$
I tried using Method of characteristics but cannot get the answer.
$\frac{dt}{ds} = 1$, $ \frac{dx}{ds} =u$ and $\frac{du}{ds} =x$.
This gives $\frac{dx}{du} =x/u $ which does not give the solution as above. How do i get the above solution. Thanks.
Let us apply the method of characteristics.
To obtain $u(x, t)$, one eliminates $s$ by using the expression of $x(\tau)$. Here, it is hard to express $s$ in terms of $x(\tau)$ and $\tau$ for general initial data $f$, but it is possible in some particular cases. For instance, if $f(s) = a s$, then $$ u(x,t)= x \frac{a+\tanh t}{1 + a\tanh t} $$ as long as $t \neq \text{argtanh}(-1/a)$.