# Second order diff. equation. Series solution

• March 12th 2012, 03:57 PM
Ulysses
Second order diff. equation. Series solution
Hi there. I have to solve: $y''+xy'-2y=e^x$
I thought I should use a series solution, but I'm not sure if what I'm doing is ok. So, I've considered

$y(x)=\sum_0^{\infty}a_n x^n$

$y'(x)=\sum_1^{\infty}n a_n x^{n-1}$

$y''(x)=\sum_2^{\infty}n(n-1) a_n x^{n-1}$

And $e^x=\sum_0^{\infty}\frac{x^n}{n!}$

Then, using that m=n-2 for y'' and then replacing in the diff. eq:
$\sum_0^{\infty}(n+2)(n+1)a_{n+2} x^n+x\sum_1^{\infty}n a_n x^{n-1}-2\sum_0^{\infty}a_n x^n=\sum_0^{\infty}\frac{x^n}{n!}$

So:
$2a_2-2a_0-1+\sum_1^{\infty}\left [(n+2)(n+1)a_{n+2}+n a_n -2a_n -\frac{1}{n!} \right ] x^n=0$

Then: $2a_2-2a_0-1=0\rightarrow a_2=1/2+a_0$

And: $(n+2)(n+1)a_{n+2}+n a_n -2a_n -\frac{1}{n!}=0\rightarrow a_{n+2}=a_n\frac{(2-n)}{(n+2)(n+2)}$

Now I have to find the recurrence for $a_n$
Is this ok?
• March 13th 2012, 06:51 AM
Ulysses
Re: Second order diff. equation. Series solution
I think I should solve the homogeneus equation first.
• March 13th 2012, 07:10 AM
princeps
Re: Second order diff. equation. Series solution
• March 13th 2012, 07:51 AM
Ulysses
Re: Second order diff. equation. Series solution
Thanks, but I have to solve it using series.