Higher order differential equations

Nonlinear DE of higher order

Examples:

$$ \begin{align} xy''+2y' +x = 1 \label{ref:nonl1} \\ y'' + (y')^3y = 0 \label{ref:nonl2} \end{align} $$

When we are describing real world problems, the linear DE might be not sufficient to involve required dependencies, so there is a need for nonlinear DE.

The nonlinear DE of higher order are difficult to solve and often can not be solved analytically.

Regarding linear DE, it was told that if we know solution $y_1$ and $y_2$ the linear combination is also a solution. Such statement may not hold with nonlinear DE. For example differential equation $(y'')^2 = y^2$ has a solution $y_1 =e^x$ and $y_2 = \cos x$. You can test that linear combination is not a solution.

Nonlinear DE can not be solved by reduction of order method (from solution $y_1$); consider that we are even not able to bring non-linear DE into standard form of linear DE in order to locate $P(x)$. But nonlinear DE can be solved numerically and one of the method will be shown below.

Substitution to reduct the order

In some cases the solution of nonlinear higher order DE can be made by reduction of order by means of substitution: in both above examples $(\ref{ref:nonl1})$ and $(\ref{ref:nonl2})$, substitution $u=y'$ brings DE into the first order DE which is solved easily.

Let us distinguish between two cases:

  1. The independent variable $\boldsymbol y$ is missing: $F(x,\ y',\ y'') = 0$; example $(\ref{ref:nonl1})$ above.
  2. The dependent variable $\boldsymbol x$ is missing: $F(y,\ y',\ y'') = 0$; example $(\ref{ref:nonl2})$ above.

The first case is simple. We lay a substitution

$$ u = y', \hskip1em u' = \frac{du}{dx} $$

and the second order DE is converted into the first order DE. Solve the first order linear DE (instead of $y$ we deal with $u$).

If we try to use the same approach for the second case, we will fail with solving. Because $u = y'$, considering suggested $u' = du/dx$ and at the same time in the DE is only $y$, $u$ and $u'$ left, it would be more complicated than before. We have to employ chain rule to get rid of $dx$:

$$ u' = \frac{du}{dy} \frac{dy}{dx} = \frac{du}{dy}y' = \frac{du}{dy}u. $$

Then $dx$ is eliminated from DE and DE is solved as first order DE of $u$ in terms of $y$.

Example

Solve $xy''+2y' + x = 1$ as a nonlinear DE with initial values of $y(1) = 2$ and $y'(1) = 1$.

Although it is linear DE with non-constant coefficients and can be solved also as a Cauchy-Euler DE, we will demonstrate substitution as it was nonlinear DE. Dependent variable is missing. We can use substitution $u=y'$ to reduce the order.

$$ xu' + 2u + x = 1, \hskip2em u = y' $$

Let us solve for $u$:

$$ \begin{align} u' + \frac 2 x u + 1 &= \frac 1 x \nonumber \\ u' + \frac 2 xu &= \frac 1 x - 1 \nonumber \hskip1em \text{or} \\ \frac{du}{dx} + \frac 2 xu &= \frac 1 x - 1 \nonumber \\ \end{align} $$

It is a linear DE of first order (we might rather rewrite it with $y$ instead of $u$ to avoid confusion prior solving), which has a solution

Solution of the above first order DE:

$$ \frac{dy}{dx} + \frac{2}{x}y = \frac{1}{x} - 1 \\ $$

It is first order DE which is linear. Now it is in standard form, so we can take $P(x) = 2/x$ and built integrating factor $\mu(x) = e^{P(x)\ dx}$ and multiply both sides by integrating factor.

$$ \begin{align} & \mu(x) = e^{P(x)\ dx} = e^{2\intop \frac 1 x dx} = e^{2\log x} = e^{\log {x^2}} = x^2 \nonumber \\ & x^2 \frac{dy}{dx} + x^2 \frac 2 x y = x^2(\frac 1 x - 1) \nonumber \end{align} $$

We know that members on the left side are product of $\frac d {dx}\mu(x)\cdot y$ and that can be also tested (product rule). Then integrate both sides:

$$ \begin{align} (x^2)(y) &= \intop(x-x^2)\ dx \nonumber \\ x^2y &= \frac{x^2}{2} - \frac{x^3}{3} + c_1 \nonumber \\ y &= \frac{1}{2} - \frac{x}{3} + c_1 \frac{1}{x^2} \nonumber \end{align} $$
$$ u(x) = c_1\frac{1}{x^2} - \frac x 3 + \frac 1 2 $$

We were given initial value $y'(1) = 1 \implies u(1) = 1$

$$ 1 = c_1 \frac 1 1 - \frac 1 3 + \frac 1 2 \implies c_1 = \frac 5 6 $$

So we have

$$ u(x) = \frac 5 6 \frac{1}{x^2} -\frac x 3 + \frac 1 2. $$

Let us integrate $u(x)$ to get $y(x)$: $$ \begin{align} y(x) = \intop u(x)\ dx =& \intop (\frac 5 6 \frac{1}{x^2} - \frac x 3 + \frac 1 2 ) dx \nonumber \\ =& -\frac 5 6 x^{-1} - \frac 1 6 x^2 + \frac 1 2 x + c_2 \nonumber \end{align} $$

Let us use initial value $y(1) = 2$ to get $c_2$:

$$ 2 = -\frac 5 6 1^{-1} - \frac 1 6 1^2 + \frac 1 2 1 + c_2 \implies c_2 = \frac 5 2 $$

The solution is

$$ \underline{\underline{y(x) = -\frac 5 6 \frac 1 x - \frac 1 6 x^2 + \frac 1 2 x + \frac 5 2}}. $$

Example

Solve nonlinear DE $xy'' = y' + x(y')^2 $.

Let us use substitution $u = y'$. Then

$$ \begin{align} xu' &= u + xu^2 \nonumber\\ u' - \frac 1 x u &= u^2 \nonumber \\ \frac{du}{dx} - \frac 1 x u &= u^2 \nonumber\\ \end{align} $$

It resembles first order linear DE except the member on the right side. It is Bernoulli DE with solution

$$ u = \frac{2x}{2c_1 - x^2}. $$

Let us rewrite $u$ to $y$ as we are used to (to avoid confusion) and solve the above Bernoulli DE.

$$ y' -\frac 1 xy = y^2 \\ $$

We need to eliminate $y^2$ on the right side to transform the task to linear DE. That will be achieved by multiplying both sides by $y^{-2}$. We have learnt that we use substitution $u = y^{-1}$, then multiply DE by $u' = -y^{-2}$:

$$ \begin{align} -y^{-2}y' +y^{-2}\frac 1 xy &= -y^{-2}y^2 \nonumber\\ \frac{du}{dx} +\frac{1}{x}\frac 1 y &= -1 \nonumber\\ \frac{du}{dx} +\frac{1}{x}u &= -1 \nonumber\\ \end{align} $$

We really got to linear DE, which has solution

$$ u = -\frac x 2 + \frac{c_1} {x}. $$

The above linear DE is not difficult to solve. We can locate $P(x) = 1/x$, then integrating factor is $\mu(x) = e^{\intop P(x)\ dx} = e^{\intop 1/x\,dx} = x$. We multiply both sides of DE by integrating factor $\mu(x)$ and locate $\frac d {dx} \mu(x)\cdot u$ and finally integrate both sides.

$$ x\frac{du}{dx} + u = x(-1) \nonumber \\ \frac{d}{dx}(x\cdot u) = -x \nonumber\\ xu = -\frac{x^2}{2} + c_1 \nonumber \\ u = -\frac x 2 + \frac{c_1}{x}. $$

Let us go back against substitution $u=y^{-1} = 1/y$ we have used in the beginning:

$$ \begin{align} \frac 1 y &= -\frac x 2 + \frac{c_1} {x} \nonumber \\ y &= \frac{2x}{2c_1 - x^2} \nonumber \end{align} $$

After integrating we have general solution

$$ \underline{\underline{y = -\log |{2c_1 - x^2}| + c_2}}. $$

Example

Solve nonlinear DE $y''+(y')^3y = 0$.

Again, let us use substitution $u = y'$.

$$ \begin{equation} u' + u^3 y = 0 \label{ref:nonl3} \end{equation} $$

Variable $x$ is independent and variable $y$ is dependent. If we use $u' = du/dx$ again as in previous example, it will be not helpful: because it brings us to $du/dx + u^3y = 0$. Let us use chain rule:

$$ \begin{align} u &= y' = \frac{dy}{dx} \nonumber \\ u' &= \frac{du}{dy} \frac{dy}{dx} = \frac{du}{dy}y' = \frac{du}{dy}u \nonumber \end{align} $$

Finally we have avoided $dx$ and we can work on DE only in terms of $u$ and $y$.

$$ \begin{align} u \frac{du}{dy}+ u^3y &= 0 \label{ref:uy} \\ \frac{u}{u^3} du + y\ dy &= 0 \hskip2em \text{$u \neq 0$} \nonumber \\ u^{-2}du + y\ dy &= 0 \hskip2em \text{(integrate both sides)} \nonumber \\ -u^{-1} &= -\frac{y^2}{2} + c_1 \nonumber \end{align} $$

From the steps above we got two solutions. We have laid $u \neq 0$, so we have to investigate also whether $u = 0$ is a solution. If we substitute $u=0$ into $(\ref{ref:nonl3})$ then it is confirmed that $u= 0 $ is a solution as well. Thus we have two solutions:

$$ {\underline{u(y) = \frac{2}{y^2 + 2c_1}}} \hskip2em \text{and} \hskip2em {\underline{u(y) = 0}} $$

Going back through substitution $u = dy/dx$ and integrate both sides:

$$ \begin{align} \frac{dy}{dx} = \frac{2}{y^2 + 2c_1} &\implies \underline{\underline{\frac{y^3}{3} + 2c_1y = 2x +c_2}} \nonumber \\ \frac{dy}{dx} = 0 &\implies \underline{\underline{y = c}} \nonumber \\ \end{align} $$

Example

Solve nonlinear DE $y^2y''-(y')^3 = 0$.

We have to use substitution $u=y'$. Then

$$ \begin{equation} y^2u' - u^3 = 0. \label{ref:nonl4} \end{equation} $$

Before we start to solve $(\ref{ref:nonl4})$ we have to consider what is $u'$ here. Variable $u$ depends on $x$, it is $du/dx$. But that is not helpful since $(\ref{ref:nonl4})$ becomes $y^2\ du/dx - u^3 = 0$ then. We have to use chain rule to eliminate $dx$.

$$ u' = \frac{du}{dy} \frac{dy}{dx} = \frac{du}{dy}u $$

That helps us to eliminate $dx$ and we can solve DE where $u$ depends on $y$:

$$ \begin{align} y^2 \frac{du}{dy} u - u^3 &=0 \nonumber \\ y^2 \frac{du}{dy} - u^2 &=0 \nonumber \\ y^2 {du} - u^2 dy &=0 \nonumber \\ \frac 1 {u^2}du - \frac{1}{y^2}dy &= 0 \nonumber \\ -u^{-1} + y^{-1} &= c_1 \nonumber \end{align} $$

The DE $(\ref{ref:nonl4})$ is solved, now we have to walk back against substitution $u = y' = dy/dx$ from the beginning.

$$ \begin{align} -\frac{dx}{dy} + y^{-1} &= dy \nonumber \\ -dx &= dy(c_1 - y^{-1}) \nonumber \\ -x &= c_1y - \log|y| + c_2 \nonumber \end{align} $$

That can be a little improved to

$$ \underline{\underline{\log |y| - c_1y = x+c_2}}. $$

Example

Solve $y'' + {2y'}/{x} + x^2 = 3$.

It can be observed that when this DE is multiplied by $x^2$, it becomes Cauchy-Euler DE, which has solutions based on $x^m$. Here it will be solved by substitution $u=y'$ and the solutions regardless the method have to be the same.

If you have a skill, you might be also able to find first solution $y_1 = c_1$ from associated homogeneous DE and then use reduction of order method to find solution $y_2 = c_2x^{-1}$.

$$ \begin{align} u' + \frac 2 x u + x^2 &= 3 \nonumber \\ \frac {du}{dx} + \color{red}{\frac{2}{x}} u &= 3 - x^2 \nonumber \end{align} $$

We got to linear DE of first order which has to be solved by integrating factor $\mu(x)$ with $P(x) = 2/x$. Note: if multiplied by $x$ it can be also recognized and solved again as a Cauchy-Euler DE.

$$ \mu(x) = e^{\int P(x)\ dx} = e^{\int \frac 2 x\ dx} = x^2 \nonumber \\ $$

If we multiply DE by integrating factor $\mu(x)$ we anticipate that on the left side is $d/dx\ \mu(x)u$ to be found:

$$ \begin{align} \frac{d}{dx} \mu(x)u &= 3x^2 - x^4 \nonumber \\ \mu(x)u &= \int {(3x^2 - x^4)\ dx} \nonumber \\ x^2u &= x^3 - \frac{1}{5}x^5 + c_1 \nonumber \\ u &= x - \frac{1}{5}x^3 + c_1\frac{1}{x^2} \nonumber \\ \end{align} $$
$$ y' = x - \frac{1}{5}x^3 + c_1\frac{1}{x^2} \nonumber \\ $$

So the final solution, which could be also obtained by other method, is

$$ \underline{\underline{y = \frac{x^2}{2} - \frac{1}{20}x^4 - c_1 x^{-1} + c_2}}. $$

Taylor series solution for initial value problems

If initial values are given, nonlinear DE might be solvable by means of Taylor polynomial. The advantage of Taylor series is that the numerical solution converge fast.

First let us remind the Taylor polynomial:

$$ y(x) = y(a) + y'(a)(x-a) + \frac{y''(a)}{2!}(x-a)^2 + \frac{y'''(a)}{3!}(x-a)^3 + \dots + \frac{y^{(k)}(a)}{k!}(x-a)^k $$

If we are able to differentiate given function $y(x)$, then we are able to approximate such function by means of Taylor series. The series is made for the $x=a$, then the approximation works best around that given point.

The first members are given by initial values. The next members have to be expressed from DE.

Example

Solve $y'' = e^x$ with initial values $y(0) = 0, \ y'(0) = -1$.

We need to find solution $y(x)$. For that aim we may use Taylor polynomial and solve numerically around point $x=0$, that means $a=0$ when composing the series. The first and the second member of series is given by initial values. The third member is given by DE itself. To establish next members, we have to differentiate given DE to obtain $y''',\ y^{(4)}$ and so on.

Let us start with initial values:

$$ y(x) = 0 + (-1)(x-0) + \dots \\ $$

Now we may append the member $y''(x)$ which comes from DE as $e^x$:

$$ y(x) = 0 + (-1)(x-0) + \frac{e^0}{2!}(x-0)^2\dots \\ $$

The next members come from further differentiating of $y''$, that means from differentiating $e^x$:

$$ y(x) = 0 + (-1)(x-0) + \frac{e^0}{2!}(x-0)^2 + \frac{e^0}{3!}(x-0)^3 + \frac{e^0}{4!}(x-0)^4 + \dots\\ $$

or

$$ y(x) = 0 -x + \frac{x^2}{2!}+ \frac{x^3}{3!} + \frac{x^4}{4!} + \dots\\ $$

If we use above series with 5 members the approximations of the solution at $x=\{-0.2; 0.2; 0.4\}$ are

$$ \begin{eqnarray} y(-0.2) &=& \color{silver}{0 - 0.2 + 0.02 - 0.001333 + 6.67\cdot10^{-5} } &= &+0.21873 \nonumber\\ y(0.2) &=& \color{silver}{0 -0.2 + 0.02 + 0.001333 - 6.67\cdot10^{-5} } &= &-0.1786 \nonumber\\ y(0.4) &=& \color{silver}{0 - 0.4 + 0.08 + 0.016667 + 0.001667} &= &-0.30827 \nonumber \end{eqnarray} $$

Analytical solution is $y(x) = c_1 + c_2x + e^x$ or $y(x) = -1 -2x+e^x$ (when solved with initial values) which brings the solutions:

\begin{eqnarray} &y(-0.2) &= &+0.21873 \nonumber\\ &y(0.2) &= &-0.17860 \nonumber\\ &y(0.4) &= &-0.30818 \nonumber \end{eqnarray}

List of chapters