Using a Maclaurin Series to Solve a Linear Differential Equation

  1. Use a Maclaurin series to find the solution of
    \[ \begin{equation} y^{\prime \prime} =x^{2}y+e^{x}y^{\prime} \tag{3} \end{equation} \]
    given the initial conditions \(y(0)=1\) and \(y^{\prime} (0)=1\).
  2. Use the first five terms of the series to approximate values of \(y=y( x)\) for \(0\leq x\leq 1\).
  3. Use a numeric differential equation solver with \(10,000\) equally spaced numbers in the interval \([ 0,1]\) to solve the differential equation in (a). Then construct a table showing the values of \(y\) for \(x=0,0.1,0.2,\ldots,0.9,1.\)

Solution (a) We assume that the solution of the differential equation is given by the Maclaurin series \[ y(x)=\sum_{k=0}^{\infty }\frac{y^{(k)}(0)}{k!}x^{n}=y(0)+y^{\prime} ( 0) x+\frac{y^{\prime \prime} (0)}{2!}x^{2}+\frac{y^{\prime \prime \prime} (0)}{3!}x^{3}+\cdots \]

1093

We substitute the initial conditions, \(y(0)=1\) and \(y^{\prime} (0)=1\), into (3). Then \[ \begin{equation*} y^{\prime \prime} ( 0) =0^{2}\cdot 1+e^{0}\cdot 1=1\qquad {\color{#0066A7}{\hbox{\(x=0; y(0) =1; y^{\prime} (0) =1; y^{\prime \prime}(x)= x^{2}y + e^{x}y^{\prime}\)}}} \end{equation*} \]

Now we differentiate \(y^{\prime \prime} =x^{2}y+e^{x}y^{\prime}\) with respect to \(x\) to find \(y^{\prime \prime \prime} ( 0) .\) \[ \begin{eqnarray*} y^{\prime \prime \prime} ( x) &=&( x^{2}y^{\prime} +2xy) +( e^{x}y^{\prime \prime} +e^{x}y^{\prime}) \\[3pt] y^{\prime \prime \prime} ( 0) &=& ( 0^{2}\cdot 1+2\cdot 0\cdot 1) +( e^{0}\cdot 1+e^{0}\cdot 1) =2 \end{eqnarray*} \]

We continue differentiating and evaluating the derivative at \(x=0.\) \[ \begin{eqnarray*} y^{(4)}( x) & =&x^{2}y^{\prime \prime} +4xy^{\prime} +2y+e^{x}y^{\prime \prime \prime} +2e^{x}y^{\prime \prime} +e^{x}y^{\prime} \\[3pt] y^{(4)}(0)& =&0^{2}\cdot 1+4\cdot 0\cdot 1+2\cdot 1+e^{0}\cdot 2+2\cdot e^{0}\cdot 1+e^{0}\cdot 1=7 \end{eqnarray*} \]

and so on. The Maclaurin series then becomes \[ \begin{equation*} y(x)=1+x+\frac{1}{2!}x^{2}+\frac{2}{3!}x^{3}+\frac{7}{4!}x^{4}+\cdots \end{equation*} \]

(b) We construct Table 1 that uses the first five terms of the series to approximate select values of \(y\) in the interval \(0\leq x\leq 1\).

TABLE 1 Maclaurin Series Approximation of \(y\) Using Five Terms of the Series
\(x\) \(0.0\) \(0.1\) \(0.2\) \(0.3\) \(0.4\) \(0.5\) \(0.6\) \(0.7\) \(0.8\) \(0.9\) \(1.0\)
\(y\) \(1.0\) \(1.1054\) \(1.2231\) \(1.3564\) \(1.5088\) \(1.6849\) \(1.8898\) \(2.1294\) \(2.4101\) \(2.7394\) \(3.125\)

(c) Using every thousandth term from the numeric solution, we construct Table 2.

TABLE 2 Select Values of \(y\) Using a Numeric Equation Solver
\(x\) \(0.0\) \(0.1\) \(0.2\) \(0.3\) \(0.4\) \(0.5\) \(0.6\) \(0.7\) \(0.8\) \(0.9\) \(1.0\)
\(y\) \(1.0\) \(1.1054\) \(1.2232\) \(\ 1.3569\) \(1.5114\) \(1.6933\) \(1.9127\) \(2.1836\) \(2.5271\) \(2.9747\) \(3.5752\)

From the results of Tables 1 and 2, we can see how the five-term approximation to the series solution of the differential equation deteriorates as we move away from the center of convergence \(0\).