(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 15609, 505] NotebookOptionsPosition[ 13951, 446] NotebookOutlinePosition[ 14289, 461] CellTagsIndexPosition[ 14246, 458] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["\<\ Consider the linear operator T on R^3 with standard matrix\ \>", "Text", CellChangeTimes->{{3.530012170437298*^9, 3.530012189013783*^9}, { 3.530013377509176*^9, 3.530013377717003*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"A", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"5", ",", "0", ",", RowBox[{"-", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"8", ",", "7", ",", RowBox[{"-", "12"}]}], "}"}], ",", RowBox[{"{", RowBox[{"6", ",", "4", ",", RowBox[{"-", "7"}]}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "A", "]"}]}], "Input", CellChangeTimes->{{3.530012192255514*^9, 3.530012236708725*^9}}], Cell["\<\ I compute the characteristic polynomial of A as follows: starting with a \ random vector v, I let v_k = T^k v. If all goes well, {v0,v1,v2} will be a \ basis for R3. I then find the matrix for T relative to this basis, and a \ homework problem from the determinants chapter will allow me to read off the \ characteristic polynomial from the last column of the matrix. \ \>", "Text", CellChangeTimes->{{3.530012295858907*^9, 3.530012496581456*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"v0", " ", "=", " ", RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "2"}], ",", "5"}], "}"}]}], "\[IndentingNewLine]", RowBox[{"v1", " ", "=", " ", RowBox[{"A", ".", "v0"}]}], "\[IndentingNewLine]", RowBox[{"v2", " ", "=", " ", RowBox[{"A", ".", "v1"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Basis", " ", "=", " ", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"v0", ",", "v1", ",", "v2"}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "Basis", "]"}], "\[IndentingNewLine]", RowBox[{"sisaB", " ", "=", " ", RowBox[{"Inverse", "[", "Basis", "]"}]}]}], "Input", CellChangeTimes->{{3.530012500469222*^9, 3.530012630321727*^9}, { 3.530012679262221*^9, 3.530012707164149*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "2"}], ",", "5"}], "}"}]], "Output", CellChangeTimes->{ 3.530012640490806*^9, {3.530012682309571*^9, 3.530012707758705*^9}, 3.530013537440297*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", RowBox[{"-", "66"}], ",", RowBox[{"-", "37"}]}], "}"}]], "Output", CellChangeTimes->{ 3.530012640490806*^9, {3.530012682309571*^9, 3.530012707758705*^9}, 3.530013537444375*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"49", ",", RowBox[{"-", "58"}], ",", RowBox[{"-", "35"}]}], "}"}]], "Output", CellChangeTimes->{ 3.530012640490806*^9, {3.530012682309571*^9, 3.530012707758705*^9}, 3.530013537447206*^9}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", RowBox[{"-", "5"}], "49"}, { RowBox[{"-", "2"}], RowBox[{"-", "66"}], RowBox[{"-", "58"}]}, {"5", RowBox[{"-", "37"}], RowBox[{"-", "35"}]} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.530012640490806*^9, {3.530012682309571*^9, 3.530012707758705*^9}, 3.530013537452914*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ FractionBox["41", "5440"], ",", RowBox[{"-", FractionBox["497", "5440"]}], ",", FractionBox["881", "5440"]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", FractionBox["9", "544"]}], ",", RowBox[{"-", FractionBox["7", "544"]}], ",", RowBox[{"-", FractionBox["1", "544"]}]}], "}"}], ",", RowBox[{"{", RowBox[{ FractionBox["101", "5440"], ",", FractionBox["3", "5440"], ",", RowBox[{"-", FractionBox["19", "5440"]}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{ 3.530012640490806*^9, {3.530012682309571*^9, 3.530012707758705*^9}, 3.530013537459442*^9}] }, Open ]], Cell["\<\ Note that since the inverse of the basis matrix exists (not pretty, I grant \ you) the vectors v0,v1,v2 really do give a basis for R^3. The matrix for my \ operator relative to the new basis by using the change of basis formula:\ \>", "Text", CellChangeTimes->{{3.530012728789205*^9, 3.530012814918582*^9}, { 3.530012845941586*^9, 3.530012857405885*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MatrixForm", "[", RowBox[{"sisaB", ".", "A", ".", "Basis"}], "]"}]], "Input", CellChangeTimes->{{3.530012786421868*^9, 3.530012836427374*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "15"}, {"1", "0", RowBox[{"-", "11"}]}, {"0", "1", "5"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{{3.53001282961821*^9, 3.530012837199015*^9}}] }, Open ]], Cell["\<\ Alternatively (and more easily) one obtains this matrix by observing that \ T(v0) = v1 and T(v1) = v2 so that the first and second columns are the second \ and third standard basis vectors; and the third column is obtained by \ expressing T(v2) = -c0 v0 - -c1 v1 - c2 v2 as a linear combination of v0, \ v1, v2. The coefficients -c0, -c1, -c2 are the entries in the third column \ of the matrix, and our old hwk problem shows us that the characteristic \ polynomial of T is p(t) = t^3 + c2 t^2 + c1 t + c0 (which explains why I put \ the minus signs in front of the coefficients above. That is, I solve\ \>", "Text", CellChangeTimes->{{3.530012864162441*^9, 3.53001318206125*^9}, { 3.530013220941767*^9, 3.530013269394168*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"Basis", ".", RowBox[{"{", RowBox[{ RowBox[{"-", "c0"}], ",", RowBox[{"-", "c1"}], ",", RowBox[{"-", "c2"}]}], "}"}]}], " ", "\[Equal]", " ", RowBox[{"A", ".", "v2"}]}], ",", RowBox[{"{", RowBox[{"c0", ",", "c1", ",", "c2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.530013271141455*^9, 3.530013304290349*^9}, { 3.53001355737918*^9, 3.530013557885413*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"c0", "\[Rule]", RowBox[{"-", "15"}]}], ",", RowBox[{"c1", "\[Rule]", "11"}], ",", RowBox[{"c2", "\[Rule]", RowBox[{"-", "5"}]}]}], "}"}], "}"}]], "Output", CellChangeTimes->{3.530013305211276*^9, 3.530013558955942*^9}] }, Open ]], Cell["\<\ and infer that the characteristic polynomial of T is\ \>", "Text", CellChangeTimes->{{3.530013324398003*^9, 3.530013368860892*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"p", "[", "t_", "]"}], " ", "=", " ", RowBox[{ RowBox[{"t", "^", "3"}], " ", "-", " ", RowBox[{"5", " ", RowBox[{"t", "^", "2"}]}], " ", "+", RowBox[{"11", " ", "t"}], " ", "-", " ", "15"}]}]], "Input", CellChangeTimes->{{3.530013184470093*^9, 3.530013211278853*^9}, 3.530013574145424*^9}], Cell[BoxData[ RowBox[{ RowBox[{"-", "15"}], "+", RowBox[{"11", " ", "t"}], "-", RowBox[{"5", " ", SuperscriptBox["t", "2"]}], "+", SuperscriptBox["t", "3"]}]], "Output", CellChangeTimes->{3.530013213514732*^9, 3.530013575777072*^9}] }, Open ]], Cell[TextData[{ "One can find one root of this polynomial by inspection and then use the \ quadratic formula to get the other two. Alternatively, one can lay the \ burden entirely on ", StyleBox["Mathematica", FontSlant->"Italic"], ":" }], "Text", CellChangeTimes->{{3.530013415176*^9, 3.530013463011124*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{"p", "[", "t", "]"}], "\[Equal]", "0"}], "]"}]], "Input", CellChangeTimes->{{3.530013469539199*^9, 3.530013492119234*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"t", "\[Rule]", RowBox[{"1", "-", RowBox[{"2", " ", "\[ImaginaryI]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", "\[Rule]", RowBox[{"1", "+", RowBox[{"2", " ", "\[ImaginaryI]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", "\[Rule]", "3"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{3.530013493111003*^9, 3.530013577759067*^9}] }, Open ]], Cell["Then I can find eigenvectors", "Text", CellChangeTimes->{{3.530013590670708*^9, 3.530013603827633*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"A", ".", RowBox[{"{", RowBox[{"x1", ",", "x2", ",", "1"}], "}"}]}], "\[Equal]", RowBox[{"3.", RowBox[{"{", RowBox[{"x1", ",", "x2", ",", "1"}], "}"}]}]}], ",", RowBox[{"{", RowBox[{"x1", ",", "x2"}], "}"}]}], "]"}], "\[IndentingNewLine]", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"A", ".", RowBox[{"{", RowBox[{"x1", ",", "x2", ",", "1"}], "}"}]}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{"1", "+", RowBox[{"2", " ", "\[ImaginaryI]"}]}], ")"}], RowBox[{"{", RowBox[{"x1", ",", "x2", ",", "1"}], "}"}]}]}], ",", RowBox[{"{", RowBox[{"x1", ",", "x2"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.530013606259077*^9, 3.530013635755125*^9}, { 3.530013667619496*^9, 3.530013693897767*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"x1", "\[Rule]", "1.`"}], ",", RowBox[{"x2", "\[Rule]", "1.`"}]}], "}"}], "}"}]], "Output", CellChangeTimes->{3.530013636632355*^9, 3.530013694754971*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"x1", "\[Rule]", RowBox[{ FractionBox["2", "5"], "+", FractionBox["\[ImaginaryI]", "5"]}]}], ",", RowBox[{"x2", "\[Rule]", RowBox[{ FractionBox["7", "5"], "+", FractionBox["\[ImaginaryI]", "5"]}]}]}], "}"}], "}"}]], "Output", CellChangeTimes->{3.530013636632355*^9, 3.530013694764511*^9}] }, Open ]], Cell["\<\ So the first eigenvector is (1, 1, 1) and the real and imaginary parts of (5 \ times) the second eigenvector are (2,7,5) and (1,1,0). Using these as a \ basis for R3, I compute a new matrix for T:\ \>", "Text", CellChangeTimes->{{3.530013712327117*^9, 3.530013797718848*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Bas2", " ", "=", " ", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "7", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0"}], "}"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "Bas2", "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.530013801136504*^9, 3.530013833717172*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "2", "1"}, {"1", "7", "1"}, {"1", "5", "0"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{3.530013834252095*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"ABas2", " ", "=", " ", RowBox[{ RowBox[{"Inverse", "[", "Bas2", "]"}], ".", "A", ".", "Bas2"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"MatrixForm", "[", "ABas2", "]"}]}], "Input", CellChangeTimes->{{3.530013844830125*^9, 3.530013872206403*^9}}], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"3", "0", "0"}, {"0", "1", "2"}, {"0", RowBox[{"-", "2"}], "1"} }, GridBoxAlignment->{ "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], "\[NoBreak]", ")"}], Function[BoxForm`e$, MatrixForm[BoxForm`e$]]]], "Output", CellChangeTimes->{{3.530013862489976*^9, 3.53001387312686*^9}}] }, Open ]], Cell["\<\ which is as close as I can come to diagonalizing A using only *real* basis \ vectors\ \>", "Text", CellChangeTimes->{{3.530013883118201*^9, 3.530013928475556*^9}}] }, WindowSize->{740, 867}, WindowMargins->{{147, Automatic}, {Automatic, 29}}, FrontEndVersion->"8.0 for Linux x86 (32-bit) (February 23, 2011)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[557, 20, 197, 4, 30, "Text"], Cell[757, 26, 517, 15, 50, "Input"], Cell[1277, 43, 460, 7, 87, "Text"], Cell[CellGroupData[{ Cell[1762, 54, 780, 19, 126, "Input"], Cell[2545, 75, 219, 6, 30, "Output"], Cell[2767, 83, 259, 8, 30, "Output"], Cell[3029, 93, 241, 7, 30, "Output"], Cell[3273, 102, 871, 27, 71, "Output"], Cell[4147, 131, 735, 25, 47, "Output"] }, Open ]], Cell[4897, 159, 368, 6, 49, "Text"], Cell[CellGroupData[{ Cell[5290, 169, 170, 3, 30, "Input"], Cell[5463, 174, 706, 20, 71, "Output"] }, Open ]], Cell[6184, 197, 744, 11, 125, "Text"], Cell[CellGroupData[{ Cell[6953, 212, 488, 14, 30, "Input"], Cell[7444, 228, 311, 9, 30, "Output"] }, Open ]], Cell[7770, 240, 142, 3, 30, "Text"], Cell[CellGroupData[{ Cell[7937, 247, 347, 9, 30, "Input"], Cell[8287, 258, 249, 7, 30, "Output"] }, Open ]], Cell[8551, 268, 316, 8, 49, "Text"], Cell[CellGroupData[{ Cell[8892, 280, 183, 4, 30, "Input"], Cell[9078, 286, 442, 13, 30, "Output"] }, Open ]], Cell[9535, 302, 110, 1, 30, "Text"], Cell[CellGroupData[{ Cell[9670, 307, 888, 27, 50, "Input"], Cell[10561, 336, 229, 6, 30, "Output"], Cell[10793, 344, 401, 12, 48, "Output"] }, Open ]], Cell[11209, 359, 287, 5, 49, "Text"], Cell[CellGroupData[{ Cell[11521, 368, 534, 14, 69, "Input"], Cell[12058, 384, 659, 19, 71, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[12754, 408, 296, 7, 50, "Input"], Cell[13053, 417, 704, 20, 71, "Output"] }, Open ]], Cell[13772, 440, 175, 4, 30, "Text"] } ] *) (* End of internal cache information *)