(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; automaticGrouping; currentKernel; ] :[font = input; initialization; preserveAspect] *) $Post:=If[MatrixQ[#],MatrixForm[#],#]& <r}; CM=r Id[3]-M (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1 + r, -2, -3}, {-2, -2 + r, -3}, {-3, -3, -3 + r}}] ;[o] -1 + r -2 -3 -2 -2 + r -3 -3 -3 -3 + r :[font = input; initialization; preserveAspect; startGroup] *) CM[[1]]=CM[[1]]/CM[[1,1]]; CM (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, -2/(-1 + r), -3/(-1 + r)}, {-2, -2 + r, -3}, {-3, -3, -3 + r}}] ;[o] -2 -3 ------ ------ 1 -1 + r -1 + r -2 -2 + r -3 -3 -3 -3 + r :[font = input; initialization; preserveAspect; startGroup] *) CM[[2]]=CM[[2]]+2CM[[1]]; CM[[3]]=CM[[3]]+3CM[[1]]; CM=CM//Together (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, -2/(-1 + r), -3/(-1 + r)}, {0, (-2 - 3*r + r^2)/(-1 + r), (-3*(1 + r))/(-1 + r)}, {0, (-3*(1 + r))/(-1 + r), (-6 - 4*r + r^2)/(-1 + r)}}] ;[o] -2 -3 ------ ------ 1 -1 + r -1 + r 2 -2 - 3 r + r -3 (1 + r) ------------- ---------- 0 -1 + r -1 + r 2 -3 (1 + r) -6 - 4 r + r ---------- ------------- 0 -1 + r -1 + r :[font = input; initialization; preserveAspect; startGroup] *) CM[[2]]=CM[[2]]/CM[[2,2]]; CM=CM//Together (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, -2/(-1 + r), -3/(-1 + r)}, {0, 1, (-3*(1 + r))/(-2 - 3*r + r^2)}, {0, (-3*(1 + r))/(-1 + r), (-6 - 4*r + r^2)/(-1 + r)}}] ;[o] -2 -3 ------ ------ 1 -1 + r -1 + r -3 (1 + r) ------------- 2 0 1 -2 - 3 r + r 2 -3 (1 + r) -6 - 4 r + r ---------- ------------- 0 -1 + r -1 + r :[font = input; initialization; preserveAspect; startGroup] *) CM[[3]]=CM[[3]]-CM[[3,2]]CM[[2]]; CM[[1]]=CM[[1]]-CM[[1,2]]CM[[2]]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, (-3*r)/(-2 - 3*r + r^2)}, {0, 1, (-3*(1 + r))/(-2 - 3*r + r^2)}, {0, 0, (-3 - 11*r - 6*r^2 + r^3)/(-2 - 3*r + r^2)}}] ;[o] -3 r ------------- 2 1 0 -2 - 3 r + r -3 (1 + r) ------------- 2 0 1 -2 - 3 r + r 2 3 -3 - 11 r - 6 r + r --------------------- 2 0 0 -2 - 3 r + r :[font = input; initialization; preserveAspect; startGroup] *) CM[[3,3]]=0; CM (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 0, (-3*r)/(-2 - 3*r + r^2)}, {0, 1, (-3*(1 + r))/(-2 - 3*r + r^2)}, {0, 0, 0}}] ;[o] -3 r ------------- 2 1 0 -2 - 3 r + r -3 (1 + r) ------------- 2 0 1 -2 - 3 r + r 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) NullSpace[CM] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{(3*r)/(-2 - 3*r + r^2), (3*(1 + r))/(-2 - 3*r + r^2), 1}}] ;[o] 3 r 3 (1 + r) ------------- ------------- 2 2 -2 - 3 r + r -2 - 3 r + r 1 :[font = input; initialization; preserveAspect] *) lambda=Solve[p==0,x]; (* :[font = input; initialization; preserveAspect] *) Do[r[i]=lambda[[i,1,2]],{i,1,3}] (* :[font = input; initialization; preserveAspect] *) Do[ES[i]=%%%/.{r->r[i]},{i,1,3}] (* :[font = input; initialization; preserveAspect] *) P=Transpose[Join[ES[1],ES[2],ES[3]]]; (* :[font = input; initialization; preserveAspect; startGroup] *) NullSpace[r Id[3]-M,ZeroTest->(PolynomialMod[#,q]==0&)] \ //Together (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{(-3 - 5*r + r^2)/(3*r), (3 + 2*r)/(3*r), 1}}] ;[o] 2 -3 - 5 r + r 3 + 2 r ------------- ------- 3 r 3 r 1 :[font = input; initialization; preserveAspect] *) In order not to repeat parts of the exercise, the equivalence of the above result with NullSpace[CM] will be shown at the end of the next exercise. (* :[font = input; initialization; preserveAspect; startGroup] *) NS=% (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{(-3 - 5*r + r^2)/(3*r), (3 + 2*r)/(3*r), 1}}] ;[o] 2 -3 - 5 r + r 3 + 2 r ------------- ------- 3 r 3 r 1 :[font = input; initialization; preserveAspect] *) Exercise 3.3.2 (* :[font = input; initialization; preserveAspect; startGroup] *) P=N[P]; Unprotect[D]; D=Inverse[P].M.P; D1[n_]:=Table[If[Abs[Re[D[[i,j]]]]<=0.000001, \ I Im[D[[i,j]]],D[[i,j]]],{i,n},{j,n}] Diag[n_]:=Table[If[Abs[Im[D1[n][[i,j]]]]<=0.000001, \ Re[D1[n][[i,j]]],D1[n][[i,j]]],{i,n},{j,n}] Diag[3] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{7.516538485191787522, 0, 0}, {0, -1.177616778714116014, 0}, {0, 0, -0.3389217064776715073}}] ;[o] 7.51654 0 0 0 -1.17762 0 0 0 -0.338922 :[font = input; initialization; preserveAspect] *) Equivalence from previous exercise: (* :[font = input; initialization; preserveAspect; startGroup] *) Do[ES[i]=NS/.{r->r[i]},{i,1,3}] P=Transpose[Join[ES[1],ES[2],ES[3]]]; P=N[P]; D=Inverse[P].M.P; Diag[3] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{7.516538485191787521, 0, 0}, {0, -1.177616778714116014, 0}, {0, 0, -0.3389217064776715073}}] ;[o] 7.51654 0 0 0 -1.17762 0 0 0 -0.338922 :[font = input; initialization; preserveAspect] *) Exercise 3.3.3 (* :[font = input; initialization; preserveAspect; startGroup] *) M=Array[Max,{4,4}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 3, 4}, {2, 2, 3, 4}, {3, 3, 3, 4}, {4, 4, 4, 4}}] ;[o] 1 2 3 4 2 2 3 4 3 3 3 4 4 4 4 4 :[font = input; initialization; preserveAspect; startGroup] *) x IdentityMatrix[4]-M (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1 + x, -2, -3, -4}, {-2, -2 + x, -3, -4}, {-3, -3, -3 + x, -4}, {-4, -4, -4, -4 + x}}] ;[o] -1 + x -2 -3 -4 -2 -2 + x -3 -4 -3 -3 -3 + x -4 -4 -4 -4 -4 + x :[font = input; initialization; preserveAspect; startGroup] *) CM=Join[RowReduce[Array[%[[#]]&,3]],{{0,0,0,0}}]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, 0, (-4*x^2)/(-3 - 11*x - 6*x^2 + x^3)}, {0, 1, 0, (-4*(x + x^2))/(-3 - 11*x - 6*x^2 + x^3)}, {0, 0, 1, (-4*(1 + 3*x + x^2))/ (-3 - 11*x - 6*x^2 + x^3)}, {0, 0, 0, 0}}] ;[o] 2 -4 x --------------------- 2 3 1 0 0 -3 - 11 x - 6 x + x 2 -4 (x + x ) --------------------- 2 3 0 1 0 -3 - 11 x - 6 x + x 2 -4 (1 + 3 x + x ) --------------------- 2 3 0 0 1 -3 - 11 x - 6 x + x 0 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) Clear[r]; p=Det[r IdentityMatrix[4]-M] (* :[font = output; output; inactive; preserveAspect; endGroup] -4 - 23*r - 35*r^2 - 10*r^3 + r^4 ;[o] 2 3 4 -4 - 23 r - 35 r - 10 r + r :[font = input; initialization; preserveAspect; startGroup] *) Solve[p==0,r]; r=r/.%; P=Transpose[Table[NullSpace[CM][[1]]/.{x->r[[i]]//N},{i,4}]//N]//Re (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1.174018626437017946, 1.132327326223258363, -1.126230617252018513, 0.6679219174657781049}, {-0.6021957184026057897, -1.067892654641997108, 2.700236934218879539, 0.7198514388257233394}, {0.262935403955374566, -1.193095366428914725, -2.647587929910311594, 0.8277478923838517618}, {1., 1., 1., 1.}}] ;[o] -1.17402 1.13233 -1.12623 0.667922 -0.602196 -1.06789 2.70024 0.719851 0.262935 -1.1931 -2.64759 0.827748 1. 1. 1. 1. :[font = input; initialization; preserveAspect] *) Although it is not specified in the exercises, we will use floating point representations in this chapter, since exact calculations here would overflow the capacity of personal computers at the present time. (* :[font = input; initialization; preserveAspect; startGroup] *) D=Inverse[P].M.P; Diag[4] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-2.053115763536996677, 0, 0, 0}, {0, -0.5146427793906138797, 0, 0}, {0, 0, -0.2943264517738022657, 0}, {0, 0, 0, 12.86208499470141282}}] ;[o] -2.05312 0 0 0 0 -0.514643 0 0 0 0 -0.294326 0 0 0 0 12.8621 :[font = input; initialization; preserveAspect] *) Exercise 3.3.4 (* :[font = input; initialization; preserveAspect; startGroup] *) M=Array[Min,{4,4}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 1, 1, 1}, {1, 2, 2, 2}, {1, 2, 3, 3}, {1, 2, 3, 4}}] ;[o] 1 1 1 1 1 2 2 2 1 2 3 3 1 2 3 4 :[font = input; initialization; preserveAspect; startGroup] *) x IdentityMatrix[4]-M (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1 + x, -1, -1, -1}, {-1, -2 + x, -2, -2}, {-1, -2, -3 + x, -3}, {-1, -2, -3, -4 + x}}] ;[o] -1 + x -1 -1 -1 -1 -2 + x -2 -2 -1 -2 -3 + x -3 -1 -2 -3 -4 + x :[font = input; initialization; preserveAspect; startGroup] *) CM=Join[RowReduce[Array[%[[#]]&,3]],{{0,0,0,0}}]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, 0, -(x^2/(-1 + 5*x - 6*x^2 + x^3))}, {0, 1, 0, (x - 2*x^2)/(-1 + 5*x - 6*x^2 + x^3)}, {0, 0, 1, (-1 + 4*x - 3*x^2)/(-1 + 5*x - 6*x^2 + x^3)}, {0, 0, 0, 0}}] ;[o] 2 x -(--------------------) 2 3 1 0 0 -1 + 5 x - 6 x + x 2 x - 2 x -------------------- 2 3 0 1 0 -1 + 5 x - 6 x + x 2 -1 + 4 x - 3 x -------------------- 2 3 0 0 1 -1 + 5 x - 6 x + x 0 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) Clear[r]; p=Det[r IdentityMatrix[4]-M] (* :[font = output; output; inactive; preserveAspect; endGroup] 1 - 7*r + 15*r^2 - 10*r^3 + r^4 ;[o] 2 3 4 1 - 7 r + 15 r - 10 r + r :[font = input; initialization; preserveAspect; startGroup] *) Solve[p==0,r]; r=r/.%; P=Transpose[Table[NullSpace[CM][[1]]/.{x->r[[i]]//N},{i,4}]//N]//Re (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1., 0.3472963553338606977, -1.879385241571816773, 1.53208888623795607}, {-1., 0.6527036446661393023, 2.879385241571816774, -0.5320888862379560712}, {0., 0.8793852415718167681, -2.532088886237956071, -1.347296355333860697}, {1., 1., 1., 1.}}] ;[o] -1. 0.347296 -1.87939 1.53209 -1. 0.652704 2.87939 -0.532089 0. 0.879385 -2.53209 -1.3473 1. 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) Inverse[P].M.P; Diag[4] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-2.053115763536996677, 0, 0, 0}, {0, -0.5146427793906138797, 0, 0}, {0, 0, -0.2943264517738022657, 0}, {0, 0, 0, 12.86208499470141282}}] ;[o] -2.05312 0 0 0 0 -0.514643 0 0 0 0 -0.294326 0 0 0 0 12.8621 :[font = input; initialization; preserveAspect] *) Exercise 3.3.5 (* :[font = input; initialization; preserveAspect; startGroup] *) M=Array[Max,{5,5}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 3, 4, 5}, {2, 2, 3, 4, 5}, {3, 3, 3, 4, 5}, {4, 4, 4, 4, 5}, {5, 5, 5, 5, 5}}] ;[o] 1 2 3 4 5 2 2 3 4 5 3 3 3 4 5 4 4 4 4 5 5 5 5 5 5 :[font = input; initialization; preserveAspect; startGroup] *) x IdentityMatrix[5]-M (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1 + x, -2, -3, -4, -5}, {-2, -2 + x, -3, -4, -5}, {-3, -3, -3 + x, -4, -5}, {-4, -4, -4, -4 + x, -5}, {-5, -5, -5, -5, -5 + x}}] ;[o] -1 + x -2 -3 -4 -5 -2 -2 + x -3 -4 -5 -3 -3 -3 + x -4 -5 -4 -4 -4 -4 + x -5 -5 -5 -5 -5 -5 + x :[font = input; initialization; preserveAspect; startGroup] *) CM=Join[RowReduce[Array[%[[#]]&,4]],{{0,0,0,0,0}}]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, 0, 0, (-5*x^3)/ (-4 - 23*x - 35*x^2 - 10*x^3 + x^4)}, {0, 1, 0, 0, (-5*(x^2 + x^3))/ (-4 - 23*x - 35*x^2 - 10*x^3 + x^4)}, {0, 0, 1, 0, (-5*(x + 3*x^2 + x^3))/ (-4 - 23*x - 35*x^2 - 10*x^3 + x^4)}, {0, 0, 0, 1, (-5*(1 + 5*x + 6*x^2 + x^3))/ (-4 - 23*x - 35*x^2 - 10*x^3 + x^4)}, {0, 0, 0, 0, 0}}] ;[o] 3 -5 x ------------------------------ 2 3 4 1 0 0 0 -4 - 23 x - 35 x - 10 x + x 2 3 -5 (x + x ) ------------------------------ 2 3 4 0 1 0 0 -4 - 23 x - 35 x - 10 x + x 2 3 -5 (x + 3 x + x ) ------------------------------ 2 3 4 0 0 1 0 -4 - 23 x - 35 x - 10 x + x 2 3 -5 (1 + 5 x + 6 x + x ) ------------------------------ 2 3 4 0 0 0 1 -4 - 23 x - 35 x - 10 x + x 0 0 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) Clear[r] p=Det[r IdentityMatrix[5]-M] (* :[font = output; output; inactive; preserveAspect; endGroup] -5 - 39*r - 98*r^2 - 85*r^3 - 15*r^4 + r^5 ;[o] 2 3 4 5 -5 - 39 r - 98 r - 85 r - 15 r + r :[font = input; initialization; preserveAspect; startGroup] *) NSolve[p==0,r]; r=r/.%; P=Transpose[Table[NullSpace[CM][[1]]/.{x->r[[i]]//N},{i,5}]//N]//Re; P//Together//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{-1.152130131983863609, 1.109051588148310365, -1.102464924693090638, 1.100489567734286696, 0.6450539007943571859}, {-0.7904047325882884809, -0.3699093956738938238, 1.75571471841964394, -2.873369373142965157, 0.6779687829855035194}, {-0.1805220637640063452, -1.355582628414694461, 0.06214132621707466106, 3.528485285351223587, 0.7454780806104025686}, {0.4860377232103835421, -0.5335366899311692582, -1.792535670836337992, -2.810991923402531029, 0.8510265609596547179}, {1., 1., 1., 1., 1.}}] ;[o] -1.15213 1.10905 -1.10246 1.10049 0.645054 -0.790405 -0.369909 1.75571 -2.87337 0.677969 -0.180522 -1.35558 0.0621413 3.52849 0.745478 0.486038 -0.533537 -1.79254 -2.81099 0.851027 1. 1. 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) D=Inverse[P].M.P; Diag[5] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-3.185096025628874463, 0, 0, 0, 0}, {0, -0.749885629357235896, 0, 0, 0}, {0, 0, -0.3857227544635501227, 0, 0}, {0, 0, 0, -0.2769322172999294724, 0}, {0, 0, 0, 0, 19.59763662674958996}}] ;[o] -3.1851 0 0 0 0 0 -0.749886 0 0 0 0 0 -0.385723 0 0 0 0 0 -0.276932 0 0 0 0 0 19.5976 :[font = input; initialization; preserveAspect] *) Exercise 3.3.6 (* :[font = input; initialization; preserveAspect; startGroup] *) M=Table[If[i>3,If[j>3,Min[i,j],0],If[j>3,0,Max[i,j]]], \ {i,6},{j,6}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 3, 0, 0, 0}, {2, 2, 3, 0, 0, 0}, {3, 3, 3, 0, 0, 0}, {0, 0, 0, 4, 4, 4}, {0, 0, 0, 4, 5, 5}, {0, 0, 0, 4, 5, 6}}] ;[o] 1 2 3 0 0 0 2 2 3 0 0 0 3 3 3 0 0 0 0 0 0 4 4 4 0 0 0 4 5 5 0 0 0 4 5 6 :[font = input; initialization; preserveAspect] *) Trying to solve for the 6*6 matrix as a whole, we fail. However, we notice that by finding diagonalizing matrices for the upper left and the lower right corner of M we can then construct the diagonalizing matrix of M by the same pattern M was constructed. (* :[font = input; initialization; preserveAspect; startGroup] *) M1=SubMatrix[M,{1,1},{3,3}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{1, 2, 3}, {2, 2, 3}, {3, 3, 3}}] ;[o] 1 2 3 2 2 3 3 3 3 :[font = input; initialization; preserveAspect; startGroup] *) M2=SubMatrix[M,{4,4},{3,3}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{4, 4, 4}, {4, 5, 5}, {4, 5, 6}}] ;[o] 4 4 4 4 5 5 4 5 6 :[font = input; initialization; preserveAspect; startGroup] *) x Id[3]-M1 (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-1 + x, -2, -3}, {-2, -2 + x, -3}, {-3, -3, -3 + x}}] ;[o] -1 + x -2 -3 -2 -2 + x -3 -3 -3 -3 + x :[font = input; initialization; preserveAspect; startGroup] *) CM=Join[RowReduce[Array[%[[#]]&,2]],{{0,0,0}}]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, (-3*x)/(-2 - 3*x + x^2)}, {0, 1, (-3*(1 + x))/(-2 - 3*x + x^2)}, {0, 0, 0}}] ;[o] -3 x ------------- 2 1 0 -2 - 3 x + x -3 (1 + x) ------------- 2 0 1 -2 - 3 x + x 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) Clear[r] p=Det[r Id[3]-M1] (* :[font = output; output; inactive; preserveAspect; endGroup] -3 - 11*r - 6*r^2 + r^3 ;[o] 2 3 -3 - 11 r - 6 r + r :[font = input; initialization; preserveAspect; startGroup] *) Solve[p==0,r]; r=r/.% (* :[font = output; output; inactive; preserveAspect; endGroup] {2 + (23*2^(1/3))/(1107 + 3*I*9843^(1/2))^(1/3) + (1107 + 3*I*9843^(1/2))^(1/3)/(3*2^(1/3)), 2 - (23*(1 + I*3^(1/2)))/ (2^(2/3)*(1107 + 3*I*9843^(1/2))^(1/3)) - ((1 - I*3^(1/2))*(1107 + 3*I*9843^(1/2))^(1/3))/ (6*2^(1/3)), 2 - (23*(1 - I*3^(1/2)))/ (2^(2/3)*(1107 + 3*I*9843^(1/2))^(1/3)) - ((1 + I*3^(1/2))*(1107 + 3*I*9843^(1/2))^(1/3))/ (6*2^(1/3))} ;[o] 1/3 23 2 {2 + -------------------------- + 1/3 (1107 + 3 I Sqrt[9843]) 1/3 (1107 + 3 I Sqrt[9843]) --------------------------, 1/3 3 2 23 (1 + I Sqrt[3]) 2 - ------------------------------- - 2/3 1/3 2 (1107 + 3 I Sqrt[9843]) 1/3 (1 - I Sqrt[3]) (1107 + 3 I Sqrt[9843]) ------------------------------------------, 1/3 6 2 23 (1 - I Sqrt[3]) 2 - ------------------------------- - 2/3 1/3 2 (1107 + 3 I Sqrt[9843]) 1/3 (1 + I Sqrt[3]) (1107 + 3 I Sqrt[9843]) ------------------------------------------} 1/3 6 2 :[font = input; initialization; preserveAspect; startGroup] *) P=Transpose[Table[NullSpace[CM][[1]]/.{x->r[[i]]//N},{i,3}]//N]//Re (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0.7058061989910869513, -1.210032909502607794, 1.170893377178187511}, {0.7997066294061755558, -0.1825060167354308772, -2.283867279337411347}, {1., 1., 1.}}] ;[o] 0.705806 -1.21003 1.17089 0.799707 -0.182506 -2.28387 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) D=Inverse[P].M1.P; Diag[3] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{7.516538485191787522, 0, 0}, {0, -1.177616778714116014, 0}, {0, 0, -0.3389217064776715072}}] ;[o] 7.51654 0 0 0 -1.17762 0 0 0 -0.338922 :[font = input; initialization; preserveAspect; startGroup] *) P1=P (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0.7058061989910869513, -1.210032909502607794, 1.170893377178187511}, {0.7997066294061755558, -0.1825060167354308772, -2.283867279337411347}, {1., 1., 1.}}] ;[o] 0.705806 -1.21003 1.17089 0.799707 -0.182506 -2.28387 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) x Id[3]-M2 (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{-4 + x, -4, -4}, {-4, -5 + x, -5}, {-4, -5, -6 + x}}] ;[o] -4 + x -4 -4 -4 -5 + x -5 -4 -5 -6 + x :[font = input; initialization; preserveAspect; startGroup] *) CM=Join[RowReduce[Array[%[[#]]&,2]],{{0,0,0}}]; CM=CM//Together; CM//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{1, 0, (-4*x)/(4 - 9*x + x^2)}, {0, 1, (4 - 5*x)/(4 - 9*x + x^2)}, {0, 0, 0}}] ;[o] -4 x ------------ 2 1 0 4 - 9 x + x 4 - 5 x ------------ 2 0 1 4 - 9 x + x 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) Clear[r] p=Det[r Id[3]-M2] (* :[font = output; output; inactive; preserveAspect; endGroup] -4 + 17*r - 15*r^2 + r^3 ;[o] 2 3 -4 + 17 r - 15 r + r :[font = input; initialization; preserveAspect; startGroup] *) Solve[p==0,r]; r=r/.% (* :[font = output; output; inactive; preserveAspect; endGroup] {5 + (58*2^(1/3))/(4563 + 3*I*27903^(1/2))^(1/3) + (4563 + 3*I*27903^(1/2))^(1/3)/(3*2^(1/3)), 5 - (29*2^(1/3)*(1 + I*3^(1/2)))/ (4563 + 3*I*27903^(1/2))^(1/3) - ((1 - I*3^(1/2))*(4563 + 3*I*27903^(1/2))^(1/3))/ (6*2^(1/3)), 5 - (29*2^(1/3)*(1 - I*3^(1/2)))/ (4563 + 3*I*27903^(1/2))^(1/3) - ((1 + I*3^(1/2))*(4563 + 3*I*27903^(1/2))^(1/3))/ (6*2^(1/3))} ;[o] 1/3 58 2 {5 + --------------------------- + 1/3 (4563 + 3 I Sqrt[27903]) 1/3 (4563 + 3 I Sqrt[27903]) ---------------------------, 1/3 3 2 1/3 29 2 (1 + I Sqrt[3]) 5 - --------------------------- - 1/3 (4563 + 3 I Sqrt[27903]) 1/3 (1 - I Sqrt[3]) (4563 + 3 I Sqrt[27903]) -------------------------------------------, 1/3 6 2 1/3 29 2 (1 - I Sqrt[3]) 5 - --------------------------- - 1/3 (4563 + 3 I Sqrt[27903]) 1/3 (1 + I Sqrt[3]) (4563 + 3 I Sqrt[27903]) -------------------------------------------} 1/3 6 2 :[font = input; initialization; preserveAspect; startGroup] *) P=Transpose[Table[NullSpace[CM][[1]]/.{x->r[[i]]//N},{i,3}]//N]//Re (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0.7876810238413977099, 1.139220666558505532, -1.114401690399903244}, {0.9274736508396215261, -2.045710408374901746, -0.1317632424647197777}, {1., 1., 1.}}] ;[o] 0.787681 1.13922 -1.1144 0.927474 -2.04571 -0.131763 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) D=Inverse[P].M2.P; Diag[3] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{13.78809234956369847, 0, 0}, {0, 0.328330624359513393, 0}, {0, 0, 0.8835770260767881354}}] ;[o] 13.7881 0 0 0 0.328331 0 0 0 0.883577 :[font = input; initialization; preserveAspect; startGroup] *) P2=P (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0.7876810238413977099, 1.139220666558505532, -1.114401690399903244}, {0.9274736508396215261, -2.045710408374901746, -0.1317632424647197777}, {1., 1., 1.}}] ;[o] 0.787681 1.13922 -1.1144 0.927474 -2.04571 -0.131763 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) ZeroMatrix=Array[0&,{3,3}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}] ;[o] 0 0 0 0 0 0 0 0 0 :[font = input; initialization; preserveAspect; startGroup] *) P=BlockMatrix[{{P1,ZeroMatrix},{ZeroMatrix,P2}}] (* :[font = output; output; inactive; preserveAspect; endGroup] MatrixForm[{{0.7058061989910869513, -1.210032909502607794, 1.170893377178187511, 0, 0, 0}, {0.7997066294061755558, -0.1825060167354308772, -2.283867279337411347, 0, 0, 0}, {1., 1., 1., 0, 0, 0}, {0, 0, 0, 0.7876810238413977099, 1.139220666558505532, -1.114401690399903244}, {0, 0, 0, 0.9274736508396215261, -2.045710408374901746, -0.1317632424647197777}, {0, 0, 0, 1., 1., 1.}}] ;[o] 0.705806 -1.21003 1.17089 0 0 0 0.799707 -0.182506 -2.28387 0 0 0 1. 1. 1. 0 0 0 0 0 0 0.787681 1.13922 -1.1144 0 0 0 0.927474 -2.04571 -0.131763 0 0 0 1. 1. 1. :[font = input; initialization; preserveAspect; startGroup] *) D=Inverse[P].M.P; Diag[6]//TableForm (* :[font = output; output; inactive; preserveAspect; endGroup] TableForm[{{7.516538485191787522, 0, 0, 0, 0, 0}, {0, -1.177616778714116014, 0, 0, 0, 0}, {0, 0, -0.3389217064776715072, 0, 0, 0}, {0, 0, 0, 13.78809234956369847, 0, 0}, {0, 0, 0, 0, 0.328330624359513393, 0}, {0, 0, 0, 0, 0, 0.8835770260767881354}}] ;[o] 7.51654 0 0 0 0 0 0 -1.17762 0 0 0 0 0 0 -0.338922 0 0 0 0 0 0 13.7881 0 0 0 0 0 0 0.328331 0 0 0 0 0 0 0.8835\ 77 ^*)