Problem: Find a power series solution $y(x)$ around the point $x_0 = 0$ of the equation
\[
y'' + y = 0.
\]
Solution: We will use power series solution to show that the solution of given ODE is $y(x) = c_1\cos x + c_2 \sin x$, where $c_1$ and $c_2$ are arbitrary constants. Let
\begin{align*}
y(x) & = \sum_{n=0}^{\infty} a_n x^n,\quad a_n \in \mathbb{R} \\
\implies y'(x) & = \sum_{n=1}^{\infty} n a_{n} x^n-1, \quad \text{ and } \\
\implies y''(x) & = \sum_{n=2}^{\infty} n(n-1)a_n x^{n-2} .
\end{align*}
Substituting the values in the given differential equation, we get
\begin{align*}
y''(x) + y(x) = 0 & \implies \sum_{n=2}^{\infty} n(n-1) a_n x^{n-2} + \sum_{n=0}^{\infty} a_n x^n = 0 \\
& \implies \sum_{n=0}^{\infty} (n+1)(n+2) a_{n+2}x^n + \sum_{n=0}^{\infty} a_n x^n = 0 \\
& \implies \sum_{n=0}^{\infty} \left[ (n+1)(n+2)a_{n+2} + a_n \right] = 0 \\
& \implies (n+1) (n+2) a_{n+2} + a_n = 0,\quad n \geq 0.
\end{align*}
Now we substitute different values of $n$ to find the constants.
\begin{align*}
n = 0 & \implies 2a_2 + a_0 = 0 \implies a_2 = -\frac{1}{2}a_0 = -\frac{1}{2!}a_0 \\
n = 1 & \implies 6a_3 + a_1 = 0 \implies a_3 = -\frac{1}{6}a_1 = -\frac{1}{3!}a_1 \\
n = 2 & \implies 12 a_4 + a_2 = 0 \implies a_4 = -\frac{1}{12}a_2 = \frac{1}{4!}a_0 \\
n = 3 & \implies 20 a_5 + a_3 = 0 \implies a_5 - \frac{1}{20}a_3 = \frac{1}{5!}a_1.
\end{align*}
One can prove, by induction, that
\[
a_{2n} = \frac{(-1)^n}{(2n)!}a_0,\quad a_{2n+1} = \frac{(-1)^{k+1}}{(2k+1)!}a_1.
\]
Hence, the solution of the given differential equation is
\[
y(x) = a_0 \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!} x^{2n} + a_1 \sum_{n=0}^{\infty} \frac{(-1)^{n+1}}{(2n+1)!}.
\]
The first series is the for the function $\cos x$ and the second is for the $\sin (x)$. Thus,
\[
y(x) = a_0 \cos x + a_1 \sin x,
\]
where $a_0$ and $a_1$ are arbitrary constants.