I am looking at the following exercise:
Consider the initial value problem
$\left\{\begin{matrix} x''(t)=x(t)\\ x(0)=a\\ x'(0)=b \end{matrix}\right.$
Write it as a system of First-Order ODES with suitable initial values and show that Euler method can get unstable for a great step $(h)$.
That is the solution that the assistant of the prof gave us: $$y_1=x \Rightarrow y_1'=x'=y_2 | y_1(0)=x(0)=a \\ y_2=x' \Rightarrow y_2'=x''=y_1 | y_2(0)=x'(0)=b $$
$$\binom{y_1}{y_2}'=\begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix} \binom{y_1}{y_2} \text{ with } \binom{y_1(0)}{y_2(0)}=\binom{a}{b}$$
Euler method:
$$\binom{y_1^{n+1}}{y_2^{n+1}}=\binom{y_1^n}{y_2^n}+h \begin{pmatrix} 0 & 1\\ 1 & 0 \end{pmatrix} \binom{y_1^n}{y_2^n}=\binom{y_1^n+hy_2^n}{y_2^n+hy_1^n} \\ \binom{y_1^{n+1}}{y_2^{n+1}}= \begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{y_1^n}{y_2^n}$$
$$b=-a$$
The exact solution of the initial value problem is ($t^n=nh$)
$\binom{y_1(t)}{y_2(t)}=e^t \binom{a}{-a} \Rightarrow \binom{y_1(t^n)}{y_2(t^n)}=e^{-t^n} \binom{a}{-a}=e^{-nh} \binom{a}{-a}$, $h$ constant, $n \to +\infty, y \to 0$.
$y=e^{-t}$
Euler method
$\binom{y_1^1}{y_2^1}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{y_1^0}{y_2^0}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{a}{-a}=(1-h) \binom{a}{-a}$
$\binom{y_1^2}{y_2^2}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{y_1^1}{y_2^1}=(1-h)^2 \binom{a}{-a}$
$\dots \dots \dots$
$\binom{y_1^n}{y_2^n}=(1-h)^n \binom{a}{-a}$
$|1-h|>1 \Rightarrow h>2$.
First of all, how do we find that $\binom{y_1^1}{y_2^1}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{y_1^0}{y_2^0}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{a}{-a}=(1-h) \binom{a}{-a},\binom{y_1^2}{y_2^2}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{y_1^1}{y_2^1}=(1-h)^2 \binom{a}{-a}$, $\dots $,$\binom{y_1^n}{y_2^n}=(1-h)^n \binom{a}{-a}$?
I found the following:
$\binom{y_1^1}{y_2^1}=\begin{pmatrix} 1 & h\\ h & 1 \end{pmatrix} \binom{a}{b}, \binom{y_1^2}{y_2^2}=\begin{pmatrix} 1+h^2 & 2h\\ 2h & h^2+1 \end{pmatrix} \binom{a}{b}, \binom{y_1^3}{y_2^3}=\begin{pmatrix} 1+3h^2 & h(h^2+3)\\ h(h^2+3) & 1+3h^2 \end{pmatrix} \binom{a}{b}$
Am I wrong? If not, how could we find the general formula?
Also, don't we find the real solution of the system of the First-Order ODES as follows?
$\begin{vmatrix} -\lambda & 1\\ 1& -\lambda \end{vmatrix}=0 \Rightarrow \lambda^2=1 \Rightarrow \lambda=\pm 1$.
Now we are looking for the eigenvectors.
For $\lambda=1$:
$\begin{pmatrix} -1 & 1 \\ 1 & -1 \end{pmatrix} \binom{u}{w}=\binom{0}{0} \Rightarrow \left\{\begin{matrix} -u+w=0\\ u-w=0 \end{matrix}\right. \Rightarrow \left\{\begin{matrix} w=u\\ u=w \end{matrix}\right. \overset{\text{ we set } u=1}{\Rightarrow } u=w=1$
For $\lambda=-1$:
$\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} \binom{u}{w}=\binom{0}{0} \Rightarrow u+w=0 \Rightarrow u=-w \overset{\text{ we set w=-1}}{\Rightarrow } u=1=-w$
So the solution is of the form:
$\binom{y_1}{y_2}=c_1 \binom{1}{1} e^{t}+ c_2 \binom{-1}{1} e^{-t}$
Using the initial conditions, I got the following:
$\binom{y_1}{y_2}= \frac{a+b}{2} \binom{1}{1} e^t+ \frac{b-a}{2} \binom{-1}{1}e^{-t}$
How could we show that for a great step $h$ the method can get unstable?
EDIT: We have $A=\begin {pmatrix} 1&h\\h&1 \end {pmatrix}$ and we write it as $A=SDS^{-1}$ where $D$ is diagonal. Then $A^n=SD^nS^{-1}$.
$$S=\begin {pmatrix} -1&1\\1&1 \end {pmatrix}$$
$$S^{-1}=\begin {pmatrix} \frac{-1}{2}&\frac{1}{2}\\\frac{1}{2}&\frac{1}{2} \end {pmatrix}$$
$$D=\begin {pmatrix} 1-h&0\\0&1+h \end {pmatrix} \Rightarrow D^n=\begin {pmatrix} (1-h)^n&0\\0&(1+h)^n \end {pmatrix}$$
How do we conclude that $ \binom{y_1^n}{y_2^n}=(1-h)^n \binom{a}{b} ?$
EDIT 2: I found that: $$\binom{y_1^n}{y_2^n}=\begin{pmatrix} (1-h)^n \left( \frac{a-b}{2} \right )+(1+h)^n \left( \frac{a+b}{2} \right )\\ \\ (1-h)^n\left( \frac{b-a}{2} \right )+(1+h)^n \left( \frac{a+b}{2} \right ) \end{pmatrix}$$
I have to show that Euler method gets unstable for a great step $h$.
But why does this hold? $y_1^n$ and $y_2^n$ are unbounded for each $h>0$ since $(1+h)^n \to +\infty$, right? Or am I wrong?