##########################################################
# Calculation of the general 2x2 non-diagonalizable matrix exponential: #
##########################################################
(Here is a PDF of this answer, in case you have trouble reading the below:
1drv.ms/b/s!AvQhCl0SMET30wn-tvUbEwykJWDI?e=ekcXjb.)
Let a, b, c, d, λ, x, & y all be real numbers; with {b,c} ≠ {0,0} & y ≠ 0;
where a, b, c, & d are the entries of our general matrix A below; λ (lambda)
is the 1 unique eigenvalue of that matrix; x & y are the entries of the 1
unique eigenvector v of that matrix; such that the following matrix-vector
equation holds: Av = [ a b ] [ x ] = [ ax+by ] = [ λx ] = λv,
[ c d ] [ y ] [ cx+dy ] [ λy ]
but also such that:
Av = [ a b ] [ 1 ] = [ a*1+b*0 ] = [ a+0 ] = [ a ] ≠ [ λ ] = [ λ*1 ] = λv.
[ c d ] [ 0 ] [ c*1+d*0 ] [ c+0 ] [ c ] [ 0 ] [ λ*0 ]
However, this is only possible if c ≠ 0, so we must assume that too.
Now, also let D = [ λ 1 ] and P = [ x 1 ], so P⁻¹ = [ 0 -1 ] / (x*0-y*1)
[ 0 λ ] [ y 0 ] [ -y x ]
P⁻¹ = [ 0 -1 ] / (0-y) = [ 0 -1 ] / -y = [ 0/-y -1/-y ] = [ 0 1/y ],
[ -y x ] [ -y x ] [ -y/-y x/-y ] [ 1 -x/y ]
so A = [ a b ] = PDP⁻¹ = [ x 1 ] [ λ 1 ] [ 0 1/y ]
[ c d ] [ y 0 ] [ 0 λ ] [ 1 -x/y ]
A = [ x 1 ] [ λ*0+1*1 λ*(1/y)+1*(-x/y) ] = [ x 1 ] [ 0+1 λ/y-x/y ]
[ y 0 ] [ 0*0+λ*1 0*(1/y)+λ*(-x/y) ] [ y 0 ] [ 0+λ 0-λx/y ]
A = [ x 1 ] [ 1 (λ-x)/y ] = [ x*1+1*λ x(λ-x)/y-1λx/y ]
[ y 0 ] [ λ -λx/y ] [ y*1+0*λ y(λ-x)/y-0λx/y ]
A = [ x+λ λx/y-x*x/y-λx/y ] = [ λ+x -x²/y ] = [ a b ]
[ y+0 (λ-x)-0 ] [ y λ-x ] [ c d ]
So, e^A = exp(A) = ∑(n=0 to ∞) A^n / n! = ∑(n=0 to ∞) (PDP⁻¹)^n / n!,
so e^A = ∑(n=0 to ∞) (PDP⁻¹)(PDP⁻¹)...(PDP⁻¹) [n times] / n!, which
is = ∑(n=0 to ∞) PD(P⁻¹P)D(P⁻¹P)D...D(P⁻¹P)DP⁻¹ [n times] / n!, which
is = ∑(n=0 to ∞) PD(ID)(ID)...D(ID)P⁻¹ [n times] / n!, which is
= ∑(n=0 to ∞) P DD...DD [n times and then] P⁻¹ / n!, which is
= ∑(n=0 to ∞) P(D^n)P⁻¹ / n! = P [∑(n=0 to ∞) D^n / n!] P⁻¹, where
D^0 = I = [ 1 0 ], D^1 = D = [ λ 1 ], D^n = [ λ^n n*λ^(n-1) ],
[ 0 1 ] [ 0 λ ] [ 0 λ^n ]
and D^(n+1) = D(D^n) = [ λ 1 ] [ λ^n n*λ^(n-1) ]
[ 0 λ ] [ 0 λ^n ]
= [ λ*λ^n+1*0 λ*n*λ^(n-1)+1*λ^n ] = [ λ^(n+1) (n+1)*λ^n ], so
[ 0*λ^n+λ*0 0*n*λ^(n-1)+λ*λ^n ] [ 0 λ^(n+1) ]
e^A = P [∑(n=0 to ∞) [ λ^n n*λ^(n-1) ] / n!] P⁻¹
[ 0 λ^n ]
e^A = P [ ∑(n=0 to ∞) λ^n/n! ∑(n=0 to ∞) n*λ^(n-1)/n! ] P⁻¹
[ 0 ∑(n=0 to ∞) λ^n/n! ]
e^A = P [ e^λ 0*λ^(0-1)/0!+∑(n=1 to ∞) λ^(n-1)/(n-1)! ] P⁻¹
[ 0 e^λ ]
e^A = P [ e^λ 0+∑(m=0 to ∞) λ^m/m! ] P⁻¹, where m = n-1, so
[ 0 e^λ ]
e^A = P [ e^λ e^λ ] P⁻¹ = e^λ * P [ 1 1 ] P⁻¹, so now we get:
[ 0 e^λ ] [ 0 1 ]
e^A = e^λ * [ x 1 ] [ 1 1 ] [ 0 1/y ] = e^λ * [ x 1 ] [ 0+1 1/y-x/y ]
[ y 0 ] [ 0 1 ] [ 1 -x/y ] [ y 0 ] [ 0+1 0-x/y ]
e^A = e^λ * [ x 1 ] [ 1 (1-x)/y ] = e^λ * [ x*1+1*0 x*(1-x)/y-1*x/y ]
[ y 0 ] [ 0 -x/y ] [ y*1+0*0 y*(1-x)/y-0*x/y ]
e^A = e^λ * [ x+0 (x-x²)/y-x/y ] = e^λ * [ x -x²/y ]
[ y+0 (1-x)-0 ] [ y 1-x ]
Now, recall that A = [ λ+x -x²/y ] = [ a b ], so y = c ≠ 0, -x²/y = b,
[ y λ-x ] [ c d ]
λ = 2*λ/2 = (λ+λ)/2 = ( (λ+x) + (λ-x) ) / 2 = (a+d)/2, and
x = 2*x/2 = (x+x)/2 = ( (λ+x) - (λ-x) ) / 2 = (a-d)/2, so
1-x = 1 - (a-d)/2 = 2/2 - a/2 + d/2 = (2+d-a)/2, so, finally, we have:
e^A = exp(A) = e^λ * [ x -x²/y ] = exp( (a+d)/2 ) * [ (a-d)/2 b ].
[ y 1-x ] [ c (2+d-a)/2 ]
Now, we will let a, b, c, d, λ, x, & y all be real numbers again,
with {b,c} ≠ {0,0}, but this time we have x ≠ 0, y = 0, and
Av = [ a b ] [ 0 ] = [ a*0+b*1 ] = [ 0+b ] = [ b ] ≠ [ 0 ] = [ λ*0 ] = λv.
[ c d ] [ 1 ] [ c*0+d*1 ] [ 0+d ] [ d ] [ λ ] [ λ*1 ]
However, this is only possible if b ≠ 0, so we must assume that too.
Now, also let D = [ λ 1 ] and P = [ x 0 ], so P⁻¹ = [ 1 0 ] / (x*1-0*0)
[ 0 λ ] [ 0 1 ] [ 0 x ]
P⁻¹ = [ 1 0 ] / (x-0) = [ 1 0 ] / x = [ 1/x 0/x ] = [ 1/x 0 ], so
[ 0 x ] [ 0 x ] [ 0/x x/x ] [ 0 1 ]
A = [ a b ] = PDP⁻¹ = [ x 0 ] [ λ 1 ] [ 1/x 0 ]
[ c d ] [ 0 1 ] [ 0 λ ] [ 0 1 ]
A = [ x 0 ] [ λ*(1/x)+1*0 λ*0+1*1 ] = [ x 0 ] [ (λ/x)+0 0+1 ]
[ 0 1 ] [ 0*(1/x)+λ*0 0*0+λ*1 ] [ 0 1 ] [ 0+0 0+λ ]
A = [ x 0 ] [ λ/x 1 ] = [ x*(λ/x)+0*0 x*1+0*λ ] = [ λ+0 x+0 ]
[ 0 1 ] [ 0 λ ] [ 0*(λ/x)+1*0 0*1+1*λ ] [ 0+0 0+λ ]
A = [ λ x ] = [ a b ], so e^A = e^λ * P [ 1 1 ] P⁻¹, so now we get:
[ 0 λ ] [ c d ] [ 0 1 ]
e^A = e^λ * [ x 0 ] [ 1 1 ] [ 1/x 0 ] = e^λ * [ x 0 ] [ 1/x 1 ]
[ 0 1 ] [ 0 1 ] [ 0 1 ] [ 0 1 ] [ 0 1 ]
e^A = e^λ * [ x*(1/x)+0*0 x*1+0*1 ] = e^λ * [ 1+0 x+0 ] = e^λ * [ 1 x ]
[ 0*(1/x)+1*0 0*1+1*1 ] [ 0+0 0+1 ] [ 0 1 ]
Now, recall that A = [ λ x ] = [ a b ],
[ 0 λ ] [ c d ]
so λ = a and x = b ≠ 0, so, finally, we have:
e^A = exp(A) = e^λ * [ 1 x ] = exp(a) * [ 1 b ].
[ 0 1 ] [ 0 1 ]