Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to the main page for the course APMA0330
Return to the main page for the course APMA0340
Return to Part V of the course APMA0330
Our main method to solve nonlinear and variable coefficient linear differential equations is expansion of solutions into power series. Before the middle of 20th century, it was the standard method for attacking problems of this kind and many of the famous equations such as Legendre and Chebyshev equations have series solutions named after them. With the availability of computers, the power series came to prominence once again. In this tutorial, we present four algorithms for solving nonlinear differential equations with power series:
The Taylor series algorithm (or differential transform algorithm) is based on representing the solution in the form \( y(x) = \sum_{n\ge 0} \frac{y^{(n)} \left( x_0 \right)}{n!} \left( x- x_0 \right)^n \) and determination of its coefficients by differentiating the given differential equation.
Developing a recursive procedure for the coefficients { cn }n≥0 of the power series representation for the solution \( y(x) = \sum_{n\ge 0} c_n \left( x- x_0 \right)^n \) (which will be used later in singular linear differential equations). This approach has limited applications in nonlinear equations and it is mostly used for linear differential equations.
The Picard method is applicable only when the slope functions is a polynomial.
The Adomian decomposition method (abbreviated as ADM), when it is applied to determine a power series solution, is usually referred to as the modified decomposition method (abbreviated as MDM).
When solving initial value problems (IVPs) for ordinary differential equations (ODEs) using power series method, we always assume that the solution y(x) exists and smooth enough to be approximated by Taylor's polynomial of N-th degree
\begin{equation} \label{EqTaylor.1}
T_N (x) = c_0 + c_1 \left( x - x_0 \right) + c_2 \left( x - x_0 \right)^2 + \cdots + c_N \left( x - x_0 \right)^N = \sum_{k=0}^N c_k \left( x - x_0 \right)^k ,
\end{equation}
If solution y(x) is a holomorphic function, then the error of approximation by Taylor's polynomial approaches zero when N → ∞. For first order differential equations (written in normal form):
\begin{equation} \label{EqTaylor.3}
\frac{{\text d}y}{{\text d} x} = f \left( x , y \right) , \qquad y \left( x_0 \right) = y_0 ,
\end{equation}
the coefficients in Eq.\eqref{EqTaylor.2} are determined by differentiation of the slope function:
This leads to application of the famous Faà di Bruno's Formula that gives an explicit expression for the n-th derivative of the composition of two functions. However, the number of terms in this formula grows exponentially, according to the asymptotic partition formula by J. V. Uspensky (1920). So there is no chance to obtain explicit expressions for all Taylor's coefficients, in general. If a slope function is a polynomials, then all Taylor's coefficients will eventually contain only finite number of terms.
Differentiating Eq.\eqref{EqTaylor.3} with respect to x, we get
where fx, fx, … represent the partial derivatives of f with respect to x
and y and so on. The values of
\( \displaystyle y'_0 = y' \left( x_0 \right) , \ y''_0 = y'' \left( x_0 \right) , \ldots \) can be obtained by putting x = x0 and y = y0. If y(x) is the exact solution, then the Taylor’s series for y(x) around x = x0 is given by
\begin{equation} \label{EqTaylor.5}
y(x) = y_0 + y'_0 \left( x - x_0 \right) + \frac{y''_0}{2!} \left( x - x_0 \right)^2 + \frac{y'''_0}{3!} \left( x - x_0 \right)^3 + \cdots ,
\end{equation}
which gives the value of y for every value of x
for which Eq.\eqref{EqTaylor.5} converges.
First order separable equations
Although the initial value problem for a separable differential equation can be solved by separation of variables, we demonstrate the Taylor's series approach on this particular class of equations. Let us consider the initial value problem (IVP for short) for a separable equation
\[
y' \left( x \right) = f \left( x \right) \,g \left( y \right) , \qquad y \left( x_0 \right) = y_0 .
\]
The first derivative at the initial point follows immediately from the given differential equation
Now set up our Taylor's series as a symbolic expansion using derivatives of `y` evaluated at the origin. I use an order of 15 but that is something one would probably make as an argument to a function, if automating all this.
xx = Series[y[t], {t, 0, 15}];
Next apply the differential operator and add the initial conditions. Then find a solution that makes all powers of `t vanish.
To assess how accurate it might be we compare Taylor's polynomail of degree 15 with "true" solution calculated by Mathematica standard command NDSolve:
Since Mathematica knows how to find a Taylor's series approximation, you also have to understand the technique. Expressing the second (highest) derivative from the equation, we obtain
\[
y'' = 2t\, y' - 3\, y(t) + \sin t.
\]
Taking the limit as t → 0, we get the value of the first coefficient in its Maclaurin series:
and so on. So if you know calculus and patient enough, you can determine as many coefficients as you wish. This is because the given differential equation has polynomail coefficients of degree at most 1. For example,
Shih-Hsiang Chang and I-Ling Chang, A new algorithm for calculating one-dimensional
differential transform of nonlinear functions, Applied Mathematics and Computation 2008, Vol. 195, Issue 2, pp. 799–808; doi: 10.1016/j.amc.2007.05.026
Fairen, V., Lopez, V., Conde, L., Power series approximation to solutions of nonlinear systems of differential equations, American Journal of Physics, 1988, Vol. 56, Issue , pp. 57--61; https://doi.org/10.1119/1.15432
Uspensky, J.V., Asymptotic formulae for numerical functions which occur in the theory of partitions (in Russian), Izv. Akad. Nauk SSSR, 1920, 14 pp. 199—218.
Return to Mathematica page
Return to the main page (APMA0330)
Return to the Part 1 (Plotting)
Return to the Part 2 (First Order ODEs)
Return to the Part 3 (Numerical Methods)
Return to the Part 4 (Second and Higher Order ODEs)
Return to the Part 5 (Series and Recurrences)
Return to the Part 6 (Laplace Transform)
Return to the Part 7 (Boundary Value Problems)