# Difference Equations with Nondiagonalizable Matrices

In the last video, we saw how to solve
difference equations when the relevant matrix was diagonalizable. Now, we’re
gonna look at a difference equation where the matrix is not diagonalizable,
and we’re gonna modify our technique to solve that too. So, here is our set of
equations, x_1 and x_2 tomorrow are linear functions of x_1 and x_2 –
sorry, x_1 and x_2 today are linear functions of x_1 and x_2 yesterday,
and we’re gonna start with the initial conditions 5 2. So, as I said, our matrix
is not diagonalizable. You can see that the columns add up to 2, so 2 has to be
an eigenvalue, the trace is 4, so the other eigenvalue has to be 2, so 2
has algebraic multiplicity 2, but there’s only one eigenvector,
the eigenvector is (1 -1). However, you can find a power
vector, (0 1), and b_1 and b_2 provide a nice basis for R2.
So, if you multiply the eigenvector by A minus twice the identity,
you get 0, you multiply the power vector by A minus twice the
identity, you get the eigenvector, and if you multiply it by A minus
twice the identity again, you get 0. Okay, so, what’s our strategy? Just as before, we wanna switch
to our favorite basis. It’s not a basis of eigenvectors, but it’s
still a good basis, and we want to write y to be the coordinates of
x in that basis, and you use a change of basis matrix to convert
from x to y, and you use the inverse matrix to convert from
y to x. Now, we’re gonna solve for y at time n in terms of y at
time 0, and we’re gonna go around our favorite square. We’re gonna
start with x at time 0, we’re gonna ride the elevator, the change of
basis matrix to get y times 0, we’re gonna figure out what y
is at time n, and we’re gonna convert that to x at time n.
The only hitch is that this middle step is more complicated than
just multiplying by the nth power of the eigenvalues, things are
a bit trickier, and we’re gonna see how to do it. So, remember, that we’re
really trying to multiply by A to the n, so x at time n is A to the n times x at
time 0, so we have to apply A to the n to b_1, and we have to apply A to the n
to b_2, and we did this, we saw how in a previous video, we saw how a power of
a matrix acts on an eigenvector, and how a power of a matrix acts on a
power vector. So, acting on the eigenvector, it just multiplies by
the n power of the eigenvalue, and gives us 2 to the n times b_1. Acting on the power vector, it gives
us the nth power of the eigenvalue times the power vector, plus a second
term, which involves A minus lambda I times the power vector, but that’s just
our first basis element. So, we can write down what x at time
n is, it’s y_1 of 0 times this, plus y_2 of 0 times this, and if you collect
all the b_1 terms, they’re over here, you collect all the b_2 terms, that’s
just gonna be over there, in other words, y_1 at time n is
2 to the n y_1 of time 0, plus a piece that comes from y_2 at
time 0. y_2 at time n, is just 2 to the n times y_2 at time 0.
So, it’s partially decoupled, you can solve for y_2 at the
end by just taking y_2 at the beginning and multiplying by
2 to the n, you don’t need to know about y_1, but to solve
for y_1, you do need to know about y_2, and we can express
this in matrix form. The vector at time n is just this simple matrix,
times the vector at time 0, and this matrix here, is exactly
what you get here when you take this matrix and take it’s nth power,
so it’s not as simple as taking the nth power of a diagonal matrix,
but it’s not so bad, and in addition to exponential terms, you get an
n times exponential term. Okay, so now we put it all together.
In our case, our initial value was (5 2), our change of basis
matrix was the first basis element, the second basis element, it’s
invertable, and the inverse looks pretty similar to the original matrix,
just with a plus instead of a minus, To get y of 0, our up elevator,
we multiply by P_BE, and we get (5 7). To get y at time n, we use
our formula, we multiply through, and we get 5 times 2 to the n
plus 7 n times 2 to the n minus 1, and our second entry is just 7 times
2 to the n. The second entry just gets multiplied by 2 to the n,
the first entry gets multiplied by 2 to the n and picks up a piece
from the second entry, and then you convert back, and we’re done.
A little bit trickier than doing it with diagonalizable, but only
a little bit trickier.