# System of two second order ODE's. Solution does not agree with Wolfram.

1. Oct 25, 2014

### 2sin54

1. The problem statement, all variables and given/known data
Solve the following system of differential equations:

$y''(x) = y'(x) + z'(x) - z(x)$
$z''(x) = -5*y'(x) - z'(x) -4*y(x) + z(x)$

2. The attempt at a solution

I converted the two second order equations to 4 first order equations by substituting:
$g(x) = y'(x)$ and $h(x) = z'(x)$

So now I have the following system of equations:

$g' = g + h - z$
$h' = -5g - h - 4y + z$
$y' = g$
$z' = h$

I wrote the system in matrix form, solved the characteristic equation for 4 eigenvalues and got
λ1 = $1$
λ2 = $-1$
λ3 = $2i$
λ4 = $-2i$

So the eigenvectors are as follows:

V1 = $(-1,9,-1,9)$
V2 = $(-1,1,1,-1)$
V3 = $(1,2i,-i/2,1)$
V4 = $(1,-2i,i/2,1)$

So then

X1 = $exp(x)$V1
X2 = $exp(-x)$V2
X3 = $(cos2x+i*sin2x)$V3
X4 = $(cos2x-i*sin2x)$V4

Skipping some steps (separating complex and real parts of the matrices)

I get that the general solution is (in matrix form):

ϒ = C1*X1 + C2*X2 + C3*X3 + C4*X4

Now, since I need the solution just to the last two functions ( $y(x)$ and $z(x)$ )

I multiply out the last two rows of the matrices and get:

$y(x) = -C_1exp(x) + C_2exp(-x) + (C_3/2)sin2x-(C_4/2)cos2x + (C_5/2)sin2x + (C_6/2)cos2x$

I am not too sure how to proceed further because if I group some arbitrary constants together (near sines and cosines), these constants will not match with the constants in the solution for function Z(x). Nevertheless, $y(x)$ appears to not agree with WolframAlpha:

http://www.wolframalpha.com/input/?i=system of equations&a=*C.system of equations-_*Calculator.dflt-&a=FSelect_**SolveSystemOf2EquationsCalculator--&f3=y''(x)=y'(x)+z'(x)-z(x)&f=SolveSystemOf4EquationsCalculator.equation1_y''(x)=y'(x)+z'(x)-z(x)&f4= z''(x)=-5*y'(x)-z'(x)-4*y(x)+z(x)&f=SolveSystemOf4EquationsCalculator.equation2_ z''(x)=-5*y'(x)-z'(x)-4*y(x)+z(x)&f5=&f=SolveSystemOf4EquationsCalculator.equation3_&f6=&f=SolveSystemOf4EquationsCalculator.equation4_

I can't seem to find a mistake. Can anyone help me?

2. Oct 25, 2014

### vela

Staff Emeritus
Nice problem… good review for me. It sounds like your method is correct, so it's probably just algebra and sign mistakes. I'm not sure what your $c_5$ and $c_6$ are, however.

One thing I learned is that if you calculate $\vec{v}_3 e^{2it}$, the real and imaginary parts give you the two independent solutions for the complex roots. That saves doing a bit of algebra, and I think it'll help you avoid whatever error you made. This is the solution I ended up with (with $x$ replaced by $t$):
$$\begin{bmatrix} g \\ h \\ y \\ z\end{bmatrix} = c_1 \begin{bmatrix} -1 \\ 9 \\ -1 \\ 9 \end{bmatrix} e^t + c_2 \begin{bmatrix} -1 \\ 1 \\ 1 \\ -1 \end{bmatrix} e^{-t} + c_3 \begin{bmatrix} \cos 2t \\ -2 \sin 2t \\ \frac 12 \sin 2t \\ \cos 2t \end{bmatrix} + c_4 \begin{bmatrix} \sin 2t \\ 2 \cos 2t \\ -\frac 12 \cos 2t \\ \sin 2t \end{bmatrix}.$$ The results from Wolfram Alpha are kind of a pain to compare to because they're not simplified. I did verify the solution I got in Mathematica.

Last edited: Oct 26, 2014
3. Oct 26, 2014

### 2sin54

Alright. So if I understand you correctly the real parts and the complex parts of

X3 = $(cos2x+i*sin2x)$V3
X4 = $(cos2x-i*sin2x)$V4

are linearly dependant matrices so I can eliminate one real and one complex part? That does makes sense.

Last edited: Oct 26, 2014
4. Oct 26, 2014

### vela

Staff Emeritus
Yes, though I wouldn't say you're eliminating anything. You're just rearranging terms and combining constants. $\vec{x}_3$ and $\vec{x}_4$ are complex conjugates, so each component of $c_3 \vec{x}_3 + c_4 \vec{x}_4$ is of the form $c_3 (p+iq) + c_4 (p-iq) = (c_3+c_4) p + i(c_3-c_4)q$.

5. Oct 26, 2014

### 2sin54

Thanks for clearing things up.