Determine $u(x,t)$ for the following inhomogeneous equation when
$$u_t + cu_x = xt, \quad u(x,0) = f(x),$$ using the method of characteristics>
I got $$\dfrac{xt^2}{2} - \frac{ct^3}{6} + f(x-ct).$$ Is this correct?
The next question is as follows: Determine $u_t + cu_x = u^2; u(x,0)=f(x)$. I understand that in using the method of characteristics, where $v(t)=u(x(t),t)$, that $\frac{dv}{dt}=u^2=v^2$. However, I am stuck at integration $v^2$ with respect to $t$. Using my knowledge of ODE's (seperation of parts), I found that $v(t) = \frac{-u(x_0, 0)}{t-1}$, where $x(0)=x_0$. This gives $u(x,t)=\frac{-f(x-ct)}{t-1}$. Is this correct?
Thank you in advance!