# Unique soution of this 2nd order diff equation.

Hi guys have a big problem trying to find the unique solution to the 2nd order diff equation shown below:

y’’(x) = 2xy’(x) + 4y(x)

where y(0) = y’(0) = 1

y’’(x) = 2xy’(x) + 4y(x)

where y(0) = y’(0) = 1

Is this the variable x or 2 times y'(x)?

Anyways, it looks like you've got a simple homogeneous equation here:

$$y'' = 2y' + 4y$$

in which the 1st thing you need to do is find the eigenvalues.

Is this the variable x or 2 times y'(x)?

HallsofIvy
Homework Helper
Probably the best thing to do is to look for a series solution.

Let y= sum a_nx^n. Then y'= na_nx^{n-1} and y''= n(n-1)a_nx^{n-2}. Put those into the differential equation to get
sum n(n-1)a_nx^{n-2}= 2sum na_nx^n+ 4sum a_nx^n

On the left, let j= n-2 so that n= j+2, while letting j= n on the right, and we have
sum (j+2)(j+1)a_{j+2}x^j= sum 2(j+1)a_jx^j.

y(0)= a_0= 1 and y'(0)= a_1= 1.

Now, equate coefficients of the same powers:
a_{j+2}= (2/(j+2))a_j

when j= 0, a_2= (2/2)a_0= 1, when j= 1, a_3= (2/3)a_1= 4 so a_3= 2/3. When j= 2, a_4= (1/2)a_2= 1/2, a_5= (2/5)a_3= 4/15, etc.

The general solution of the ODE involves the erf function and more usual functions.
But, with the particular conditions y(0)=0 and y'(0)=1, simplifications occur.
So you may search a solution of the form y(x)=c*x*exp(x²)

\begin{array}\\y'' = 2xy' + 4y\\
y''-2xy'-4y=0(1)\\
y=x^s\sum_{k=0}^{\infty}a_kx^k\\
x\rightarrow 0, y\rightarrow x^s\\
s(s-1)x^{s-2}-2sx^s-4x^s=0\overset{x\rightarrow 0}{\rightarrow} s(s-1)=0\Rightarrow s=0,s=1\\
y=\sum_{k=0}^{\infty}a_kx^{k+s}\\
y'=\sum_{k=0}^{\infty}a_k(k+s)x^{k+s-1}\\
y''=\sum_{k=0}^{\infty}a_k(k+s-1)(k+s)x^{k+s-2}\\\end{array}

Now substitute to (1)

\begin{array}\\\sum_{k=0}^{\infty}a_k(k+s-1)(k+s)x^{k+s-2}-2\sum_{k=0}^{\infty}a_k(k+s)x^{k+s}-4\sum_{k=0}^{\infty}a_kx^{k+s}=0\\
(k\rightarrow k+2)\\
\sum_{k=0}^{\infty}a_{k+2}(k+s+1)(k+s+2)x^{k+s}-2\sum_{k=0}^{\infty}a_k(k+s)x^{k+s}-4\sum_{k=0}^{\infty}a_kx^{k+s}=0\\
a_{k+2}(k+s+1)(k+s+2)x^{k+s}-2a_k(k+s)x^{k+s}-4a_kx^{k+s}=0\\
a_{k+2}(k+s+1)(k+s+2)-2a_k(k+s)-4a_k=0\\
a_{k+2}=\frac{2a_k(k+s)+4a_k}{(k+s+1)(k+s+2)}
=\frac{2(k+s+2)}{(k+s+1)(k+s+2)}a_k
=\frac{2}{k+s+1}a_k
\end{array}

Let $$a_0=1$$
For the first solution (s=0) we have
\begin{array}\\\\a_{k+2}=\frac{2}{k+1}a_k\\
a_{2k}=\frac{2}{2k-1}a_{2k-2}=\frac{2}{2k-1}\frac{2}{2k-3}a_{2k-4}\\
a_{2k}=\frac{2}{2k-1}\cdot \frac{2}{2k-3}\cdot \frac{2}{2k-5}...\cdot \frac{2}{1}a_0=\frac{2^k}{(2k-1)(2k-3)(2k-5)...1}a_0=\frac{2^k(2k)(2k-2)(2k-4)...2}{(2k)(2k-1)(2k-2)(2k-3)(2k-4)(2k-5)...\cdot 2\cdot 1}\\
\\a_{2k}=\frac{2^{2k}(k)(k-1)(k-2)...1}{(2k)!}=\frac{4^kk!}{(2k)!}\end{array}

Therefore, the first solution is

$$y_1=x^0\sum_{k=0}^{\infty}a_{2k}x^{2k}=\sum_{k=0}^{\infty}\frac{4^kk!}{(2k)!}x^{2k}$$ (The step is 2)

For the second solution (s=1) we have

\begin{array}\\a_{k+2}=\frac{2}{k+2}a_k\\
a_{2k}=\frac{2}{2k}a_{2k-2}=\frac{2}{2k-1}\frac{2}{2k-2}a_{2k-4}\\
a_{2k}=\frac{2}{2k}\cdot \frac{2}{2(k-1)}\cdot \frac{2}{2(k-2)}...\cdot \frac{2}{2}a_0=\frac{1}{(k)(k-1)(k-2)...1}a_0=\frac{1}{k!}\end{array}

Therefore, the second solution is

$$y_2=x^1\sum_{k=0}^{\infty}a_{2k}x^{2k}=x\sum_{k=0}^{\infty}\frac{(x^2)^k}{k!}=xe^{x^2}$$

All in all

$$y=c_1xe^{x^2} +c_2\sum_{k=0}^{\infty}\frac{4^kk!}{(2k)!}x^{2k}$$

Apply the boundary conditions:
\begin{array}\\y(0)=2c_2\Leftrightarrow c_2=\frac{1}{2}\\
y'(0)=c_1\Leftrightarrow c_1=1\end{array}

$$y=xe^{x^2}+\frac{1}{2}\sum_{k=0}^{\infty}\frac{4^kk!}{(2k)!}x^{2k}$$

Last edited: