# Transport Equation with method of characteristics

Given the PDE:

$$\begin{cases}\dfrac{\partial u}{\partial t} + b\dfrac{\partial u}{\partial x} = te^{|x|^2} \quad \mbox{ in} \, \mathbb{R}^n \times (0,\infty) \\ u(x,0) = |x| \quad \mbox{ on} \, \, \mathbb{R}^n \times \left\{ t = 0 \right\} \end{cases}$$

for $b \in \mathbb{R}^n$. By method of characteristics we'd have that $$\dfrac{d}{ds} u(x(s),t(s)) = \dfrac{du}{ds} = \dfrac{\partial u}{\partial x}\dfrac{dx}{ds} + \dfrac{\partial u}{\partial t}\dfrac{dt}{ds}$$ which leads to the system of ODEs: $$\dfrac{dt}{ds} = 1$$ $$\dfrac{dx}{ds} = b$$ $$\dfrac{du}{ds} = -te^{|x|^2}$$ Then, letting $t(0) = 0 \implies t = s$,

letting $x(0) = x_0 \implies x = bs + x_0$,

and letting $u(0,0) = |x_0| \implies u = -tse^{|x|^2} + |x_0|$

Then, finally, we arrive to:

$$u(x,t) = -t^2e^{|x|^2} + |x-bt|$$

Question: My question really is in the step of integrating $$\dfrac{du}{ds} = -te^{|x|^2}$$ Is it simply, $$u = -tse^{|x|^2} + u_0$$ where $u(0,0) = u_0$. Or do I need to substitute my $t = s$ and $|x| = |x_0 + bs|$ and then integrate that function with respect to $s$?

$$\frac{\partial u}{\partial t} + \dfrac{\partial u}{\partial x} = te^{x^2} \tag 1$$ Your system of ODEs, written on a more compact form : $$\frac{dt}{1}=\frac{dx}{b}=\frac{du}{ te^{x^2}}=ds$$ First characteristic equation, from $\frac{dt}{1}=\frac{dx}{b}$ $$x-bt=c_1$$
Second characteristic equation, from $\frac{dt}{1}=\frac{du}{ te^{(c_1-bt)^2}}$ which is separable:
$te^{(c_1-bt)^2}dt=du \quad\to\quad u=\int te^{(c_1-bt)^2}dt=\frac{1}{2b^2}e^{(c_1-bt)^2} - \frac{\sqrt{\pi}c_1}{2b^2}\text{erfi}(c_1-bt)+$constant. $$u-\frac{1}{2b^2}e^{x^2} + \frac{\sqrt{\pi}(x-bt)}{2b^2}\text{erfi}(x)=c_2$$ About the function erfi$(x)$, for example see : http://mathworld.wolfram.com/Erfi.html
The general solution of the PDE $(1)$ is : $$u-\frac{1}{2b^2}e^{x^2} + \frac{\sqrt{\pi}(x-bt)}{2b^2}\text{erfi}(x)=F(x-bt)\tag 3$$ Condition : $u(x,0)=x=\frac{1}{2b^2}e^{x^2} - \frac{\sqrt{\pi}(x)}{2b^2}\text{erfi}(x)+F(x)$ $$F(x)=x-\frac{1}{2b^2}e^{x^2} + \frac{\sqrt{\pi}(x)}{2b^2}\text{erfi}(x)$$ Putting $F(x)$ into Eq.$(3)$ : $$u(x,t)=\frac{1}{2b^2}e^{x^2} - \frac{\sqrt{\pi}(x-bt)}{2b^2}\text{erfi}(x) + (x-bt)-\frac{1}{2b^2}e^{(x-bt)^2} + \frac{\sqrt{\pi}(x-bt)}{2b^2}\text{erfi}(x-bt)$$ or $$u(x,t)=(x-bt)+\frac{1}{2b^2}\left(e^{x^2}-e^{(x-bt)^2}\right) - \frac{\sqrt{\pi}(x-bt)}{2b^2}\left(\text{erfi}(x)-\text{erfi}(x-bt) \right)$$