# solution to differential equation from deriving power series

Find the solution of the differential equation $$y'= 2xy$$ statisfying $y(0)=1$, by assuming that it can be written as a power series of the form $$y(x)=\sum_{n=0}^\infty a_nx^n.$$

Im advised to derive the reccurrence relation between the coefficient of thie series and write out the first three non-zero terms of the series explicitly.

Struggling to understand and fully complete these types of problems. I have only been able get to a stage where I combine like terms then get lost on where to take it.

I'd very much appreciate an explanation to this.

• $y(x)=e^{x^2}$ is the solution. So you should find out that $a_{2n+1}=0$ and $a_{2n}=(n+1)(n+2)\ldots(2n-1)2n$. Can you write what you've done so far ? – Nicolas May 27 '15 at 17:36

We should note that this differential equation can be solved quickly since it is a separable differential equation:

$$y'/y = 2x \implies \ln y = x^2 + C \implies y = e^C e^{x^2}$$ and the initial condition $y(0)=1$ yields $y = e^{x^2}$.

The power series method idea is to assume the solution can be expressed as a power series (there are theorems to justify this assumption in many cases) and then plug in a power series into the differential equation. Because we already know the solution, this will give us a way to check on our method.

Assume that $y=\sum_{n=0}^\infty a_n x^n$. Then $y' = \sum_{n=0}^\infty a_n n x^{n-1} = \sum_{n=0}^\infty a_{n+1} (n+1) x^n$.

Plug this into the differential equation to find:

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

I keep adjusting the indices in the summation to make it easier to identify terms. Now we see that $$a_{n+1}(n+1) = 2a_{n-1}$$ or $$a_{n+1} = \frac{2 a_{n-1}}{n+1}$$ Notice the skip. We are defining $a_{n+1}$ in terms of $a_{n-1}$ and not $a_n$. This means we will have two different recurrences, one for odd indices and one for even.

The requirement that $y(0)=1$ tells us that $a_0 =1$. Thus $a_2 = 1$ and $a_4 = \frac{1}{2}$ etc. Ultimately we have $a_{2n} = \frac{1}{n!}$.

Now for the odd coefficients (there shouldn't be any since this is an even function) can be determined by noting that the power series on the right of the equation doesn't have a constant term. Comparing with the left side we see that this means $a_{1}=0$. Thus our recursion tells us that there are no odd coefficients.

Thus we can conclude that $y = \sum_{n=0}^\infty a_{2n} x^{2n} = \sum_{n=0}^\infty \frac{1}{n!} x^{2n} = e^{x^2}$

• Can you further explain the use of the initial condition, $y(0)=1$ to obtain $a_0 =1$... – Mondli.K May 27 '15 at 18:12
• If we take $y = \sum_{n=0}^\infty a_n x^n$ then $y(0) = 1$ means that $1 = a_0 + a_1 \cdot 0 + a_2 \cdot 0^2 + \cdots$ and so $1=a_0$. – Joel May 27 '15 at 18:24
• Much appreciated! – Mondli.K May 27 '15 at 18:43
• I am glad I could help. :) If you do not need any further assistance with this question, you should consider accepting one of our answers. It will tell the community that you are happy with the solutions that were given. It also gives us reinforcement to keep answering your questions. – Joel May 27 '15 at 18:48

By differentiating term by term and changing the index we find from the equation $y'=2xy$

$$\sum_{n=0}^\infty (n+1)a_{n+1}x^n=2\sum_{n=1}^\infty a_{n-1}x^n$$ so we get $a_1=0$ and then $a_{2n+1}=0$ for all $n$ and

$$a_n=\frac2n a_{n-2},\quad n\ge2$$ so since $y(0)=a_0=1$ and by induction we get

$$a_{2n}=\frac{2^n}{2n(2n-2)\cdots 2}a_0=\frac1{n!}$$ Finally the solution is $$y(x)=\sum_{n=0}^\infty\frac{x^{2n}}{n!}=e^{x^2}$$

The idea is that if two power series agree on some region of convergence, then they are the same. That is if $\sum_n f_n x^n = \sum_n g_n x^n$ for $x$ is some region, then $f_n = g_n$.

So suppose $y(x) = \sum_n y_n x^n$. Then we can think of $y$ as the coefficients of its power series, that is $(y_0, y_1,...)$.

Then $y'(x) = \sum_n n y_n x^{n-1}$. This corresponds to the power series $(y_1, 2 y_2, 3 y_3, \cdots)$.

You can also compute $2xy(x) = \sum_n 2 y_n x^{n+1}$, which corresponds to the power series $(0, 2 y_0, 2 y_1, 2 y_2, \cdots)$.

If $y$ solves the differential equation given, we must have $(y_1, 2 y_2, 3 y_3, \cdots) = (0, 2 y_0, 2 y_1, 2 y_2, \cdots)$.

We see from this that $y_1 = 0$, hence $y_3 = 0$, etc., so for odd $n$, we have $y_n = 0$.

For even $n$, we have $n y_n = 2 y_{n-2}$. If we solve this, we get $y_n = {1 \over { n \over 2}!} y_0 = {1 \over { n \over 2}!}$ (using the fact that $y(0) = y_0$).

So, we see that $y(x) = 1 + {1 \over 1!} (x^2) + {1 \over 2!} (x^2)^2+\cdots + {1 \over n!} (x^n)^2 +\cdots$, and since $e^x = 1+ {1 \over 1!} x + {1 \over 2!} x^2 + \cdots$, we see, by comparison, that $y(x) = e^{x^2}$.

As an aside, note that if $y$ has a power series $(y_0,y_1,\cdots)$, then the function $x \mapsto y(x^2)$ will have the power series $(y_0, 0, y_1, 0, y_2, 0, \cdots)$. (The region of convergence will, in general, be different.)

$$y’=2xy\Longleftrightarrow$$ $$\frac{dy}{dx}=2xy\Longleftrightarrow$$ $$dy=2xydx\Longleftrightarrow$$ $$\frac{1}{y}dy=2xdx\Longleftrightarrow$$ $$\int \left(\frac{1}{y}\right)dy=\int (2x) dx\Longleftrightarrow$$ $$\ln|y|=x^2+C\Longleftrightarrow$$ $$y=e^{x^2+C}$$ $------$ $$y=e^{x^2+C}\Longrightarrow$$ $$1=e^{0^2+C}\Longleftrightarrow$$ $$1=e^{C}\Longleftrightarrow$$ $$C=\ln(1)=0$$

So: $$y=e^{x^2+0}\Longleftrightarrow y=e^{x^2}=\sum_{k=0}^{\infty} \frac{(x^2)^k}{k!}$$