How to solve this partial differntial equation?
$\begin{cases} uu_t+u_x=2 \\ u(0,x)=1+x \\ t\geq0 \end{cases}$
I tried to do the method of characteristics as follows:
$\frac{\partial x}{\partial s}=1\Rightarrow dx=ds$
$\frac{\partial u}{\partial s}=2\Rightarrow d u=2\,dx\Rightarrow u=2x+f(t)$
$\frac{\partial t}{\partial s}=\frac{\partial t}{\partial x}=u\Rightarrow 2\,dt=u\,du\Rightarrow 2t+g(x)=0.5u^2\Rightarrow u=\sqrt{4t+h(x)} $
But I definitley don't bring the two expressions $u=2x+f(t)$ and $u=\sqrt{4t+h(x)}$ together, so how to proceed at this point?
Your system of ODE's are correct for the PDE via method of characteristics. However, when solving the ODE's something went wackodoodle. Keep in mind these ODE's are total derivatives with respect to the characteristic coordinate, not partials. $$\frac{dx}{ds}=1\implies x=s+x_0\implies x_0=x-s\tag1$$ $$\frac{du}{ds}=2\implies u=2s+u(x_0)=2s+1+x_0\tag2$$ $$\begin{align}\frac{dt}{ds}=u=2s+u(x_0)\implies t&=t_0+s^2+s\,u(x_0)=s^2+s\,u(x_0)\tag3\\&=s(s+1+x_0)=s(1+x)\\&\implies s=\frac{t}{1+x}\end{align}$$ $$\implies x_0=x-\frac{t}{1+x}$$ We have now successfully inverted $(1)$ and $(3)$ and can plug it into $(2)$ to obtain our answer. $$u=1+x+\frac{t}{1+x}$$ Plugging this into the original PDE confirms the result.