Find the solution to the Cauchy data problem
$$\frac{\partial u}{\partial t} − u\frac{\partial u}{\partial x} = −2u$$
where $u(x, 0) = x$.
I know how to solve homogeneous Cauchy problems. However, I am struggling to understand non-homogeneous equations like this one. Can somebody please give a detailed solution?
By characteristics, examining the pde along a curve $U(t)=u(x(t),t)$ where $$ x'(t)=-U(t)\\ U'(t)=-2U(t) $$ solving the second, we find $$ U(t)=U_0e^{-2t} $$ and setting initial conditions to be $x_0=x(0)$ and using the Cauchy data $$ U(0)=x_0 $$ we have $$ U(t)=x_0e^{-2t} $$ giving $$ x'(t)=-x_0e^{-2t}\implies x=x_0(\frac{1}{2}e^{-2t}+\frac{1}{2}) $$ and solving for $x_0$ and plugging in the expression for $U(t)$ we find $$ U(t)=u(x,t)=e^{-2t}\frac{x}{\frac{1}{2}+\frac{1}{2}e^{-2t}}=\frac{2x}{e^{2t}+1} $$