Method of Characteristics - Lagrange-Charpit Equations

I need to solve the following PDE with initial condition $$U(x,0)=U_0(x)$$. Once this is one of my first times, I'd like to get second opinions.

Many Thanks.

$$$$\partial_t U + (\text{cos}(t)+1)\partial_x U = -2,$$$$

The characteristic curves are given by Lagrange-Charpit equations: $$$$\dfrac{dt}{1}=\dfrac{dx}{(\text{cos}(t)+1)}=\dfrac{dU}{-2},\qquad(i)$$$$

Following: $$$$\dfrac{dU}{dt}=-2.\qquad(ii)$$$$

Solving this EDO $$$$U(x(t),t)=-t+c_1\qquad(iii)$$$$

By other hand: $$$$\dfrac{dx}{dt}=(\cos(t)+1).\qquad(iv)$$$$

So: $$$$x(t)= t+\sin (t)+c_2.\qquad(v)$$$$

Setting $$x(0)=x_0$$, we get $$c_2=x_0$$. So, the characterhistics are given by: $$$$x(t)=t+\sin (t)+x_0.\qquad(vi)$$$$

The whole solutions is given by: $$$$U(x,t)=-t+U_0(x_0)=-t+U_0\bigg(x-t+\sin (t)\bigg).\qquad(vii)$$$$

Note that while $$U(x,0) = U_0(x)$$, the PDE itself isn't satisfied. \begin{align} U_t + (1 + \cos t)U_x &= -1 + U_0'(x - t + \sin t)(-1 + \cos t) + U_0'(x - t + \sin t)(1 + \cos t) \\ &= -1 + 2\cos t \ U_0'(x - t + \sin t) \\ &\not \equiv -2. \end{align}
But $$\frac{\mathrm{d}U}{\mathrm{d}t} = -2 \implies U(x(t),t) = -2t + c_1$$ and $$x(t) = t + \sin t + x_0 \implies x_0 = x(t) - t - \sin t.$$
• Sorry, as you said it's $x_0=x(t)-t\fbox{$-$}\sin t$, I misplaced the signal in $U_0$ and it's $\fbox{$-2$}t$. So, it will be fine. Many thanks! – Na'omi Jul 30 '19 at 15:12