Given $u_t+cu_x=b(x,t)$ with initial value $u(x,0)=\phi(x)$, I am asked to derive the following general solution $$u=\phi(x-ct)+\int_{0}^t b(x-c(t-\tau),\tau)d\tau$$
I am not sure how to proceed with this $b(x,t)$. I have solved such PDE where the explicit form of $b(x,t)$ given, but not in the general case. I tried the method of characteristics, $$\frac{dt}{1}=\frac{dx}{c}=\frac{du}{b(x,t)}$$ but got stuck. Hope someone could help! Thanks.
$$u_t+cu_x=b(x,t)$$ You have correctly written the Charpit-Lagrange system of ODEs : $$\frac{dt}{1}=\frac{dx}{c}=\frac{du}{b(x,t)}$$ A first characteristic equation comes from solving $\frac{dt}{1}=\frac{dx}{c}$ : $$x-ct=C_1\quad\implies\quad x=C_1+ct$$ A second characteristic equation comes from solving $dt=\frac{du}{b(x,t)}=\frac{du}{b\left(C_1+ct\:,\:t\right)}$ $$du-b\left(C_1+ct\:,\:t\right)dt=0$$ $$u-\int_0^t b\left(C_1+c\tau\:,\:\tau\right)d\tau=C_2$$
The general solution of the PDE $\quad C_2=\phi(C_1)\quad$ is : $$u-\int_0^t b\left((x-ct)+c\tau\:,\:\tau\right)d\tau=\phi(x-ct)$$
$\phi$ is an arbitrary function (to be determined according to some initial condition). $$u=\phi(x-ct)+\int_{0}^t b(x-c(t-\tau),\tau)d\tau$$