Cauchy Problem (PDE) 
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?
 A: 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}
$$
A: $$\frac{\partial u}{\partial t} − u\frac{\partial u}{\partial x} = −2u$$
System of characteristic ODEs : $\quad \frac{dt}{1}=\frac{dx}{-u}=\frac{du}{-2u}$
A first family of characteristic curves comes from $\quad \frac{dx}{-u}=\frac{du}{-2u} \quad\to\quad du-2dx=0$
$$u-2x=c_1$$
A second family of characteristic curves comes from $\quad \frac{dt}{1}=\frac{du}{-2u} \quad\to\quad \ln|u|=-2t+$constant.
$$e^{2t}u=c_2$$
The general solution of the PDE is obtained on the form of implicit equation :
$$\Phi\left((u-2x)\:,\:(e^{2t}u) \right)=0$$
where $\Phi$ is an arbitrary function of two variables, to be determined according to the initial condition.
Or equivalently :
$$u-2x=F(e^{2t}u)$$
where $F$ is an arbitrary function, to be determined according to the initial condition.
CONDITION : $\quad u(x,0)=x$ to be put into the above general solution.
$$x-2x=F(e^{2(0)}x) \quad\to\quad F(x)=-x$$
So, the function $F$ is determined : $\quad F(X)=-X\quad$ any $X$.
Putting it into the above general solution where $\quad X=e^{2t}u\quad$ leads to :
$$u-2x=-(e^{2t}u)$$
$$u=\frac{2x}{1+e^{2t}}$$
