# Nonhomogeneous Power Series Solution

1. Mar 15, 2012

### Telemachus

Hi. I have to solve: $$y''+xy'-2y=e^x$$
Using series. So, this is what I did:
$$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}=\frac{a_n(2-n)+\frac{1}{n!}}{(n+2)(n+1)}$$
Now I have to find the recurrence relation for $$a_n$$
Is this ok?
Now, I've tried some terms to find the recurrence relation, but I couldn't find it yet.
Even:
$$a_2=a_{0+2}=1/2+a_0$$
$$a_4=a_{2+2}=\frac{a_2(0)+1/2}{4.3}=1/4!$$
$$a_6=a_{4+2}=\frac{a_4(-2)+1/4!}{6.5}=-\frac{1}{6!}$$
$$a_8=a_{6+2}=\frac{a_6(-4)+1/6!}{8.7}=\frac{5}{8!}$$
$$a_{10}=a_{8+2}=\frac{a_8(-6)+1/8!}{10.9}=\frac{-29}{10!}$$

Odd:
$$a_3=a_{1+2}=\frac{a_1+1}{6}=\frac{a_1+1}{3!}$$
$$a_5=a_{3+2}=\frac{a_3(-1)+1/3!}{5.4}=-a_3+1/5!=-\frac{a_1+1}{5!}+1/5!=-\frac{a_1}{5!}$$
$$a_7=a_{5+2}=\frac{a_5(-2)+1/5!}{7.6}=\frac{-3a_1+1}{7!}$$
$$a_9=a_{7+2}=\frac{a_7(-5)+1/7!}{9.8}=\frac{15a_1-4}{9!}$$

Last edited: Mar 15, 2012
2. Mar 15, 2012

### tiny-tim

Hi Telemachus!
Multiply throughout by n! ?

3. Mar 16, 2012

### Telemachus

Oh, I think thats a good idea. Thank you tiny-tim.