I have some questions about solving a partial differential equation using the method of characteristics.
The PDE is:
$\frac{\partial \rho}{\partial t}-x u \frac{\partial \rho}{\partial x}=0$
where $\rho$ is density, $t$ is time, $x$ is spatial position and $u$ is velocity. I am given that the initial value of density is one for all $x$-values.
I am given that $\rho(x,t=0)=1$.
I have tried to solve it like this:
First I found $\frac{\partial x}{\partial t}=x u$.$\;\;\;\;\;\;u=u(t)$.
This gives the following: $ln x=-\int{u(t)dt}$
$x=e^{-C\int{u(t)dt}}$ where $C$ is the constant of integration. This gives us that $x(t=0)=xe^{C\int{u(t)dt}}$. I believe this should be correct. If this is correct, how can I get the expression for the density, when I am given that $\rho(x,t=0)=1$ using the method of characteristics?
NEW INITIAL CONDITION:
If we assume that the initial value is instead:
$\rho(x,t=0)=1+e^{-x_0^2}$.
Does anyone then know how we could solve this? I am struggling to solve for $dx/dt=a(x,t)=x u(t)$. How can we solve this?
$$\frac{\partial \rho}{\partial t}-x u \frac{\partial \rho}{\partial x}=0$$ $u(t)$ is a known function.
Initial condition : $\rho(x,t=0)=1+e^{-x^2}$.
SOLVING FOR THE GENERAL SOLUTION :
The set of ODEs for the characteristic curves is : $\quad\frac{dt}{1}=\frac{dx}{-xu}=\frac{d\rho}{0}$
A first family of characteristics curves comes from $d\rho=0 \quad\to\quad \rho=c_1$
A second family of characteristics curves comes from $\quad u(t)dt=-\frac{dx}{x} \quad\to\quad xe^{\int u(t)dt }=c_2$
The general solution expressed on the form of implicit equation is : $\quad\Phi\left(\rho\:,\:xe^{\int u(t)dt }\right)=0$ where $\Phi$ is any differentiable function of two variables. Or, equivalently, on explicit form : $$\rho(x,t)=F\left(xe^{\int u(t)dt }\right)$$ where $F$ is any differentiable function.
PARTICULR SOLUTION ACCORDING TO THE INITIAL CONDITION :
$\rho(x,0)=1+e^{-x^2}=F\left(xe^{\int_0^0 u(t)dt }\right)=F(x)$
The function $F$ is determined $\quad\to\quad F(X)=1+e^{-X^2}\quad$ any dummy variable $X$.
Putting this function into the above general solution with $X=xe^{\int_0^t u(\tau)d\tau} $ leads to : $$\rho(x,t)=1+e^{-\left(xe^{\int_0^t u(\tau)d\tau} \right)^2}$$