Using Maclaurin series to solve $y’=xe^x$.

ordinary differential equationspower series

I am trying to solve a differential equation using the Maclaurin series. The differential equation is

$$y'=xe^x$$

My solution 1:

$xe^x$ expressed in sigma notation is: $\sum_{k=0}^\infty\frac{x^{k+1}}{k!}$ and $y'=\sum_{k=0}^\infty(k+1)a_{k+1}x^k$. Equating them will lead to

$$\sum_{k=0}^\infty(k+1)a_{k+1}x^k=\sum_{k=0}^\infty\frac{x^{k+1}}{k!}$$
I was trying to comparing the coefficients, so as to obtain a recurrence relation. But I couldn't do it because the $x$ on both sides of the equation has different exponents ($k$ and $k+1$) respectively.

My solution 2:

I integrate the differential equation to obtain $y=xe^x-e^x+c$ which in sigma notation corresponds to $$y=c+\sum_{k=0}^\infty\frac{x^{k+1}}{k!}-\sum_{k=0}^\infty\frac{x^k}{k!}$$ which can be samplified as

$$y=c+\sum_{k=0}^\infty\frac{x^k(x-1)}{k!}$$

Question:

Am I going in the right direction? In both solutions, I am stuck and am unable to arrive at the textbook solution of

$$y=c+\sum_{k=0}^\infty\frac{x^{k+2}}{(k+2)k!}$$

Thank you in advance.

Best Answer

I think that you are supposed to directly start with $$y=\sum_{n=0}^\infty a_n\,x^n$$ to make $$\sum_{n=0}^\infty n\,a_n\,x^{n-1}=\sum_{k=0}^\infty \frac {x^{k+1}}{k!}$$ Expand just a little $$a_1+2a_2x+3a_3 x^2+4a_4 x^3+\cdots=\frac x{1!}+\frac {x^2}{1!}+\frac {x^3}{2!}+\cdots$$

So, just looking, $a_0$ is undefined (this is normal; it will be the constant of integration.

$a_1=0$ (since no constant term in the rhs)

Now, for the other, I am sure that you see how they are formed.

So, as you wrote $$y=c+\sum_{n=2}^\infty a_n\,x^n$$

Now, shift the index to start at $0$ if you wish.