As was pointed before

- some DE are difficult to solve or can not be solved analytically;
- some of the solutions consist of functions which are not elementary functions.

**Example:** The purpose is to solve **linear** DE

by means of infinite series. In this case the solution is

$$ y(x) = 1+x+\frac{x^2}{2}+\frac{x^3}{2}+\frac{x^4}{8}+ \dots \hskip2em \text{for} -\infty \lt x \lt \infty. $$A series of the form

$$
\begin{equation}
c_0 + c_1(x-a) + c_2 (x-a)^2 +c_3(x-a)^3 + \dots = \sum_{n=0}^{\infty}c_n(x-a)^n \label{ref:ser1}
\end{equation}
$$

where $c_0,\ c_1,\dots ,\ a$ are constants and $x$ is variable, is called a power series. Such power series is centered at $a$.

We study whether the above **sum** approaches some given number. Then the series converges. A power series may

- Converge
*only*for a single value $x=a$. - Converge absolutely for values $x$ near value $a$, but not for other values. That means
- there is and interval $(a-h; a+h)$ within which $x$ converges
- and diverges for other values.
- At the end points $x\pm h $ may either converge or diverge.
- Converge absolutely for all values of $x$, i.e. for $-\infty \lt x \lt \infty $.

Convergence of power series can be determined by the ratio test. It states
that the series $u_1+u_2+u_3+\dots+u_n + \dots$ **converges** absolutely if

If $L\gt1$ then the series diverges. If $L=1$ the test is inconclusive.

Determine whether series $1 + 1!\ x + 2!\ x^2 + 3!\ x^3 + \dots +n!\ x^{n} + \dots$ converges.

Here

$$ \begin{align} u_n &= n!\cdot x^n \nonumber \\ u_{n+1} &= (n+1)!\cdot x^{n+1} \nonumber \end{align} $$Therefore

$$ \big |\frac{u_{n+1}}{u_{n}}\big | = \big |\frac{(n+1)!\ x^{n+1}}{n!\ x^n} \big | = (n+1)|x| $$The ratio between both members $u_{n+1}$ and $u_n$ grows with $n\to \infty$: $L = (n+1)|x| \to \infty$ as $n \to \infty$. Since it is not valid that $L\lt 1$, the series converges only for $x=0$.

Determine whether series $1 + x + \frac 1 2 x^2 + \frac 1 3 x^3 + \dots \frac 1 n x^n$ converges.

Here

$$ \begin{align} &u_n = \frac 1 n x^n, \nonumber \\ &u_{n+1} = \frac{1}{n+1} x^{n+1} \nonumber \\ &\lim_{n\to \infty}\big |\frac{x^{n+1}}{\color{red}{n+1}} \cdot \frac{\color{red}{n}}{x^n} \big | = |x| = L \nonumber \end{align} $$A series converges if $L\lt 1$. In our case the series converges for $-1 \lt x \lt 1$.

Note: the test is not conclusive at endpoints $\pm 1$: in this case for $x=1$ diverges, for $x=-1$ converges (check the series itself).

To solve DE by power series, it is crucial to be able to simplify two series into one.

Simplify $\sum_{n=1}^{\infty}2nc_n x^{n-1} + \sum_{n=0}^{\infty}6c_n x^{n+1}$

The important observation is that both series are not expressed from $x^n$. Instead of that they use $x^{n-1},\ x^{n+1}$. It is desired to have both in the form of $x^n$.

$$ \begin{align} \sum_{n=1}^{\infty}2nc_n x^{n-1} &= \sum_{n=0}^{\infty}2(n+1)c_{n+1} x^{n} \nonumber \\ \sum_{n=0}^{\infty}6c_n x^{n+1} &= \sum_{n=1}^{\infty}6c_{n-1} x^{n}\nonumber \end{align} $$Then sum of above series is

$$ \begin{align} \sum_{n=1}^{\infty}2nc_n x^{n-1} + \sum_{n=0}^{\infty}6c_n x^{n+1} &= \sum_{n=0}^{\infty}2(n+1)c_{n+1} \cdot x^{n} + \sum_{n=1}^{\infty}6c_{n-1} \cdot x^{n} = \nonumber \\ &= 2c_1 + \sum_{n=1}^{\infty}x^n(2(n+1)c_{n+1} + 6c_{n-1}) \nonumber \end{align} $$If power series converges on an interval $I$, then the power series $(\ref{ref:ser1})$ defines a function $f(x)$ which is continuous, differentiable and integrable on the interval:

$$
\begin{align}
y & = \sum_{n=0}^{\infty}c_n x^n = c_0 + c_1x + c_2 x^2 +c_3x^3 + \dots \nonumber \\
y' & = \sum_{n=1}^{\infty}c_n n x^{n-1} = c_1 + 2 c_2 x +3 c_3 x^2 + \dots \nonumber \\
y''& = \sum_{n=2}^{\infty}c_n n (n-1)x^{n-2} = 2c_2 +6 c_3 x + 12 c_4 x^2 + \cdots \nonumber
\end{align}
$$

Any function is said to be analytic at a point $a$ if it can be represented by a power series in $x-a$.

**Example:** function such as $e^x,\ \sin x,\ \log \ x$ can be
represented by Taylor series. These functions are analytic.

If a function is analytic at point, it can be replaced either by Taylor series $(\ref{ref:ser3})$ or Maclaurin series $(\ref{ref:ser4})$, which are both power series.

$$ \begin{align} \sum_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(x-a)^n &= f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \dots \label{ref:ser3}\\ \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n &= f(0) + \frac{f'(0)}{1!}x + \frac{f''(0)}{2!}x^2 + \dots \label{ref:ser4} \end{align} $$A point $x=x_0$ is called ordinary point of the DE

$$ y^{(n)} + F_{n-1}(x)y^{(n-1)} + \dots + F_1(x)y' + F_0(x)y = Q(x) $$if each function $F_0,\ F_1,\ \dots,\ F_{n-1}$ and $Q$ is analytic at $x=x_0$. A point $x=x_0$ is called singular if one or more of the functions $F_0(x),\ \dots,\ F_{n-1}(x),\ Q(x)$ are not analytic at $x=x_0$.

DE $(x-1)y'' + \frac 1 x y' - 2y = 0$ has two singularities: at $x=1$ and at $x=0$.

If we divide DE by $(x-1)$, we get

$$ y''+\frac{1}{x(x-1)}y' - \frac 2 {x-1}y = 0 \implies \left\{ \begin{align} F_1(x) &= \frac{1}{x(x-1)} \nonumber \\ F_0(x) &= -\frac{2}{x-1} \nonumber \end{align} \right. $$Both $F_0,\ F_1$ are singular, are not analytic and can not be described by power series.

If $x=x_0$ is an ordinary point of the DE, we can always find solutions in the form of power series centered at $x_0$. A power series solution converges at least on interval $|x-x_0| \lt R$, where $R$ is the distance from the closest singular point.

Note: in finding a series solution of a differential equation, it will usually not be easy to write the general form of the series. In fact, it will, in most cases, be very difficult if not impossible.

Solve DE $(x-1)y'' - x y' +y = 0$, $y(0) = -2$, $y'(0) = 6$.

First, let us solve by successive differentiation using Maclaurin polynomial.

$$ \begin{align} \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n &= f(0) + \frac{f'(0)}{1!}x + \frac{f''(0)}{2!}x^2 + \dots \nonumber \\ \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n &= -2 + 6x + \cdots \nonumber \end{align} $$The first two members were taken from initial values. The next members will be computed by successive differentiations:

$$ \begin{align} f''(0): \hskip1em &(x-1)y''-xy'+y =0 \implies \color{red}{y''}(x=0, y=-2, y'=6) = \color{red}{-2} \nonumber \\[2mm] f'''(0): \hskip1em &(x-1)y''' +y'' - xy''-y' +y' = 0 \nonumber \\ & (x-1)y'''+y''-xy'' = 0 \implies \color{red}{y'''}(x=0, y'=6, y''=-2) = \color{red}{-2} \nonumber \\[2mm] f^{(4)}(0): \hskip1em &(x-1)y^{(4)}+y'''+y'''-xy'''-y'' = 0 \nonumber \\ &(x-1)y^{(4)}+2y''' - xy'''-y''=0 \implies \color{red}{y^{(4)}}(x=0,y''=-2, y'''=-2) = \color{red}{-2} \nonumber \\[2mm] f^{(5)}(0): \hskip1em &(x-1)y^{(5)} + y^{(4)} + 2y^{(4)} - xy^{(4)} - y''' - y''' = 0 \nonumber \\ &(x-1)y^{(5)} + 3y^{(4)} - xy^{(4)} - 2y''' = 0 \implies \color{red}{y^{(5)}}(x=0, y'''=-2, y^{(4)}=-2) = \color{red}{-2} \nonumber \end{align} $$From values above we may form the series for solution:

$$ y = f(x) = -2 + 6x - 2\frac{x^2}{2!} -2\frac{x^3}{3!} -2\frac{x^4}{4!} -2\frac{x^5}{5!} + \dots $$It can be noticed that the solution does not involve any arbitrary constant, because it is particular solution for given initial values.

Solve DE $(x-1)y'' - x y' +y = 0$, $y(0) = -2$ and $y'(0) = 6$.

The same example as above but now solved by power series **(undetermined coefficients approach).**

Let us approximate solution by

$$ y = \sum_{n=0}^{\infty}c_n x^n = c_0 + c_1x + c_2 x^2 +c_3x^3 + \dots \nonumber \\ $$Then

\begin{align} y' & = \sum_{n=1}^{\infty}c_n n x^{n-1} = c_1 + 2c_2 x +3 c_3 x^2 + \dots \nonumber \\ y''& = \sum_{n=2}^{\infty}c_n n (n-1)x^{n-2} = 2c_2 +6 c_3 x + 12 c_4 x^2 + \cdots \nonumber \end{align}Let us substitute $y,\ y',\ y''$ into DE:

$$ \begin{align} \color{red}{(x-1)}\big[\sum_{n=2}^{\infty} c_{n}n(n-1) x^\color{red}{n-2}\big] - \color{red}{x}\big[\sum_{n=1}^{\infty}c_{n}nx^\color{red}{n-1}\big] + \big[\sum_{n=0}^{\infty}c_nx^n\big] &= 0 \nonumber \\ \big[\sum_{n=2}^{\infty} c_{n}n(n-1) x^\color{red}{n-1} \color{red}{-} \sum_{n=2}^{\infty} c_{n}n(n-1) x^\color{red}{n-2}\big] - \big[\sum_{n=1}^{\infty}c_{n}nx^\color{red}{n}\big] + \big[\sum_{n=0}^{\infty}c_nx^n\big] &= 0 \nonumber \\ \end{align} $$We need to shift the summation index in order to work with the series in a convenient way, i.e. all sums have to work with $x^n$:

$$ \begin{align} \big[\sum_{n=\color{red}{1}}^{\infty} c_{\color{red}{n+1}}\color{red}{(n+1)n} x^\color{red}{n} - \sum_{n=\color{red}{0}}^{\infty} c_{n\color{red}{+2}}\color{red}{(n+2)(n+1)} x^\color{red}{n}\big] - \big[\sum_{n=1}^{\infty}c_{n}nx^{n}\big] + \big[\sum_{n=0}^{\infty}c_nx^n\big] &= 0 \nonumber \\ \end{align} $$**Let us collect coefficients $\boldsymbol{c_0,\ c_1,\ c_2,\ c_3,\ \dots}$ for $\boldsymbol{1,\ x, \
x^2,\ x^3, \dots}$.** We are solving second order DE, which is linear. So we will
have two independent solutions, which are distinguished by arbitrary constants $c_0,\
c_1$. The other constants have to be evaluated in terms of $c_0,\ c_1$.

From coefficients found so far we can form power series of $y$:

$$ y = c_0 + c_1x + \frac 1 2 c_0 x^2 + \frac 1 6 c_0 x^3 + \frac{1}{24} c_0x^4 + \frac 1 {120} c_0 x^5 + \dots $$You can notice that we have two arbitrary constants ($c_0,\ c_1$) within the above general solution $y$. And that implies there are two solutions $y_1(x) = c_1f_1(x)$ and $y_2(x)=c_2f_2(x)$. And that could be expected since the DE to solve is not nonlinear. The first solution is an infinite series with $c_0$ and the second solution is a line $c_1x$. That complies with the analyticial solution of the given DE, which is $y = c_1x + c_2e^x$.

From initial values we will determinate constants to express particular solution. $y(0) = -2 \implies c_0 = -2$, $y'(0) = 6 \implies c_1 = 6$. Then

$$ \begin{align} &y = -2 + 6x - x^2 -\frac 1 3 x^3 - \frac 1 {12} x^4 - \frac{1}{60} x^5 + \dots \hskip1em \text{or} \nonumber \\ &\underline{\underline{y = -2 + 6x - 2 \frac{x^2}{2!} - 2 \frac{x^3}{3!} - 2 \frac{x^4}{4!} -2\frac{x^5}{5!} + \dots }} \nonumber \end{align} $$We have reached the same solution as within previous example.

Solve nonlinear DE $y''=xy-(y')^2$, $y(0) = 2$ and $y'(0) = 1$ by power series (undetermined coefficients approach).

We will by finding the general solution first and then the initial values will be used to evaluate $c_0, \ c_1$.

We can use the power series for $y,\ y',\ y''$ from the last example. $$ y = \sum_{n=0}^{\infty}c_n x^n, \hskip1em y' = \sum_{n=1}^{\infty}c_n n x^{n-1}, \hskip1em y'' = \sum_{n=2}^{\infty}c_n n (n-1)x^{n-2} $$

and substitute them into DE.

$$ \sum_{n=2}^{\infty}c_nn(n-1)x^{n-2} = x\sum_{n=0}^{\infty}c_nx^n - \big[\sum_{n=1}^{\infty}c_nnx^{n-1}\big]^2 \\ $$It would be quite difficult to work with the above series if they are not based on $x^n$. They can be rewritten to

$$ \sum_{n=0}^{\infty}c_{n+2}(n+2)(n+1)x^{n} = \sum_{n=1}^{\infty}c_{n-1}x^n - \color{blue}{\big[\sum_{n=0}^{\infty}c_{n+1}(n+1)x^{n}\big]^2} \\ $$Note that the last series is squared, which brings us some more work. To handle the power, it is useful to list its members:

$$ \color{blue}{\big[\sum_{n=0}^{\infty}c_{n+1}(n+1)x^{n}\big]^2} = (c_1 + 2c_2x + 3c_3x^2 + 4c_4x^3 + 5c_5x^4 + \dots)^2 $$Now we do not need to square the series itself. But we need to pick up coefficients for each $1,\ x,\ x^2,\ \dots$ For example we want to pick up coefficient of $x^2$. Now imagine there is the series multiplied by itself:

$$ \begin{align} {\big[\sum_{n=0}^{\infty}c_{n+1}(n+1)x^{n}\big]^2} = & (c_1 + 2c_2x + 3c_3x^2 + 4c_4x^3 + \dots)\cdot \nonumber \\ & \cdot (c_1 + 2c_2x + 3c_3x^2 + 4c_4x^3+ \dots) \nonumber \\ \end{align} $$Then for $x^2$: $(c_1\cdot 3c_3x^2) + (3c_3x^2\cdot c_1) + (2c_2x)^2.$

Now we can **use method of undetermined coefficients for $\boldsymbol{1,\ x,\ x^2,\ \dots}$.**

We have collected coefficients $c_2$ to $c_5$ to form a power series of solution. Since it is the second order DE, we should expect two arbitrary constants $c_0,\ c_1$. The others should be expressed in terms of $c_0,\ c_1$ and that is what can be confirmed by observing $c_2$ to $c_5$. If you observe $c_3$ you will notice that this time we can not separate solutions using $c_0$ and $c_1$ as in the previous example. The both solutions are somehow mixed. The reason is that the DE being solved is nonlinear.

Finally from given initial values $y(x=0) = 2$ and $y'(x=0) = 1$: $c_0=2, c_1=1$. Then the other constants can be evaluated as $c_2=-1/2$, $c_3=2/3$, $c_4=-1/3$, $c_5=37/120$.

$$ \underline{\underline{y(x) = 2 + x - \frac 1 2 x^2 + \frac 2 3 x^3 - \frac 1 3 x^4 + \frac {37}{120}x^5 + \dots}} $$