# Solving the ODE $u_t+u^2 u_x=0$ with Initial Condition $u(x,0)=2+x$

• MHB
• evinda
In summary, the conversation discusses solving the equation $u_t+u^2u_x=0$ with a given initial condition and the use of characteristic curves. The steps are explained and the final solution is determined to be $u(x,t)=\frac{\sqrt{1+4t(2+x)}-1}{2t}$, satisfying the initial condition. The use of absolute value symbols is also discussed but ultimately not necessary.
evinda
Gold Member
MHB
Hello! (Wave)

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? (Thinking)

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

Can't we just use the boundary condition here?
That is, not square it? (Wondering)

evinda said:
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? (Wondering)

I like Serena said:
Hey evinda! (Smile)

Can't we just use the boundary condition here?
That is, not square it? (Wondering)

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?

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|$.

evinda said:
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$? (Wondering)

evinda said:
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. (Thinking)

I like Serena said:
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$? (Wondering)

Yes, right... (Nod)

I like Serena said:
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. (Thinking)

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? (Thinking)

evinda said:
Yes, right... (Nod)

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? (Thinking)

Indeed. (Nod)

I like Serena said:
Indeed. (Nod)

Nice, thanks! (Smile)

## 1. What is an ODE?

An ODE (ordinary differential equation) is a mathematical equation that describes the relationship between a function and its derivatives. It is used to model various physical phenomena and is an important tool in the field of mathematics and science.

## 2. How do you solve an ODE?

There are various methods for solving ODEs, including separation of variables, integrating factors, and using power series. In this particular case, the ODE can be solved using the method of characteristics.

## 3. What is the initial condition in this ODE?

The initial condition in this ODE is u(x,0)=2+x, which means that at time t=0, the function u has a value of 2+x at any given point x. This initial condition is used to find the particular solution to the ODE.

## 4. What is the method of characteristics?

The method of characteristics is a technique for solving first-order partial differential equations, such as the one in this ODE. It involves finding a set of characteristic curves that satisfy the equation and using them to determine the solution.

## 5. What is the solution to this ODE with the given initial condition?

The solution to this ODE with the given initial condition is u(x,t)=2/(1-t)^2 + x, which can be obtained by using the method of characteristics and substituting the initial condition into the solution formula.

• Differential Equations
Replies
2
Views
1K
• Differential Equations
Replies
3
Views
1K
• Differential Equations
Replies
7
Views
3K
• Differential Equations
Replies
5
Views
2K
• Differential Equations
Replies
1
Views
1K
• Calculus and Beyond Homework Help
Replies
2
Views
546
• Differential Equations
Replies
2
Views
1K
• Differential Equations
Replies
2
Views
1K
• Differential Equations
Replies
3
Views
1K
• Differential Equations
Replies
9
Views
2K