Home » Blog » Differential Equations

Tag: Differential Equations

Compute the coefficients of a given power series

Consider the power series

    \[ f(x) = \sum_{n=0}^{\infty} a_n x^n \]

with coefficients determined by the identity

    \[ e^{-2x} = \sum_{n=0}^{\infty} (2a_n + (n+1)a_{n+1})x^n. \]

Compute the coefficients a_1, a_2, a_3 and determine the sum of the series.


We know the power-series expansion for e^{-2x} is given by

    \[ e^{-2x} = 1 + (-2x) + \frac{(-2x)^2}{2!} + \frac{(-2x)^3}{3!} + \cdots. \]

Starting with a_0= 1 and the given identity we can compute the coefficients a_1, a_2, a_3 by equating the coefficients of like powers of x,

    \begin{align*}  2a_0 + a_1 &= 1 & \implies && a_1 &= -1 \\[9pt]  2a_1 + 2a_2 &= -2 & \implies && a_2 &= 0 \\[9pt]  2a_2 + 3a_3 &= 2 & \implies && a_3 &= \frac{2}{3}. \end{align*}

Then from the identity for the coefficients (and noting that the series converges absolutely for all real x so we may split the sum into separate sums without worry),

    \begin{align*}  e^{-2x} &= \sum_{n=0}^{\infty} (2a_n + (n+1)a_{n+1})x^n \\[9pt]  &= 2 \sum_{n=0}^{\infty} a_n x^n + \sum_{n=0}^{\infty} (n+1)a_{n+1} x^n \\[9pt]  &= 2 f(x) + f'(x). \end{align*}

This is a first order linear differential equation of the form y' + P(x) y = Q(x). Furthermore, the initial condition a_0 = 1 implies that y = 1 when x = 0. Therefore, the solution is

    \[  y = be^{-A(x)} + e^{-A(x)} \int_a^x Q(t) e^{A(t)} \, dt  \]

where

    \[ a = 0, \quad b= 1, \quad A(x) = \int_0^x P(t) \,dt = 2x. \]

So, we have

    \begin{align*}   f(x) &= e^{-2x} +  e^{-2x} \int_0^x e^{-2t} e^{2t} \, dt \\[9pt]  &= e^{-2x} + e^{-2x} \int_0^x \, dt \\[9pt]  &= (x+1)e^{-2x}. \end{align*}

Assume y′′ + xy′ + y = 0 has a power-series solution and determine the coefficient an

Assume that the differential equation

    \[ y'' + xy' + y = 0 \]

has a power-series solution y = \sum a_n x^n and find a formula for the coefficient a_n.


First, we have

    \begin{align*}   && y&= \sum_{n=0}^{\infty} a_n x^n \\[9pt]  \implies && y' &= \sum_{n=1}^{\infty} n a_n x^{n-1} \\[9pt]  \implies && y'' &= \sum_{n=2}^{\infty} n(n-1) a_n x^{n-2}. \end{align*}

So, from the given differential equation we have

    \begin{align*}  && y'' + xy' + y &= 0 \\[9pt]  \implies && \sum_{n=2}^{\infty} n(n-1)a_n x^{n-2} + x \sum_{n=1}^{\infty} n a_n x^{n-1} + \sum_{n=0}^{\infty} a_n x^n &= 0 \\[9pt]  \implies && \sum_{n=0}^{\infty} (n+2)(n+1)a_{n+2} x^n + \sum_{n=1}^{\infty} n a_n x^n + \sum_{n=0}^{\infty} a_n x^n &= 0 \\[9pt]  \implies && 2a_2 + \sum_{n=1}^{\infty} (n+2)(n+1)a_{n+2} x^n + \sum_{n=1}^{\infty} na_n x^n + a_0 + \sum_{n=1}^{\infty} a_n x^n &= 0 \\[9pt]  \implies && 2a_2 + a_0 + \sum_{n=1}^{\infty} ((n+2)(n+1) a_{n+2} + na_n + a_n)x^n &= 0 \\[9pt]  \implies && 2a_2 + a_0 + \sum_{n=1}^{\infty} ((n+2)(n+1)a_{n+2} + (n+1)a_n) x^n &= 0. \end{align*}

Since each coefficient of x^n must equal 0 for this equation to hold we have

    \begin{align*}  2a_2 + a_0 &= 0 \\[9pt]  (n+2)(n+1)a_{n+2} +(n+1)a_n &= 0 & \implies && a_{n+2} = \frac{-1}{n+2} a_n. \end{align*}

By induction we then have

    \begin{align*}  a_{2n} &= \frac{(-1)^n}{2 \cdot 4 \cdot \cdots \cdot (2n)} \\[9pt]  a_{2n+1} &= \frac{(-1)^{n+1}}{1 \cdot 3 \cdot \cdots \cdot (2n-1)}. \end{align*}

The coefficients a_0 and a_1 are arbitrary and we denote them by c_0 and c_1 respectively. Then we have

    \[ y = c_0 \left( \sum_{n=1}^{\infty} \frac{(-1)^n x^{2n}}{2 \cdot 4 \cdots (2n)} \right) + c_1 \sum_{n=1}^{\infty} \frac{(-1)^{n+1} x^{2n-1}}{1 \cdot 3 \cdots (2n-1)}. \]

Assume y′′ = xy has a power-series solution and determine the coefficient an

Assume that the differential equation

    \[ y'' = xy \]

has a power-series solution y = \sum a_n x^n and find a formula for the coefficient a_n.


First, we have

    \begin{align*}  && y &= \sum_{n=0}^{\infty} a_n x^n \\[9pt]  \implies && y' &= \sum_{n=1}^{\infty} n a_n x^{n-1} \\[9pt]  \implies && y'' &= \sum_{n=2}^{\infty}n (n-1) a_n x^{n-2} = \sum_{n=0}^{\infty} (n+2)(n+1) a_{n+2} x^n.  \end{align*}

Therefore, we have

    \begin{align*}  && y'' &= xy \\[9pt]  \implies && \sum_{n=0}^{\infty} (n+2)(n+1) a_{n+2} x^n &= x \sum_{n=0}^{\infty} a_n x^n  \\[9pt]  \implies && \sum_{n=0}^{\infty} (n+2)(n+1) a_{n+2} x^n &= \sum_{n=0}^{\infty} a_n x^{n+1} \\[9pt]  \implies && 2a_2 + \sum_{n=1}^{\infty} (n+2)(n+1)a_{n+2}x^n &= \sum_{n=0}^{\infty} a_n x^{n+1} \\[9pt]  \implies && 2a_2 + \sum_{n=0}^{\infty} (n+3)(n+2) a_{n+3} x^{n+1} &= \sum_{n=0}^{\infty} a_n x^{n+1}. \end{align*}

Equating like powers of x, we have a recursive relation for a_n when n > 2 given by

    \[ a_{n+3} = \frac{a_n}{(n+3)(n+2)}, \]

Furthermore, we have that a_2 = 0 and that a_0 and a_1 are arbitrary constants, say c_0 and c_1, respectively. Then by induction we establish

    \begin{align*}   a_{3n} &= \frac{a_0}{(2 \cdot 3)(5 \cdot 6) \cdots ((3n-1)\cdot(3n))} \\[9pt]  a_{3n+1} &= \frac{a_1}{(3 \cdot 4)(6 \cdot 7) \cdots ((3n)\cdot(3n+1))} \\[9pt]  a_{3n+2} &= 0. \end{align*}

Therefore,

    \[ y = c_0 \left( 1 + \sum_{n=1}^{\infty} \frac{x^{3n}}{(2 \cdot 3)(5 \cdot 6) \cdots ((3n-1)\cdot(3n))} \right) + c_1 \left( x + \sum_{n=1}^{\infty} \frac{x^{3n+1}}{(3 \cdot 4)(6 \cdot 7) \cdots ((3n)\cdot (3n+1))} \right). \]

Find the first four nonzero terms of the power series solution of y′ = x + y2

Consider the differential equation

    \[ y' = x + y^2 \]

with initial conditions y = 0 when x = 0. Assume this differential equation has a power-series solution and compute the first four nonzero terms of the expansion.


Let

    \[ f(x) = \sum_{n=0}^{\infty} a_n x^n.\]

be the power-series solution of the differential equation. Then we must have

    \begin{align*}  && \sum_{n=1}^{\infty} na_n x^{n-1} &= x + \left( \sum_{n=0}^{\infty} a_n x^n \right)^2 \\[9pt]  \implies && \sum_{n=1}^{\infty} na_n x^{n-1} &= x + \sum_{n=0}^{\infty} \left( \sum_{k=0}^n a_k a_{n-k} \right) x^n \right) \\[9pt]  \implies && a_1 + 2a_2 x + 3a_3 x^2 + \cdots &= a_0^2 + (2a_0 a_1 + 1)x + (a_1^2 + 2a_0a_2)x^2 + \cdots. \end{align*}

From the initial conditions we know a_0 = 0. Then, equating like powers of x we can solve for the first four nonzero terms in the power series expansion:

    \begin{align*}  a_0 &= 0 \\[9pt]  a_1 &= a_0^2 & \implies && a_1 &= 0 \\[9pt]  2a_2 &= 2a_0 a_1 + 1 & \implies && a_2 & = \frac{1}{2} \\[9pt]  3a_3 &= a_1^2 + 2a_0 a_2 & \implies && a_3 &= 0 \\[9pt]  4a_4 &= 2(a_0 a_3 + a_1 a_2) & \implies && a_4 &= 0 \\[9pt]  5a_5 &= a_2^2 + 2(a_0 a_4 + a_1 a_3) & \implies && a_5 &= \frac{1}{20} \\[9pt]  6a_6 &= 2(a_0 a_5 + a_1 a_4 + a_2 a_3) & \implies && a_6 &= 0 \\[9pt]  7a_7 &= a_3^2 + 2(a_0 a_6 + a_1 a_5 + a_2 a_4) & \implies && a_7 &= 0 \\[9pt]  8a_8 &= 2(a_0 a_7 + a_1 a_6 + a_2 a_5 + a_3 a_4) & \implies && a_8 &= \frac{1}{160} \\[9pt]  9a_9 &= a_4^2 + 2(a_0 a_8 + a_1 a_7 + a_2 a_6 + a_3 a_5) & \implies && a_9 &= 0 \\[9pt]  10a_{10} &= 2(a_0 a_9 + a_1 a_8 + a_2 a_7 + a_3 a_6 + a_4 a_5) & \implies && a_{10} &= 0 \\[9pt]  11a_{11} &= a_5^2 + 2(a_0 a_{10} + a_1 a_9 + a_2 a_8 + a_3 a_7 + a_4 a_6) & \implies && a_{11} &= \frac{1}{8800} \end{align*}

(Note: I think the solution in the back of Apostol is wrong on this. Apostol has a_5 = \frac{1}{12}, a_8 = \frac{1}{060}, and a_{11} = \frac{7}{8800}. I’m going to mark this as errata until someone convinces me Apostol is actually correct.)

Therefore, we have

    \[ y = \frac{1}{2} x^2 + \frac{1}{20} x^5 + \frac{1}{160} x^8 + \frac{1}{8800} x^{11} + \cdots. \]

Find the first four nonzero terms of the power series solution of y′ = 1 + xy2

Consider the differential equation

    \[ y' = 1 + xy^2 \]

with initial conditions y = 0 when x = 0. Assume this differential equation has a power-series solution and compute the first four nonzero terms of the expansion.


Let

    \[ f(x) = \sum_{n=0}^{\infty} a_n x^n \]

be the power series solution of the differential equation. Then we must have

    \begin{align*}   && \sum_{n=1}^{\infty} na_n x^{n-1} &= 1 + x \left( \sum_{n=0}^{\infty} a_n  x^n \right)^2 \\[9pt]  \implies && \sum_{n=1}^{\infty} na_n x^{n-1} &= 1 + x \left( \sum_{n=0}^{\infty} \left( \sum_{k=0}^n a_k a_{n-k} \right) x^n \right) \\[9pt]  \implies && a_1 + 2a_2 x + 3a_3 x^2 + \cdots & = 1 + a_0^2 x + (2a_0 a_1)x^2 + (a_1^2 + 2a_0a_2)x^3 + \cdots. \end{align*}

From the initial condition y =0 when x = 0 we know a_0 = 0. Therefore, equating like powers of x we have

    \begin{align*}  a_1 &= 1 \\[9pt]  2a_2 &= a_0^2 & \implies && a_2 &= 0 \\[9pt]  3a_3 &= 2a_0 a_1 & \implies && a_3 &= 0 \\[9pt]  4a_4 &= a_1^2 + 2a_0 a_2 & \implies && a_4 &= \frac{1}{4} \\[9pt]  5a_5 &= 2(a_0 a_3 + a_1 a_2) & \implies && a_5 &= 0 \\[9pt]  6a_6 &= a_2^2 + 2(a_0 a_4 + a_1 a_3) & \implies && a_6 &= 0 \\[9pt]  7a_7 &= 2(a_0 a_5 + a_1 a_4 + a_2 a_3) & \implies && a_7 &= \frac{1}{14} \\[9pt]  8a_8 &= a_3^2 + 2(a_0 a_6 + a_1 a_5 + a_2 a_4) & \implies && a_8 &= 0  \\[9pt]  9a_9 &= 2(a_0 a_7 + a_1 a_6 + a_2 a_5 + a_3 a_4) & \implies && a_9 &= 0 \\[9pt]  10a_{10} &= a_4^2 + 2(a_0 a_8 + a_1 a_7 + a_2 a_6 + a_3 a_5) & \implies && a_{10} &= \frac{23}{112}. \end{align*}

(Note: The book gives the value a_{10} = \frac{23}{1120}. I think the answer we have above is correct. I’m marking this as errata unless someone convinces me that Apostol is correct.)

Therefore, we have

    \[ f(x) = x + \frac{1}{4} x^4 + \frac{1}{14} x^7 + \frac{23}{112} x^{10} + \cdots. \]

Find the first four nonzero terms of the power series solution of y′ = x2 + y2

Consider the differential equation

    \[ y' = x^2 + y^2 \]

with initial conditions y = 1 when x = 0. Assume this differential equation has a power-series solution and compute the first four nonzero terms of the expansion.


Let

    \[ f(x) = \sum_{n=0}^{\infty} a_n x^n.\]

be the power-series solution of the differential equation. Then we must have

    \begin{align*}   && f'(x) &= x^2 + (f(x))^2 \\[9pt]  \implies && \sum_{n=1}^{\infty} na_n x^{n-1} &= x^2 + \sum_{n=0}^{\infty} \left( \sum_{k=0}^n a_k a_{n-k} \right) x^n \\[9pt]  \implies && a_1 + 2a_2 x + 3a_3 x^2 + \cdots &= a_0^2 + 2a_0 a_1 x + (a_1^2 + 2a_0 a_2 + 1) x^2  + \cdots. \end{align*}

From the initial condition y = 1 when x = 0 we have a_0 = 1. Therefore, equating like powers of x we have the following equations

    \begin{align*}  a_0 &= 1 \\[9pt]  a_1 &= a_0^2 = 1 \\[9pt]  2a_2 &= 2a_0 a_1 = 2 & \implies && a_2 &= 1 \\[9pt]  3a_3 &= a_1^2 + 2a_0 a_2 + 1 = 4 & \implies && a_3 &= \frac{4}{3}. \end{align*}

Therefore, we have

    \[ y = 1 + x + x^2 + \frac{4}{3} x^3 + \cdots. \]

Prove that the Bessel functions are solutions of the Bessel equation

In the previous exercise (Section 11.16, Exercise #10) we defined the Bessel functions of the first kind of orders zero and one by,

    \[ J_0 (x) = \sum_{n=0}^{\infty} (-1)^n  \frac{x^{2n}}{(n!)^2 2^{2n}}, \qquad J_1(x) = \sum_{n=0}^{\infty} (-1)^n \frac{x^{2n+1}}{n!(n+1)! 2^{2n+1}}. \]

Prove that these Bessel functions are solutions of the differential equation

    \[ x^2 y'' + xy' + (x^2 - n^2) y = 0 \]

when n = 0 and n = 1, respectively.


Proof. In the previous exercise (linked above) we proved the following

    \[ J'_0(x) = -J_1(x), \qquad \text{and} \qquad xJ_0(x) = \left( x J_1(x) \right)'. \]

For the case n = 0 we have the differential equation

    \[ x^2 y'' + xy' + x^2 y = 0. \]

Plugging in y = J_0(x) we then have

    \begin{align*}  x^2 y'' + xy' + x^2y &= x^2 J_0''(x) + xJ_0'(x) + x^2 J_0(x) \\[9pt]  &= x^2 \left( -J_1'(x) \right) + x \left(-J_1(x)\right) + x^2 J_0(x) \\[9pt]  &= -x \left( xJ_1'(x) \right)  - x J_1(x) + x^2 J_0(x) \\[9pt]  &= -x \left( \left(xJ_1(x) \right)' - J_1(x) \right) - x J_1(x) + x^2 J_0(x) \\[9pt]  &= -x \left( xJ_0(x) - J_1(x)  \right) - xJ_1(x) + x^2 J_0(x) \\[9pt]  &= -x^2 J_0(x) + xJ_1(x) - xJ_1(x) + x^2 J_0(x) \\[9pt]  &= 0. \end{align*}

So, J_0(x) is indeed a solution in the case n =0.

Now, from the previous exercise we have the relations

    \[ J_0'(x) = -J_1(x), \qquad xJ_0(x) = xJ_1'(x) + J_1(x). \]

Starting with the n = 0 case we differentiate,

    \begin{align*}   && x^2 J_0''(x) + xJ_0'(x) + x^2 J_0(x) &= 0 \\[9pt]  \implies && x^2 J_0'''(x) + 2x J_0''(x) + xJ_0''(x) + J_0'(x) + x^2 J_0'(x) + 2x J_0(x) &= 0 \\[9pt]  \implies && x^2 J_0'''(x) + 3x J_0''(x) + (1+x^2)J_0'(x) + 2x J_0(x) &= 0. \end{align*}

Using the relations above from the previous problem, we substitute

    \begin{align*}  && x^2 J_0'''(x) + 3x J_0''(x) + (1+x^2)J_0'(x) + 2x J_0(x) &= 0 \\[9pt]  \implies && -x^2 J_1''(x) -3x J_1'(x) - (1+x^2) J_1(x) + 2 \left( xJ_0(x) \right) &= 0 \\[9pt]  \implies && -x^2 J_1''(x) - 3x J_1'(x) - (1+x^2) J_1(x) + 2 \left( xJ_1'(x) + J_1(x) \right) &= 0 \\[9pt]  \implies && -x^2 J_1''(x) - 3x J_1'(x) - J_1 (x) - x^2 J_1(x) + 2x J_1'(x) + 2 J_1(x) &= 0 \\[9pt]  \implies && -x^2 J_1''(x) - x J_1'(x) - x^2 J_1(x) + J_1(x) &= 0 \\[9pt]  \implies && x^2 J_1''(x) + x J_1'(x) + x^2 J_1(x) - J_1(x) &= 0 \\[9pt]  \implies && x^2 J_1''(x) + x J_1'(x) + (x^2 - 1) J_1(x) &= 0. \end{align*}

Hence, J_1(x) is indeed a solution of the differentiation equation

    \[ x^2 y'' + xy' + (x^2 - 1)y = 0. \qquad \blacksquare \]

Determine the interval of convergence of a given power series and show that it satisfies a differential equation

Consider the function f(x) defined by the power series

    \[ f(x) = x + \sum_{n=0}^{\infty} \frac{(3x)^{2n+1}}{(2n+1)!}. \]

Determine the interval of convergence for the power series and show that f(x) satisfies the differential equation

    \[ y'' = 9 (y-x). \]


First, we use the ratio test to determine the interval of convergence,

    \begin{align*}  \lim_{n \to \infty} \frac{a_{n+1}}{a_n} &= \lim_{n \to \infty} \left( \frac{(3x)^{2n+3}}{(2n+3)!} \right) \left( \frac{(2n+1)!}{(3x)^{2n+1}} \right) \\[9pt]  &= \lim_{n \to \infty} \frac{9x^2}{(2n+2)(2n+3)} \\[9pt]  &= 0. \end{align*}

Hence, the series converges for all x. Then, to show that it satisfies the given differential equation we take the first two derivatives,

    \begin{align*}  && f(x) &= x + \sum_{n=0}^{\infty} \frac{(3x)^{2n+1}}{(2n+1)!} \\[9pt]  \implies && f'(x) &= 1 + \sum_{n=0}^{\infty} \frac{3(2n+1)(3x)^{2n}}{(2n+1)!} \\[9pt]  &&&= 1 + 3\sum_{n=0}^{\infty} \frac{(3x)^{2n}}{(2n)!} \\[9pt]  \implies && f''(x) &= 3\sum_{n=1}^{\infty} \frac{3(2n)(3x)^{2n-1}}{(2n)!} \\[9pt]  &&&= 9\sum_{n=1}^{\infty} \frac{(3x)^{2n-1}}{(2n-1)!}. \end{align*}

Then we have

    \begin{align*}  9(y-x) &= 9 \left( -x + x + \sum_{n=0}^{\infty} \frac{(3x)^{2n+1}}{(2n+1)!} \right) \\[9pt]  &= 9 \sum_{n=0}^{\infty} \frac{(3x)^{2n+1}}{(2n+1)!} \\[9pt]  &= 9 \sum_{n=1}^{\infty} \frac{(3x)^{2(n-1)+1}}{(2(n-1)+1)!} \\[9pt]  &= 9 \sum_{n=1}^{\infty} \frac{(3x)^{2n-1}}{(2n-1)!} \\[9pt]  &= y''.  \end{align*}

Therefore, f(x) indeed is a solution of the given differential equation.

Now, to find the sum we first need to get the general form of the solutions for the differential equation

    \[ y'' = 9(y-x) \quad \implies \quad y'' - 9y = -9x. \]

First, we find the general form of the solutions of the homogeneous equation

    \[ y'' - 9y = 0. \]

In this case we have an equation of the form y'' + ay' + by = 0 where a = 0 and b= -9. From this we can compute d = a^2 - 4b = 36 and k = \frac{1}{2} \sqrt{d} = 3. Therefore, the general form of the solutions is

    \[ y = e^{-\frac{ax}{2}} \left( c_1 e^{kx} + c_2 e^{-kx} \right) = c_1 e^{3x} + c_2 e^{-3x}. \]

Then, we can find a particular solution y_1 of the given equation by inspection since

    \[ y'' - 9y = -9x \quad \implies \quad y_1 = x \]

is a solution. Therefore, the general solution to the given inhomogeneous equation is

    \[ y = c_1 e^{3x} + c_2 e^{-3x} + x. \]

Now, in the particular case we also have the initial condition f(0) = 0 and so we have

    \[ f(0) = c_1 + c_2 = 0. \]

Furthermore, since f(x) is an odd function we must have

    \[ f(x) = -f(-x) \quad \implies \quad c_1 - c_2 = 1. \]

Therefore, we conclude c_1 =\frac{1}{2} and c_2 = -\frac{1}{2}. And so,

    \[ f(x) = \frac{1}{2} e^{3x} - \frac{1}{2}e^{-3x} + x = x + \sinh (3x). \]

Determine the interval of convergence for a given power series and show that it satisfies a given differential equation

Consider the function f(x) defined by the power series

    \[ f(x) = \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!}. \]

Determine the interval of convergence for f(x) and show that it satisfies the differential equation

    \[ y'' + 4y = 0. \]


First, to determine the interval of convergence for the power series we use the ratio test

    \begin{align*}  \lim_{n \to \infty} \frac{a_{n+1}}{a_n} &= \lim_{n \to \infty} \left( \frac{(-1)^{n+1}2^{2n+2} x^{2n+2}}{(2n+2)!} \right) \left( \frac{(2n)!}{(-1)^n 2^{2n} x^{2n}} \right) \\[9pt]  &= \lim_{n \to \infty} \frac{-4x^2}{(2n+1)(2n+2)} \\[9pt]  &= 0. \end{align*}

Hence, the series converges for all x. Next, to show that it satisfies the given differential equation we take the first two derivatives,

    \begin{align*}  f(x) &= \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} \\[9pt]  f'(x) &= \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n} (2n) x^{2n-1}}{(2n)!} \\[9pt]  &= \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n} x^{2n-1}}{(2n-1)!} \\[9pt]  f''(x) &= \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n} (2n-1) x^{2n-2}}{(2n-1)!} \\[9pt]  &= \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n} x^{2n-2}}{(2n-2)!}. \end{align*}

Then, we have

    \begin{align*}  y'' + 4y &= \sum_{n=1}^{\infty} \frac{(-1)^n 2^{2n} x^{2n-2}}{(2n-2)!} + 4 \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} \\[9pt]  &= \sum_{n=0}^{\infty} \frac{(-1)^{n+1} 2^{2n+2} x^{2n}}{(2n)!} + 4 \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} \\[9pt]  &= 4 \sum_{n=0}^{\infty} \frac{(-1)^{n+1} 2^{2n} x^{2n}}{(2n)!} + 4 \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} \\[9pt]  &= -4 \sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} + 4\sum_{n=0}^{\infty} \frac{(-1)^n 2^{2n} x^{2n}}{(2n)!} \\[9pt]  &= 0. \end{align*}

Thus, f(x) indeed satisfies the given differential equation.

Further, in a previous exercise (Section 8.14, Exercise #2) that the solution of the differential equation y'' + 4y = 0 are all of the form

    \[ y = c_1 \cos (2x) + c_2 \sin (2x). \]

For this problem we also have f(0) = 1 so

    \[ f(0) = c_1 \cos 0 + c_2 \sin 0 = c_1 = 1. \]

Finally, we know this function is an even function (since f(x) = f(-x) for all x because we have x^{2n} inside the sum is the only x term). This means we must have c_2 = 0. Hence, we must have

    \[ f(x) = \cos (2x). \]