Using method of characteristics to solve transport equation Question I am working on:
Use the method of characteristics to ﬁnd a solution for the generalized transport equation for $u(t,x)$ given by $$u_t+x^2u_x=0$$ for $x > 0$ and $t > 0$, with initial condition $u(0,x) = \cos(x)$ and subject to $u(t,0) = 1$. Describe the asymptotic behavior of the solution for t →∞. Does the problem have a solution for all x∈R? 
I am having difficulty because from what I was familiar with in class my solution should be $\cos(x-x^2t)$ because $u_x$ is being multiplied by $x^2$, but taking the partial derivative with respect to $x$ and $t$ shows this isn't a solution. Any help would be greatly appreciated.
 A: The equation $u_t+x^2u_x = 0$ asserts that $\langle \nabla u(t,x), (1,x^2) \rangle = 0$, and so $u$ is constant along the curves determined by $$\frac{{\rm d}x}{{\rm d}t} = \frac{x^2}{1} = x^2.$$Hence $$\frac{1}{x^2}\frac{{\rm d}x}{{\rm d}t} = 1 \implies -\frac{1}{x} = t+c \implies x = \frac{-1}{t+c},$$great. So $$u(t,x) = u\left(t, \frac{-1}{t+c} \right) = u(0,-1/c) = \cos(-1/c).$$Since $$x = \frac{-1}{t+c} \implies c = -t-\frac{1}{x} = \frac{-tx-1}{x} \implies -\frac{1}{c} = \frac{x}{1+tx},$$we get $$u(t,x) = \cos\left(\frac{x}{1+tx} \right).$$The condition $u(t,0) = 1$ is satisfied. This won't be defined for all $x \in \Bbb R$ unless $t=0$ (you'll always have trouble when $1+tx=0$). When $x \neq 0$ and $t \to \pm \infty$ it's clear that $u(t,x) \to 1$.
A: You want to examine your solution function along 
$$\bigg(t,-\frac{1}{t-\frac{1}{x_0}}\bigg)$$
where this curve was derived by solving the system 
$$
t'(s)=1\implies t=s\\
x'(s)=x^2\implies x(t)=-\frac{1}{t-\frac{1}{x_0}}
$$
then we have $u$ constant along this trajectory since 
$$
\dot{u}(t,x(t))=0
$$
and thus 
$$
u(t,x(t))=u_0(x_0)=\cos(x_0)
$$
and solving for $x_0$ in terms of $x,t$ which we are very lucky to be able to do, we have
$$
x_0=\frac{x}{xt+1}
$$
and thus
$$
u(t,x)=\cos\bigg(\frac{x}{xt+1} \bigg)
$$
It isn't too hard to see when you're going to have problems defining this (i.e. for which $x$ the denominator blows up). Similarly, taking the limit 
$$
\lim_{t\to +\infty}u(t,x)=\lim_{t\to +\infty}\cos\bigg(\frac{x}{xt+1} \bigg)=1
$$
