In Mathematica a matrix is written as a list of rows. For example  {{a,b},{c,d}}. The outside curly brackets tell us that inside is a list of rows. The entries of each row are enclosed in curly brackets. Once again {a,b} is the first row, {c,d} is the second row. I enclose these two rows together to form a matrix  {{a,b},{c,d}}.

To calculate with matrices we need to enter a matrix in an input cell. The cell that you are reading is a text cell. The cell below is an input cell. I will write a matrix in the input cell below. I will call that matrix mA

Below is an input cell. To evaluate it, place the cursor in the cell with the matrix and press Shift+Enter. Do this in all input cells to evaluate them.

mA={{1,2},{3,4}}

To see a matrix in a traditional form, like in a book we use the command MatrixForm[], see below:

MatrixForm[mA]

Now I can calculate the determinant:

Det[mA]

I can calculate the characteristic polynomial. I have to tell the command a matrix and a variable:

CharacteristicPolynomial[mA,x]

I can calculate the eigenvalues

Eigenvalues[mA]

To see both, eigenvalues and eigenvectors we use the command Eigensystem[]

Eigensystem[mA]

The logic of the above command. The first two numbers are the eigenvalues. Notice that the eigenvalues are in a list. In the second list are the corresponding eigenvectors. I will verify by copy-paste the values obtained from Mathematica. The value below should be the zero vector:

mA.{(1/6) (-3+(Sqrt[33])),1}-(1/2) (5+(Sqrt[33])){(1/6) (-3+(Sqrt[33])),1}

The value above is zero, but we need to tell Mathematica to fully simplify

FullSimplify[mA.{(1/6) (-3+(Sqrt[33])),1}-(1/2) (5+(Sqrt[33])){(1/6) (-3+(Sqrt[33])),1}]

Next I will work with the matrix M that we worked with on Friday, February 2, 2024.

MatrixForm[mM={{1,3,9,27},{1,2,4,8},{1,1,1,1},{1,0,0,0}}]

Now I verify the inverse that we calculated on Friday, February 2, 2024.

MatrixForm[Inverse[mM]]

Let us calculate the eigenvalues.

Eigenvalues[mM]

This is a sign that the formulas for eigenvalues are complicated. Therefore we have to work with numerical approximations. Here they are

N[Eigenvalues[mM]]

But we need the eigenvectors as well. So, we use Eigensystem[] with N[] which gives numerical values:

N[Eigensystem[mM]]

It is interesting to notice that Mathematica decided to chose the eigenvectors whose fourth entry is equal to 1. Since the eigenvalues are distinct, and since it is universal fact that the eigenvectors corresponding to distinct eigenvectors are linearly independent, the eigenvectors form a basis. Eigenvectors with the fourth the fourth entry equal to 1 are, in this case, unique.

CharacteristicPolynomial[mM,λ]

Just to visualize the characteristic polynomial.

Plot[12+50 λ-38 (λ^2)-4 (λ^3)+(λ^4),{λ,-7,9},PlotRange->{-200,200}]

Now I will name the eigenvalues and the eigenvectors calculated in Mathematica. The name that I choose is esapp.

esapp=N[Eigensystem[mM]]

To get eigenvalues we write

esapp[[1]]

To get the first eigenvalue

esapp[[1,1]]

the second eigenvalue

esapp[[1,2]]

and so one ...

To get the first eigenvector

esapp[[2,1]]

To get the first entry of the first eigenvector

esapp[[2,1,1]]

Let us verify whether eigenvectors and eigenvectors are correct. Below I am verifying the following identity

Matrix (apply to) eigenvector - eigenvalue (scale) eigenvector = zero vector

mM.esapp[[2,1]]-esapp[[1,1]]esapp[[2,1]]

This is practically the zero vector. Checking the other eigenvalues and eigenvectors:

mM.esapp[[2,2]]-esapp[[1,2]]esapp[[2,2]]

This is practically the zero vector.

mM.esapp[[2,3]]-esapp[[1,3]]esapp[[2,3]]

This is practically the zero vector.

mM.esapp[[2,4]]-esapp[[1,4]]esapp[[2,4]]

This is practically the zero vector.

On the webpage, I used approximation with only two decimal places. I call those esappw.

esappw={{7.96,-5.16,1.41,-0.21},{{7.96,3.92,1.85,1.},{-5.16,-0.85,0.81,1.},{1.41,-3.17,-1.88,1.},{-0.21,4.68,-4.53,1.}}}

Now verify the polynomial identity. I will call the polynomial corresponding to the first eigenvector by pp1

pp1[x_]=7.96 +3.92 x+1.85 (x^2)+1 (x^3)

This is our transformation T pp1

pp1[3]+pp1[2]x+ pp1[1](x^2)+pp1[0](x^3)

We need to verify (T pp1)[x] = λ1 pp1[x]. So I verify (T pp1)[x] - λ1 pp1[x] = 0

Simplify[(pp1[3]+pp1[2]x+ pp1[1](x^2)+pp1[0](x^3))-(7.96)pp1[x]]

This is close to zero. Since we used only two decimal values in approximation we must be happy with it.

Let us check the second eigenvector and eigenvalue

pp2[x_]=-5.16-0.85 x+0.81 (x^2)+1(x^3)

This is our transformation T pp2

pp2[3]+pp2[2]x+ pp2[1](x^2)+pp2[0](x^3)

We need to verify (T pp2)[x] = λ2 pp2[x]. So I verify (T pp2)[x] - λ2 pp2[x] = 0

Simplify[(pp2[3]+pp2[2]x+ pp2[1](x^2)+pp2[0](x^3))-(-5.16)pp2[x]]

To get closer to the zero polynomial we need to use better approximations. Those approximations in esapp. The numbers in those approximations have many decimal places, so I will use their names that come from esapp. I call the first polynomial pp1b, like the first better polynomial:

pp1b[x_]:=esapp[[2,1,1]]+esapp[[2,1,2]] x+esapp[[2,1,3]] (x^2)+1 (x^3)

This is our transformation T pp1b

pp1b[3]+pp1b[2]x+ pp1b[1](x^2)+pp1b[0](x^3)

We need to verify (T pp1b)[x] = λ1 pp1b[x]. So I verify (T pp1b)[x] - λ1 pp1b[x] = 0

Simplify[(pp1b[3]+pp1b[2]x+ pp1b[1](x^2)+pp1b[0](x^3))-(esapp[[1,1]])pp1b[x]]

Much, much better.

Try the second polynomial

pp2b[x_]:=esapp[[2,2,1]]+esapp[[2,2,2]] x+esapp[[2,2,3]] (x^2)+1 (x^3)

This is our transformation T pp2b

pp2b[3]+pp2b[2]x+ pp2b[1](x^2)+pp2b[0](x^3)

We need to verify (T pp2b)[x] = λ2 pp2b[x]. So I verify (T pp2b)[x] - λ2 pp1b[x] = 0

Simplify[(pp2b[3]+pp2b[2]x+ pp2b[1](x^2)+pp2b[0](x^3))-(esapp[[1,2]])pp2b[x]]

Much, much better!

Try the third polynomial

pp3b[x_]:=esapp[[2,3,1]]+esapp[[2,3,2]] x+esapp[[2,3,3]] (x^2)+1 (x^3)

This is our transformation T pp3b

pp3b[3]+pp3b[2]x+ pp3b[1](x^2)+pp3b[0](x^3)

We need to verify (T pp2b)[x] = λ2 pp2b[x]. So I verify (T pp2b)[x] - λ2 pp2b[x] = 0

Simplify[(pp3b[3]+pp3b[2]x+ pp3b[1](x^2)+pp3b[0](x^3))-(esapp[[1,3]])pp3b[x]]

Much, much better!

Try the fourth polynomial

pp4b[x_]:=esapp[[2,4,1]]+esapp[[2,4,2]] x+esapp[[2,4,3]] (x^2)+1 (x^3)

This is our transformation T pp4b

pp4b[3]+pp4b[2]x+ pp4b[1](x^2)+pp4b[0](x^3)

We need to verify (T pp4b)[x] = λ4 pp4b[x]. So I verify (T pp4b)[x] - λ4 pp4b[x] = 0

Simplify[(pp4b[3]+pp4b[2]x+ pp4b[1](x^2)+pp4b[0](x^3))-(esapp[[1,4]])pp4b[x]]

Much, much better!