# [SOLVED]Solve equation

#### evinda

##### Well-known member
MHB Site Helper
Hello!!! I want to solve the equation $u_t+u^2u_x=0$ with $u(x,0)=2+x$.

I have tried the following:

The characteristic curves for $u_t+u^2 u_x=0$ are the solutions of the ode $\frac{dx}{dt}=u^2$.

We have that $\frac{d}{dt}u(x(t),t)=0$, implying that $u(x(t),t)=c$.

The characteristic line that passes through $(x,t)$ and $(z,0)$ has slope

$\frac{x-z}{t-0}=\frac{dx}{dt}=u^2(x,t)=u^2(z,0)=(2+z)^2$.

Thus, $x-z=t(2+z)^2 \Rightarrow x-z=t(4+4z+z^2)=4t+4tz+tz^2 \Rightarrow z^2t+(4t+1)z+4t-x=0$.

The discriminant is $\Delta=(4t+1)^2-4t(4t-x)=4tx+8t+1$.

$z_{1,2}=\frac{-(4t+1) \pm \sqrt{4tx+8t+1}}{2t}$ for $t \neq 0$ and $4tx+8t+1 \geq 0$.

Thus $u^2(x,t)=\left( 2+\frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$.

We want $(2+x)^2=u^2(x,0)=\lim_{t \to 0} \left( 2+\frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$.

When having the + sign, the limit is $+\infty$, so $u$ could not be a solution.

Also, we have that $\lim_{t \to 0} \left( 2+\frac{[-(4t+1) - \sqrt{4tx+8t+1}]}{2t}\right)=-2-x$.

So, $u^2(x,t)=\left( 2+\frac{[-(4t+1)- \sqrt{4tx+8t+1}]}{2t}\right)^2$.

So $u(x,t)= \pm \left| 2- \frac{(4t+1)+ \sqrt{4tx+8t+1}}{2t}\right|$.

Is everything right or have I done something wrong? #### Klaas van Aarsen

##### MHB Seeker
Staff member
Thus $u^2(x,t)=\left( 2+\frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$.
Hey evinda!! Can't we just use the boundary condition here?
That is, not square it? We want $(2+x)^2=u^2(x,0)=\lim_{t \to 0} \left( 2+\frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$.

When having the + sign, the limit is $+\infty$, so $u$ could not be a solution.
If I fill in t=0, doesn't the numerator become 0, so that the result won't be infinity? #### evinda

##### Well-known member
MHB Site Helper
Hey evinda!! Can't we just use the boundary condition here?
That is, not square it? You mean that we get that $u^2(x,t)=\left( 2+ \frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$ and from there that

$u(x,t)= \pm \left| 2+ \frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right|$ and that we apply now the initial condition?

#### evinda

##### Well-known member
MHB Site Helper
If so, is it right as follows?

$u(x,t)=\left\{\begin{matrix} \pm \left| 2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}\right| & \\ \pm \left| 2-\frac{(4t+1)+\sqrt{4tx+8t+1}}{2t}\right| & , \text{ we reject it since it gets infinite when } t \to 0. \end{matrix}\right.$

Then we get that $\lim_{t \to 0} \frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}=-x$.

Since $u(x,0)=2+x$, we get that $u(x,t)=\left| 2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}\right|$.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
You mean that we get that $u^2(x,t)=\left( 2+ \frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right)^2$ and from there that

$u(x,t)= \pm \left| 2+ \frac{[-(4t+1) \pm \sqrt{4tx+8t+1}]}{2t}\right|$ and that we apply now the initial condition?
Ah well, I think it doesn't really matter.
I can mostly suggest to leave out all the absolute value symbols.
After all, instead of writing $u^2=y^2 \Rightarrow u=\pm| y|$, isn't it easier to write $u=\pm y$? If so, is it right as follows?

$u(x,t)=\left\{\begin{matrix} \pm \left| 2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}\right| & \\ \pm \left| 2-\frac{(4t+1)+\sqrt{4tx+8t+1}}{2t}\right| & , \text{ we reject it since it gets infinite when } t \to 0. \end{matrix}\right.$

Then we get that $\lim_{t \to 0} \frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}=-x$.

Since $u(x,0)=2+x$, we get that $u(x,t)=\left| 2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t}\right|$.
Shouldn't it be:
$$u(x,t)=2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t} = \frac{\sqrt{1+4t(2+x)}-1}{2t}$$
Otherwise I think the boundary condition does not necessarily hold. #### evinda

##### Well-known member
MHB Site Helper
Ah well, I think it doesn't really matter.
I can mostly suggest to leave out all the absolute value symbols.
After all, instead of writing $u^2=y^2 \Rightarrow u=\pm| y|$, isn't it easier to write $u=\pm y$? Yes, right... Shouldn't it be:
$$u(x,t)=2-\frac{(4t+1)-\sqrt{4tx+8t+1}}{2t} = \frac{\sqrt{1+4t(2+x)}-1}{2t}$$
Otherwise I think the boundary condition does not necessarily hold. I see... And then we just verify that $\lim_{t \to 0} \frac{\sqrt{1+4t(2+x)}-1}{2t}=x+2$ so that we are sure that the initial condition is satisfied, right? #### Klaas van Aarsen

##### MHB Seeker
Staff member
Yes, right... I see... And then we just verify that $\lim_{t \to 0} \frac{\sqrt{1+4t(2+x)}-1}{2t}=x+2$ so that we are sure that the initial condition is satisfied, right? Indeed. #### evinda

##### Well-known member
MHB Site Helper
Indeed. Nice, thanks!!! 