Burgers' Equation with Initial and Boundary Conditions Consider a first-order PDE:
$$u_t + (1 + 2u)u_x = 0$$
valid on 
$$0 \leq x \leq \infty$$
$$0 \leq t \leq \infty$$
with 
Initial condition:
$$u(x, 0) = 0$$
and boundary condition:
$$u(0,t) = \begin{cases} 
1, & 0\leq t \leq 1 \\
t, & 1\leq t \leq \infty 
\end{cases} $$
I haven't encountered 1st-order PDEs with both an initial condition and boundary condition before, so I'm a bit confused on how to analytically solve. I generally understand the method of characteristics, and that an implicit general solution of $u = f(x - (1+2u)t)$. However when pluggin in initial conditions, I seem to get contradictory statements that I'm not sure how to interpret. 
Plugging in $u(x,0)$ results in $f(x) = 0$.
Plugging in $u(0,t)$ results in $f(-t^2-2t) = t$ and $f(-3t) = 1$ respectively.
Not sure how to combine all of these, so some insight would be greatly appreciated!
 A: I believe that the best way to solve this is to draw the $x$-$t$ plane and use the characteristic lines and the fact that the solution to this equation is constant along the characteristic lines. 
The first section of the $x$-$t$ plane is when $x>t$ (right of the line with slope 1), which corresponds to information from the initial condition, so $u=0$ in this region.
The second region is where information is carried from the BC $u=1$ from $t\in(0,1)$. In this region, the characteristics have slope $1/3$ in the $x$-$t$ plane, so the characteristics will collide with $x=t$, forming a shock. Nevertheless, we have $u=1$ when $x<t$ and $x>3(t-1)$.
For the third region, which corresponds to $x<3(t-1)$, the slopes of the characteristics vary depending on where they start on the $t$-axis, the value of which we will call $s$. The characteristic lines then have the form $t=x/(1+2s)+s$ and along this characteristic, $u=s$. We can solve this first equation for $s$, which yields a quadratic equation with 2 real roots. One of them is not feasible (remember we need $s>1$) and the other is, so we can write $u(x,t)=s=(-1 + 2 t + \sqrt{(2t+1)^2 - 8 x})/4$
$$
u(x,t) = 
\begin{cases}
0, & x\geq t \\
1, & x<t \text{ and }x\geq 3(t-1) \\
\frac{-1 + 2 t + \sqrt{(2t+1)^2 - 8 x}}{4}, & x<3(t-1)
\end{cases}, \ \forall x,t>0.
$$
