Assume
[tex]x=\displaystyle\sum_{n\ge0}a_nt^n[/tex]
[tex]\implies x''=\displaystyle\sum_{n\ge0}(n+1)(n+2)a_{n+2}t^n[/tex]
Substituting these series into the ODE gives
[tex]\displaystyle\sum_{n\ge0}\bigg[(n+1)(n+2)a_{n+2}+a_n\bigg]t^n=0[/tex]
from which we get
[tex](n+1)(n+2)a_{n+2}+a_n=0\implies a_{n+2}=-\dfrac{a_n}{(n+1)(n+2)}[/tex]
for [tex]n\ge0[/tex], given [tex]x(0)=a_0[/tex] and [tex]x'(0)=a_1[/tex]. Now,
[tex]k=0\implies n=0\implies a_0=a_0[/tex]
[tex]k=1\implies n=2\implies a_2=-\dfrac{a_0}{1\cdot2}=(-1)^1\dfrac{a_0}{2!}[/tex]
[tex]k=2\implies n=4\implies a_4=-\dfrac{a_2}{3\cdot4}=(-1)^2\dfrac{a_0}{4!}[/tex]
[tex]k=3\implies n=6\implies a_6=-\dfrac{a_4}{5\cdot6}=(-1)^3\dfrac{a_0}{6!}[/tex]
and so on, with the general rule
[tex]a_{2k}=(-1)^k\dfrac{a_0}{(2k)!}[/tex]
[tex]k=0\implies n=1\implies a_1=a_1[/tex]
[tex]k=1\implies n=3\implies a_3=-\dfrac{a_1}{2\cdot3}=(-1)^1\dfrac{a_1}{3!}[/tex]
[tex]k=2\implies n=5\implies a_5=-\dfrac{a_3}{4\cdot5}=(-1)^2\dfrac{a_1}{5!}[/tex]
[tex]k=3\implies n=7\implies a_7=-\dfrac{a_5}{6\cdot7}=(-1)^3\dfrac{a_1}{7!}[/tex]
[tex]\implies a_{2k+1}=(-1)^k\dfrac{a_1}{(2k+1)!}[/tex]
So the series solution is
[tex]\displaystyle x(t)=\sum_{k\ge0}\bigg(a_{2k}t^{2k}+a_{2k+1}t^{2k+1}\bigg)[/tex]
[tex]x(t)=\displaystyle a_0\sum_{k\ge0}\frac{(-1)^kt^{2k}}{(2k)!}+a_1\sum_{k\ge0}\frac{(-1)^kt^{2k+1}}{(2k+1)!}[/tex]
[tex]\implies x(t)=a_0\cot t+a_1\sin t[/tex]