I am having some issue with a conservation law, where there is a step source term. Anyway, I have the following PDE

$\displaystyle u_t + a u_x = f(t,x), \quad u(x,0) = 0, \quad a >0$

$\displaystyle f(t,x) = \begin{cases} 1 & x\ge 0\\ 0 & \text{otherwise}\end{cases}$

Using method of characterstics and letting

$\displaystyle x(0) = \xi,\; t(0)=0, \hat{u}=u$

we have

$\displaystyle \dfrac{dt}{d\tau} = 1,\quad \dfrac{dx}{d\tau} = a,\quad \dfrac{d\hat{u}}{d\tau} = f(t,x)$

This implies that

$\displaystyle t = \tau,\quad \xi = x - at$.

From this point is where I get a little confused.

$\displaystyle d\hat{u} = f(t,x) d\tau$

Our ODE is piecewise

$\displaystyle d\hat{u} = \begin{cases} 1 & \xi \ge 0 \\ 0 & \text{otherwise}\end{cases}$.

So the solution to the ODE is

$\displaystyle \hat{u} = \begin{cases} \tau & \xi \ge 0 \\ 0 & \text{otherwise}\end$.

Which leads to the final solution

$\displaystyle \hat{u} = \begin{cases} t & x \ge at \\ 0 & \text{otherwise}\end$.

However, I know the solution is suppose to be

$\displaystyle u(t,x) = \begin{cases} 0 & x\le 0 \\ x/a & 0 < x < at \\ t & x \ge at\end$.