# Math Help - Maclaurin Series for a Differential Equation

1. ## Maclaurin Series for a Differential Equation

Consider the differential equation:
$\frac{dy}{dx} = y - x + 1$
The initial condition is y(0) = 1. Construct the Maclaurin series for y(x).

I know I'm supposed to differentiate it, but I don't remember how to use the initial condition to start me off...

2. The McLaurin series for y is...

$y= \sum_{n=0}^{\infty} a_{n}\cdot x^{n}$ (1)

... so that...

$y^{'}= \sum_{n=0}^{\infty} n\cdot a_{n-1}\cdot x^{n-1}$ (2)

The 'initial condition' $y(0)=1$ extablishes that $a_{0}=1$. If now write the DE in terms of (1) and (2) we obtain...

$\sum_{n=0}^{\infty} \{(n+1)\cdot a_{n+1} -a_{n}\}\cdot x^{n}= 1-x$ (3)

.. so that is...

$a_{1}=2$

$a_{2}=\frac{1}{2}$

$a_{n+1}= \frac{a_{n}}{n+1}, n>2$ (4)

Kind regards

3. see attachment