Solve $x^2y''+xy'+y=0$ using the power series Basically I have to find the power series of the ODE above.
What I have so far:
$y=\sum_{n=0}^{\infty }a_nx^n$
$y'=\sum_{n=1}^{\infty }na_nx^{n-1}$
$y''=\sum_{n=2}^{\infty }(n-1)(n)a_nx^{n-2}$
therefore,
$xy'=\sum_{n=1}^{\infty }na_nx^{n}$
$x^2y''=\sum_{n=2}^{\infty }(n-1)(n)a_nx^{n}$
since the counters of the summations are different, I evaluate $y$ at $n=0,1$ and $xy'$ at $n=1$
I then get,
($\sum_{n=2}^{\infty }(n-1)(n)a_nx^{n} )+(a_1x^1 + \sum_{n=2}^{\infty }na_nx^{n})+(a_0x^0+a_1x^1+\sum_{n=2}^{\infty }a_nx^n)=0$
This then leaves me with
$a_0=0$
$2a_1=0; a_1 = 0$
$(n-1)(n)a_n+na_n+a_n=0$
I then get a recursion formula of:
$a_n(n^2+1)=0$
which would make my $a_n$ equal to zero.
Where am I wrong? Symbolab says that the answer to this ODE is
$y=c_1\cos(\ln(x))+c_2\sin(\ln(x))$
 A: Your working is entirely correct – but the nontrivial solution is not a power series around $0$. To derive the nontrivial solution change variables $w=\ln x$; the equation becomes, with differentiating now in $w$,
$$x^2(y''/x^2-y'/x^2)+x(y'/x)+y=y''+y=0$$
Of course this has basis solutions $y=\sin w$ and $y=\cos w$, so the general solution is $A\cos\ln x+B\sin\ln x$.
A: You got $$a_0+2a_1x+ \sum_{n=2}^\infty (n^2+1)a_nx^n= 0$$
And you are looking for a suitable sequence $(a_n)$ which verify this, clearly the zero function is a solution to this ODE, but you are looking for non-zero solutions. Hence we must look for $(a_n)$ where at least one term is non zero.
You have $a_0= y(0)$ and $a_1= y'(0)$ could be your initial conditions, that are necessary to give a unique solution to your problem (why? Look up Cauchy's theorem). Now let us look for a suitable sequence $(a_n)$ where we know that $a_0, a_1$ are given. We want $\sum_{n=2}^\infty (n^2+1)a_nx^n= -2a_1x -a_0 $ which, for non-zero $x$, is equivalent to
$\sum_{n=0}^\infty ((n+2)^2+1)a_{n+2}x^{n}= \sum_{n=2}^\infty (n^2+1)a_nx^{n-2}= -\frac{2a_1}{x} -\frac{a_0}{x^2}$   , but we know the power series of the $\frac{1}{x}$ function :
$$\frac{-2a_1}{x}= -2a_1\frac{1}{1-(1-x)}= -2a_1\sum_{n=0}^\infty (1-x)^n= -2a_1\sum_{n=0}^\infty \sum_{k=0}^n (-1)^k{n\choose k}x^k$$
And the other term is:
$$\frac{-a_0}{x^2}= a_0(\frac{1}{x})'= a_0 \sum_{n=1}^\infty -n(1-x)^{n-1}= -na_0 \sum_{n=0}^\infty \sum_{k=0}^n (-1)^k{n\choose k}x^k$$
($\textbf{above there is a mistake in differentiating the power series !}$)
Adding both gives the condition:
$$\sum_{n=0}^\infty ((n+2)^2+1)a_{n+2}x^{n}= (-2a_1-na_0) \sum_{n=0}^\infty \sum_{k=0}^n (-1)^k{n\choose k}x^k$$
You need to work on the triangular sum in the right to have a sum over $k$ :
$$\sum_{n=0}^\infty \sum_{k=0}^n (-1)^k{n\choose k}x^k= \sum_{k=0}^\infty \sum_{n= k}^\infty (-1)^k{n\choose k}x^k$$
Hoping that the dummy indices won't confuse you and you can immediately conclude that
$$ ((n+2)^2+1)a_{n+2}= (-2a_1-na_0) \sum_{k=n}^\infty (-1)^n{k\choose n}$$
Or $$a_{n+2}= \frac{(-2a_1-na_0)}{((n+2)^2+1)} \sum_{k=n}^\infty (-1)^n{k\choose n}$$
Which is well a recursion relation to compute all of the $a_n$'s 
($\textbf{If we can make sense of such summation ! Which we haven't done here}$)
You can simplify it to $$a_{n}= \frac{-2a_1-na_0}{n^2+1} \sum_{k=n-2}^\infty (-1)^n{k\choose n-2}\ , \ \text{ for all } n\geq2 $$
Please do not worry about Symbolab expression, as I think this is enough as an answer if you are doing it for an exam or a homework, it depends actually on how much knowledge have you covered in relation to power series. But you can take it as a good exercise to check why this expression verifies the same recursion relation.
A: This is a regular singular ODE (or simply an Euler-Cauchy DE), the power series to use is a Frobenius power series $$y(x)=\sum a_nx^{r+n}.$$
Computing derivatives as you did results in
$$
\forall n\in\Bbb N~:~((n+r)^2+1)a_n=0.
$$
As especially $a_0\ne 0$, because by construction $x^r$ is the smallest power that actually occurs in the series, you get $$r^2=-1,~~ r=\pm i.$$ The useful expressions for the solution basis functions $x^r=e^{r\ln(x)}$ are $$e^{\pm i\ln x}$$ or their linear combinations $$\sin(\ln x), ~~\cos(\ln x).$$
