Solving $u_y + (1-2u)\cdot u_x = 0$ using characteristic equations I need to solve the following partial differential equation:
$$F(x, y, u, p, q) = u_y + (1-2u)\cdot u_x = 0$$
with $$u(x, 0) = \left\{\begin{array}{cc} \frac{1}{4} &amp; x &lt; 0 \\ \frac{3}{4} &amp; x&gt;0 \end{array}\right.$$
Here we have $p = u_x$ and $q = u_y$. $u(x,y)$ is a continously differentiable function and $-\infty &lt; x &lt; \infty$ and $0 &lt; y &lt; \infty$.

I use the characteristic differential equations to get a solution. These are
$$
\left\{\begin{array}{ll}
\frac{dx}{ds} = F_p = 1-2u \\
\frac{dy}{ds} = F_q = 1\\
\frac{du}{ds} = pF_p+qF_q = p(1-2u) + q\\
\frac{dp}{ds} = -F_x - pF_u = 2p^2\\
\frac{dq}{ds} = -F_y - qF_u = 2pq \end{array}\right.
$$

The initial conditions are, if $s=0$, that $x = \lambda, y = 0,$
$$
u = \left\{\begin{array}{cc}
\frac{1}{4} &amp; \lambda &lt; 0\\
\frac{3}{4} &amp; \lambda &gt; 0\end{array}\right.
$$
and, using that $$0 = \frac{du}{d\lambda} = p(\lambda)\frac{dx}{d\lambda} + q(\lambda)\frac{du}{d\lambda} = p(\lambda)\cdot 1 + 0$$
and $$ 0 = q + (1-2u)p = q + (1-2)\cdot 0 = q$$
we get $p=q=0$.

From this, it is easily seen that $y = s$. But from here, I'm stuck. The general solution of $\frac{dp}{ds} = 2p^2$ is $p(s) = \frac{1}{c_1 - 2s}$. It impossible for this function to sattisfy the initial condition, so does that mean that this partial differential equation doesn't have a solution?

Another thing is that the initial condition for $u(x, 0)$ isn't continous, so how can the solution of this problem be continously differentiable?
The PDE $u_y + (1-2u)u_x = 0$ is the Lighthill-Whitham-Richards traffic flow equation. The proposed initial-value problem may be interpreted as a one-way road with the car density $u=1/4$ before the abscissa $x=0$ (fast cars), and the car density $u=3/4$ after the abscissa $x=0$ (slow cars). In mathematical words, this is a Riemann problem, which cannot be solved by using the method of characteristics alone: we should consider weak solutions. The Lax entropy condition tells that the solution is a shock wave. Its speed is given by the Rankine-Hugoniot condition $s = 1- \frac{1}{4} - \frac{3}{4} = 0$. Therefore, the solution is a static shock wave
$$
u(x,y) = \left\lbrace
\begin{aligned}
&amp;1/4 &amp;&amp;\text{if}\quad x&lt;0\\
&amp;3/4 &amp;&amp;\text{if}\quad x&gt;0
\end{aligned}\right.
$$
Follow the method in http://en.wikipedia.org/wiki/Method_of_characteristics#Example:

$\dfrac{dy}{dt}=1$ , letting $y(0)=0$ , we have $y=t$

$\dfrac{du}{dt}=0$ , letting $u(0)=u_0$ , we have $u=u_0$

$\dfrac{dx}{dt}=1-2u=1-2u_0$ , letting $x(0)=f(u_0)$ , we have $x=(1-2u_0)t+f(u_0)=(1-2u)y+f(u)$ , i.e. $u=F(x+(2u-1)y)$

$u(x,0)=\begin{cases}\dfrac{1}{4}&amp;x&lt;0\\\dfrac{3}{4}&amp;x&gt;0\end{cases}$ :

$F(x)=\begin{cases}\dfrac{1}{4}&amp;x&lt;0\\\dfrac{3}{4}&amp;x&gt;0\end{cases}$

$\therefore u=\begin{cases}\dfrac{1}{4}&amp;x+(2u-1)y&lt;0\\\dfrac{3}{4}&amp;x+(2u-1)y&gt;0\end{cases}=\begin{cases}\dfrac{1}{4}&amp;x-\dfrac{y}{2}&lt;0\\\dfrac{3}{4}&amp;x+\dfrac{y}{2}&gt;0\end{cases}$

Hence $u(x,y)=\begin{cases}\dfrac{1}{4}&amp;x&lt;\dfrac{y}{2}\\\dfrac{3}{4}&amp;x&gt;-\dfrac{y}{2}\\c&amp;\text{otherwise}\end{cases}$