Solve the PDE for $u$: $u_t + \sin(t)u_x = x^2$ with init $u(0,x) = \sin x$ Solve the PDE for $u$: $u_t + \sin(t)u_x = x^2$ with initial condition $u(0,x) = \sin x$:
I have started solving with the method of characteristics such that:
$$\frac{dx}{dt}=\sin t$$
$$x = -\cos(t)+x_o$$
and
$$\frac{du}{dt} = x^2$$
$$du = (-\cos(t) + x_o)^2 \, dt$$
$$u = tx_o^2 - 2x_o \sin(t) + \frac{t}{2} + \frac{1}{2} \sin(t) \cos(t) $$
$$u(0,x_o) = 0 = \sin(x_o)$$
which gives
$$x_o = \pi k$$ for any integer $k$
Then from here I am a bit confused as to how to plug that back into the original equation. Would it be:
$$u(x,t) = t\pi^2 -2\pi \sin(t) +\frac{t}{2} + \frac{1}{2}\sin(t)\cos(t)$$
 A: FIRST PART : General solution of $\quad u_t+\sin(t)u_x=x^2\quad$ with the method of characteristics.
The system of characteristic differential equations is :
$$\frac{dt}{1}=\frac{dx}{\sin(t)}=\frac{du}{x^2}$$
A first characteristic equation comes from $\frac{dt}{1}=\frac{dx}{\sin(t)}\quad\to\quad dx-\sin(t)dt=0$
$$x+\cos(t)=c_1$$ 
A second characteristic equation comes from $\frac{dt}{1}=\frac{du}{x^2}=\frac{du}{\left(c_1-\cos(t)\right)^2}\quad\to\quad du-\left(c_1-\cos(t)\right)^2 dt=0$
$u-c_1^2t+2c_1\sin(t)-\frac{1}{2}t-\frac{1}{2}\sin(t)\cos(t)=c_2$
$$u-\left(x-\cos(t)\right)^2t+2\left(x-\cos(t)\right)\sin(t)-\frac{1}{2}t-\frac{1}{2}\sin(t)\cos(t)=c_2$$
The general solution expressed on the form of implicit equation is :
$$\Phi\left(\left(x-\cos(t)\right)\:,\: \left(u-\left(x-\cos(t)\right)^2t+2\left(x-\cos(t)\right)\sin(t)-\frac{1}{2}t-\frac{1}{2}\sin(t)\cos(t) \right) \right)=0$$
where $\Phi$ is any differentiable function of two variables.
An equivalent explicit form is :
$$u=\left(x-\cos(t)\right)^2t-2\left(x-\cos(t)\right)\sin(t)+\frac{1}{2}t+\frac{1}{2}\sin(t)\cos(t)+F\left(x-\cos(t)\right)$$
where $F$ is any differentiable function.
SECOND PART : Search for a particular solution fitting with the initial condition $u(x,0)=x^2$ .
In $t=0\quad\to\quad u(x,0)=F\left(x-1\right)=x^2$ . Then the function $F(X)=(X+1)^2$ is determined.
With $X=x-\cos(t) \quad\to\quad F\left(x-\cos(t)\right)=\left(x-\cos(t)+1\right)^2$ :
$$u(x,t)=\left(x-\cos(t)\right)^2t-2\left(x-\cos(t)\right)\sin(t)+\frac{1}{2}t+\frac{1}{2}\sin(t)\cos(t)+\left(x-\cos(t)+1\right)^2$$
