Maths WorkshopMaths problems with full solutions
Exercise 775Calculus › Single-variable calculus › Series › Power seriesL2Added 2 Nov 2026

Solving y″ = −y with a power series

#differential equations#power series#cosine#recurrence

Statement

Find a power series solution y(x)=∑n≥0anxny(x)=\sum_{n\ge0}a_nx^n of y′′+y=0y''+y=0 with y(0)=1y(0)=1 and y′(0)=0y'(0)=0. Identify the function.

Hint

Differentiate twice term by term, collect the coefficient of xnx^n and find a recurrence for ana_n.

Show solutionHide solution

Solution

Initial conditions. a0=y(0)=1a_0=y(0)=1 and a1=y′(0)=0a_1=y'(0)=0.

Equation. y′′=∑n≥0(n+2)(n+1)an+2xny''=\sum_{n\ge0}(n+2)(n+1)a_{n+2}x^n. The equation y′′+y=0y''+y=0 gives, for every nn,
(n+2)(n+1)an+2+an=0,an+2=−an(n+1)(n+2).(n+2)(n+1)a_{n+2}+a_n=0,\qquad a_{n+2}=-\frac{a_n}{(n+1)(n+2)}.

Solving. Since a1=0a_1=0, all odd coefficients vanish. For even indices:
a2=−12,a4=14!,a6=−16!, …,a2k=(−1)k(2k)!.a_2=-\frac{1}{2},\quad a_4=\frac1{4!},\quad a_6=-\frac1{6!},\ \dots,\qquad a_{2k}=\frac{(-1)^k}{(2k)!}.

Answer.
y(x)=∑k≥0(−1)kx2k(2k)!=cos⁡x.y(x)=\sum_{k\ge0}\frac{(-1)^kx^{2k}}{(2k)!}=\cos x.
The series has infinite radius of convergence (ratio test), so the term-by-term differentiation is justified.

Remark. With y(0)=0y(0)=0, y′(0)=1y'(0)=1 the same method gives sin⁡x\sin x. This is the standard "analytic" definition of sine and cosine.