Linear Transport PDE with Dirichlet Condition Can anyone help me to find the general solution of this PDE?
$$u_t+c\cdot{}u_x=f\left(x,t\right)$$  
$$u(0,t)=0$$
$$u(x,0)=0$$
with $t>0$, $x>0$ and c is constant also greater than zero. 
And what are the requirements on f for the equation to have a solution?
If now we do:
$$u(0,t)=g(t)$$
$$u(x,0)=h(x)$$
Can still be solved? Any compatibility conditions?
Thanks a lot, Karan
 A: Note that this is an overdetermined problem because it has two conditions but the PDE is first-order. The general solution of a first-order PDE is only have one arbitrary function.
First note that the general solution of this PDE can be found by the following approach:
Approach $1$:
Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:
$\dfrac{dt}{ds}=1$ , letting $t(0)=0$ , we have $t=s$
$\dfrac{dx}{ds}=c$ , letting $x(0)=x_0$ , we have $x=cs+x_0=ct+x_0$
$\dfrac{du}{ds}=f(x,t)=f(cs+x_0,s)$ , letting $u(0)=C_1(x_0)$ , we have $u(x,t)=C_1(x_0)+\int_0^sf(cs+x_0,s)~ds=C_1(x-ct)+\int_0^tf(x-c(t-s),s)~ds$
Approach $2$:
Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:
$\dfrac{dx}{ds}=1$ , letting $x(0)=0$ , we have $x=s$
$\dfrac{dt}{ds}=\dfrac{1}{c}$ , letting $t(0)=t_0$ , we have $t=\dfrac{s}{c}+t_0=\dfrac{x}{c}+t_0$
$\dfrac{du}{ds}=f(x,t)=f\left(x,\dfrac{x}{c}+t_0\right)$ , letting $u(0)=C_2(t_0)$ , we have $u(x,t)=C_2(t_0)+\int_0^sf\left(x,\dfrac{s}{c}+t_0\right)ds=C_2\left(t-\dfrac{x}{c}\right)+\int_0^xf\left(x,t-\dfrac{x-s}{c}\right)ds$
When following the approach $1$:
$u(x,0)=h(x)$ :
$C_1(x)=h(x)$
$\therefore u(x,t)=h(x-ct)+\int_0^tf(x-c(t-s),s)~ds$
$\because u(0,t)=h(-ct)+\int_0^tf(-c(t-s),s)~ds$
$\therefore$ when $g(t)=h(-ct)+\int_0^tf(-c(t-s),s)~ds$ , the problem will have perfect non-piecewise solution that $u(x,t)=h(x-ct)+\int_0^tf(x-c(t-s),s)~ds$ .
When following the approach $2$:
$u(0,t)=g(t)$ :
$C_2(t)=g(t)$
$\therefore u(x,t)=g\left(t-\dfrac{x}{c}\right)+\int_0^xf\left(x,t-\dfrac{x-s}{c}\right)ds$
$\because u(x,0)=g\left(-\dfrac{x}{c}\right)+\int_0^xf\left(x,-\dfrac{x-s}{c}\right)ds$
$\therefore$ when $h(x)=g\left(-\dfrac{x}{c}\right)+\int_0^xf\left(x,-\dfrac{x-s}{c}\right)ds$ , the problem will have perfect non-piecewise solution that $u(x,t)=g\left(t-\dfrac{x}{c}\right)+\int_0^xf\left(x,t-\dfrac{x-s}{c}\right)ds$ .
So when the cases that $g(t)\neq h(-ct)+\int_0^tf(-c(t-s),s)~ds$ and $h(x)\neq g\left(-\dfrac{x}{c}\right)+\int_0^xf\left(x,-\dfrac{x-s}{c}\right)ds$ , they are unavoidable to introduce piecewise solutions.
Because you are only interested in the cases that $t>0$ and $x>0$ , so here is a good tool called laplace transform that can fit on your problem.
Approach $1$: transform $x$
$\mathcal{L}_{x\to s}\{u_t\}+c\mathcal{L}_{x\to s}\{u_x\}=\mathcal{L}_{x\to s}\{f(x,t)\}$
$U_t+c(sU-u(0,t))=F(s,t)$
$U_t+c(sU-g(t))=F(s,t)$
$U_t+csU=F(s,t)+cg(t)$
$U(s,t)=e^{-cts}A(s)+e^{-cts}\int_0^te^{c\tau s}F(s,\tau)~d\tau+ce^{-c\tau s}\int_0^te^{c\tau s}g(\tau)~d\tau$
$u(x,t)=\mathcal{L}^{-1}_{s\to x}\{e^{-cts}A(s)\}+\mathcal{L}^{-1}_{s\to x}\left\{e^{-cts}\int_0^te^{c\tau s}F(s,\tau)~d\tau\right\}+c\mathcal{L}^{-1}_{s\to x}\left\{e^{-c\tau s}\int_0^te^{c\tau s}g(\tau)~d\tau\right\}$
$u(x,t)=H(x-ct)a(x-ct)+H(x-ct)\int_0^t\mathcal{L}^{-1}_{s\to x-ct}\{e^{c\tau s}F(s,\tau)\}~d\tau+cH(x-ct)\int_0^t\mathcal{L}^{-1}_{s\to x-ct}\{e^{c\tau s}\}g(\tau)~d\tau$
$u(x,t)=H(x-ct)a(x-ct)+H(x-ct)\int_0^tH(x-c(t-\tau))f(x-c(t-\tau),\tau)~d\tau+cH(x-ct)\int_0^t\delta(x-c(t-\tau))g(\tau)~d\tau$
$u(x,0)=h(x)$ :
$\therefore u(x,t)=H(x-ct)h(x-ct)+H(x-ct)\int_0^tH(x-c(t-\tau))f(x-c(t-\tau),\tau)~d\tau+cH(x-ct)\int_0^t\delta(x-c(t-\tau))g(\tau)~d\tau$ for $x\geq0$
Approach $2$: transform $t$
Similarly, $u(x,t)=H\left(t-\dfrac{x}{c}\right)g\left(t-\dfrac{x}{c}\right)+\dfrac{1}{c}H\left(t-\dfrac{x}{c}\right)\int_0^xH\left(t-\dfrac{x-\tau}{c}\right)f\left(\tau,t-\dfrac{x-\tau}{c}\right)~d\tau+\dfrac{1}{c}H\left(t-\dfrac{x}{c}\right)\int_0^x\delta\left(t-\dfrac{x-\tau}{c}\right)h(\tau)~d\tau~\text{for}~t\geq0$
A: I'm thinking that the solution to the equation could be
$$u\left(x,t\right)=g(t-\frac{x}{c})+\int_{t-\frac{x}{c}}^{t}f\left(x-c(t-s),s\right)\,ds, \text{ if  }x<ct$$
and
$$u\left(x,t\right)=h(x-ct)+\int_{0}^{t}f\left(x-c(t-s),s\right)\,ds, \text{ if  }x>ct$$
and that $f$ is required to be integrable to grant the existence of the solution. And g and h must be $\mathscr{C^1}$ functions.
I have used Duhamel's principle to solve it.
I think now is right.
