{VERSION 3 0 "IBM INTEL NT" "3.0" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0
1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0
0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }
{CSTYLE "" -1 256 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257
"" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1
1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }
{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{PSTYLE "Normal"
-1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1
-1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Co
urier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 }1 0 0 -1 -1 -1 0 0 0 0 0 0
-1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1
0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4
1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 0
0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0
255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Err
or" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0
0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE ""
-1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1
0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "
" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1
0 }{PSTYLE "" 3 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1
-1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 3 50 0 0 0 0 -1 0
}{PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
}0 0 0 -1 -1 -1 3 50 0 0 0 0 -1 0 }{PSTYLE "" 0 259 1 {CSTYLE "" -1
-1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 3 50 0 0 0 0 -1 0
}{PSTYLE "" 0 260 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
}0 0 0 -1 -1 -1 3 50 0 0 0 0 -1 0 }{PSTYLE "R3 Font 4" -1 261 1
{CSTYLE "" -1 -1 "Times" 0 20 0 0 0 0 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1
-1 0 0 0 0 0 0 0 0 }{PSTYLE "R3 Font 5" -1 262 1 {CSTYLE "" -1 -1 "Tim
es" 0 17 0 0 0 0 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }
{PSTYLE "R3 Font 3" -1 263 1 {CSTYLE "" -1 -1 "New century schoolbook
" 0 17 0 0 1 0 1 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }}
{SECT 0 {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT -1 59
" Computing Symbolic Eigenvalues and Eigenvectors in Maple V" }}{PARA
19 "" 0 "" {TEXT -1 18 "by Michael Monagan" }}{PARA 257 "" 0 "" {TEXT
256 9 "Abstract:" }{TEXT -1 150 " How to compute exact symbolic values
for eigenvalues and eigenvectors of both numeric and symbolic matrice
s, and computing with roots of polynomials." }}{PARA 259 "" 0 ""
{TEXT 259 28 "Application Areas/Subjects: " }{TEXT 257 0 "" }{TEXT -1
15 " Linear Algebra" }}{PARA 258 "" 0 "" {TEXT 258 9 "Keywords:" }
{TEXT -1 64 " Eigenvalues, eigenvectors, roots, RootOf, roots of poly
nomials" }}{PARA 260 "" 0 "" {TEXT 260 9 "See Also:" }{TEXT -1 23 " Ma
pleTech issue 9 1993" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "
" }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 13 " Introduction" }}{PARA 0 ""
0 "" {TEXT -1 645 "This is a partly a tutorial on how to compute symbo
lic eigenvalues and eigenvectors in Maple V, and partly a collection o
f non-trivial examples to give an indication of the current limits of \+
what can be done. The main difficulty in computing symbolically is in
handling roots of polynomials. Maple V has a facility called evala w
hich computes with roots of polynomials represented using Maple's Root
Of notation which often will yield better results, better in the sens
e that the results will be smaller, hence easier to understand, and al
so more efficiently computed. Some discussion of how to compute with \+
these RootOf values is also given." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }
}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 25 " Using the Linalg Package" }}
{PARA 0 "" 0 "" {TEXT -1 99 " Let's begin by loading the linear algebr
a package, inputting a matrix, and doing some calculations" }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}{PARA 7 "" 1 ""
{TEXT -1 32 "Warning, new definition for norm" }}{PARA 7 "" 1 ""
{TEXT -1 33 "Warning, new definition for trace" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 39 "A := matrix([[1,2,3],[2,3,4],[4,5,6]]);" }}
{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrixG6#7%7%\"\"\"\"\"#\"\"$
7%F+F,\"\"%7%F.\"\"&\"\"'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 269 "The
eigenvalues of A are the roots of the characteristic polynomial which
is the determinant of the matrix lambda I - A, i.e. a polynomial of d
egree n in the variable lambda. This polynomial is called the charact
eristic polynomial. One way of computing it in Maple is" }}{PARA 0 ">
" 0 "" {MPLTEXT 1 0 20 "cp := det(lambda-A);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#>%#cpG,(%'lambdaG!\"**$)F&\"\"#\"\"\"!#5*$)F&\"\"$F+\"
\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 139 "In this case, the charac
terisitc is a cubic polynomial with integer coefficients. We can use \+
Maple's solve function to solve for the roots" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 17 "solve(cp,lambda);" }}{PARA 11 "" 1 "" {XPPMATH
20 "6%\"\"!,&\"\"&\"\"\"*$-%%sqrtG6#\"#M\"\"\"F&,&F%F&F'!\"\"" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 86 "Al
ternatively, we could have done this in one step using the builtin eig
envals command" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "e := eigenvals(A)
;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"eG6%\"\"!,&\"\"&\"\"\"*$-%%sq
rtG6#\"#M\"\"\"F),&F(F)F*!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 440 "Notice, that instead of getting deci
mal approximations for the eigenvalues, which is what a numerical piec
e of software would give, Maple has computed the exact algebraic value
s for the eigenvalues. You can get Maple to compute numerical eigenva
lues and eigenvectors too if you wish. Maple will do this automatical
ly for you if one or more of the inputs entries of the matrix is a dec
imal number. Let's just do this to see the difference" }}{PARA 0 ""
0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "B := map(evalf
,A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"BG-%'matrixG6#7%7%$\"\"\"
\"\"!$\"\"#F,$\"\"$F,7%F-F/$\"\"%F,7%F2$\"\"&F,$\"\"'F," }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "eigenvals(B);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6%$\"+*=&4$3\"!\")$!+[*=&4$)!#5$!+'[%p\")H!#D" }}}{EXCHG
{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 337 "We see \+
immediately one of the difficulties of working numerically. The eigen
value 0 is not quite 0. In this tutorial we are mainly interested in
computing exact formulae for the eigenvalues. Let's continue by comp
uting the eigenvectors for A. They are the solutions to A x = lambda x
, i.e. the nullspace of the matrix lambda I - A." }}{PARA 0 "" 0 ""
{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "nullspace(e[1]-A);
" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<#-%'vectorG6#7%\"\"\"!\"#F(" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "nullspace(e[2]-A);" }}{PARA
11 "" 1 "" {XPPMATH 20 "6#<#-%'vectorG6#7%,&#!\"%\"#6\"\"\"*$-%%sqrtG6
#\"#M\"\"\"#\"\"$\"#A,&#F,F+F,F-F7F," }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 18 "nullspace(e[3]-A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6
#<#-%'vectorG6#7%,&#!\"%\"#6\"\"\"*$-%%sqrtG6#\"#M\"\"\"#!\"$\"#A,&#F,
F+F,F-#!\"\"F+F," }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 170 "It is a little bit tricky to read because Maple d
oes not put enough space between the entries in these vectors. Altern
atively, one can use the builtin eigenvects command" }}{PARA 0 "" 0 "
" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "e := eigenvects(A
,radical);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"eG6%7%\"\"!\"\"\"<#-
%'vectorG6#7%F(!\"#F(7%,&\"\"&F(*$-%%sqrtG6#\"#M\"\"\"F(F(<#-F+6#7%,&#
!\"%\"#6F(F2#\"\"$\"#A,&#F(F?F(F2FDF(7%,&F1F(F2!\"\"F(<#-F+6#7%,&F=F(F
2#!\"$FB,&FDF(F2#FGF?F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 707 "The output consists of a sequence of tri
pples of the form [e, m, b] where e is an eigenvalue, m it's multiplic
ity, and b a basis for the eigenspace for e, a set of vectors in Maple
. We will explain the option `radical' in a moment. Let us now show \+
that the results are correct, and in doing so, show how the user can a
ccess each of the eigenvectors. If x[i] is the eigenvector for the ei
genvalue lambda[i], then x[i] satisfies A x = lambda x. Thus (lambda \+
I - A) x = 0. The matrix lambda I - x is called the characteristic ma
trix. One way to construct it is to use the builtin function charmat(
A,lambda). We'll use Maple directly. We pick off the first eigenvalu
e and it's corresponding eigenvector." }}{PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "e1 := e[1][1]; v1 := e[1][3][1]
; " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#e1G\"\"!" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#>%#v1G-%'vectorG6#7%\"\"\"!\"#F)" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 24 "evalm( (e1 - A) &* v1 );" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#-%'vectorG6#7%\"\"!F'F'" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 153 "So far, so good. Infact
, it all works for matrices containing formulae as well as numbers. F
or example, here is a matrix with 3 parameters, a,b, and c " }}{PARA
0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "T := toep
litz( [a,b,c] );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"TG-%'matrixG6#
7%7%%\"aG%\"bG%\"cG7%F+F*F+7%F,F+F*" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 21 "eigenvals(T,radical);" }}{PARA 11 "" 1 "" {XPPMATH
20 "6%,&%\"aG\"\"\"%\"cG!\"\",(F&#F%\"\"#F$F%*$-%%sqrtG6#,&*$)F&F*\"\"
\"F%*$)%\"bGF*F2\"\")F2F),(F&F)F$F%F+#F'F*" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 27 "e := eigenvects(T,radical);" }}{PARA 12 "" 1 ""
{XPPMATH 20 "6#>%\"eG6%7%,(%\"cG#\"\"\"\"\"#%\"aGF**$-%%sqrtG6#,&*$)F(
F+\"\"\"F**$)%\"bGF+F4\"\")F4F)F*<#-%'vectorG6#7%F*,$*&,&F(F)F-#!\"\"F
+F4F7!\"\"FBF*7%,(F(F)F,F*F-FAF*<#-F;6#7%F*,$*&,&F(F)F-F)F4F7FCFBF*7%,
&F,F*F(FBF*<#-F;6#7%FB\"\"!F*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 102 "A little bit more complicated, but a
ctually, very nice. Let's just check the first eigenvector again." }}
{PARA 0 "" 0 "" {TEXT -1 442 "Things however do get complicated when t
he characteristic polynomial does not factor into linear or quadratic \+
factors. Because then the formulae for the roots of a cubic polynomia
l in general are messy, and a quartic polynomial are even worse. And \+
of course, in general, there is no way to express the roots of a quint
ic or higher degree polynomial in terms of exact radicals. Let's cons
ider a slight change, a purtubation to our A matrix" }}{PARA 0 "> "
0 "" {MPLTEXT 1 0 25 "T[2,1] := T[2,1]+epsilon;" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#>&%\"TG6$\"\"#\"\"\",&%\"bGF(%(epsilonGF(" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "cp := det(lambda-T);" }}{PARA 12 "
" 1 "" {XPPMATH 20 "6#>%#cpG,>*$)%\"aG\"\"$\"\"\"!\"\"*&)F(\"\"#F*%'la
mbdaG\"\"\"F)*&F(F0)F/F.F*!\"$*&F(F*)%\"bGF.F*F.*$)F/F)F*F0*&F/F*F5F*!
\"#*(F6F0%(epsilonGF0F(F*F.*(F6F*F " 0 "" {MPLTEXT 1 0 11 "factor(cp);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#,>*$)%\"aG\"\"$\"\"\"!\"\"*&)F&\"\"#F(%'lambdaG\"\"\"F'
*&F&F.)F-F,F(!\"$*&F&F()%\"bGF,F(F,*$)F-F'F(F.*&F-F(F3F(!\"#*(F4F.%(ep
silonGF.F&F(F,*(F4F(F:F(F-F(F8*&%\"cGF.F3F(F8*&)F:F,F(F&F(F.*&F?F(F-F(
F)*(F:F(F=F(F4F(F8*&)F=F,F(F&F(F.*&FCF(F-F(F)" }}}{EXCHG {PARA 0 "" 0
"" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 171 "We see that the chara
cteristic polynomial does not factor, and consequently, the roots for \+
this cubic polynomial computed by Maple below are ``messy'', and of li
mited use." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "solve(cp,lambda);" }}
{PARA 12 "" 1 "" {XPPMATH 20 "6%,(*$),(*&%\"cG\"\"\")%\"bG\"\"#\"\"\"
\"#F*(%(epsilonGF)F(F-F+F)F.*$-%%sqrtG6#,B*(F*F-)F0F,F-)F(F,F-\"\"**(F
+F-F0F-)F(\"\"%F-!#=*()F+\"\"$F-F0F-F8F-\"#!**(F+F-)F0F@F-F8F-!#O*$)F+
\"\"'F-!#C*$)F0FGF-!\"$*$)F(FGF-FK*&)F+\"\"&F-F0F-!#s*&F+F-)F0FPF-F=*&
F?F-FCF-!#'**&)F+F " 0 ""
{MPLTEXT 1 0 33 "alias( alpha=RootOf(cp,lambda) );" }}{PARA 11 "" 1 "
" {XPPMATH 20 "6$%\"IG%&alphaG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "
" }}{PARA 0 "" 0 "" {TEXT -1 388 "In one sense, we are cheating, we ar
e just doing what every mathematician does whenever he gets an express
ion which is too big to work with, namely, he gives it a label. But i
nfact, we are not cheating, because Maple knows how to compute with al
pha, i.e. how to add, subtract, multiply and divide formulae involving
alpha. It knows that alpha is a root of the characteristic polynomia
l." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "f := 1/(alpha);" }}{PARA 11 "
" 1 "" {XPPMATH 20 "6#>%\"fG*&\"\"\"F&%&alphaG!\"\"" }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 14 "g := evala(f);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#>%\"gG*&,0*$)%&alphaG\"\"#\"\"\"!\"\"*&%\"aG\"\"\"F)F/
\"\"$*$)%\"cGF*F+F/*$)%\"bGF*F+F**$)F.F*F+!\"$*&F6F/%(epsilonGF/F**$)F
;F*F+F/F+,0*&F.F+F5F+F**&F3F/F5F+!\"#*&F=F+F.F+F/*(F6F+F;F+F.F+F**(F;F
+F3F+F6F+FA*&F2F+F.F+F/*$)F.F0F+F,!\"\"" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 11 "evala(1/g);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%&alph
aG" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT
-1 414 "Now when we compute the eigenvectors, Maple is going to comput
e them as a function of alpha. The output will be much simpler than i
t would be if we used the nested radical representation for the roots \+
of the characteristic polynomial. The reader is encouraged to try inst
ead eigenvects(A,radical); to force Maple to compute the eigenvectors \+
in terms of exact radicals to see for himself how much simpler they ar
e." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvects(T);" }}{PARA 12 "
" 1 "" {XPPMATH 20 "6%7%,(*$),(*&%\"cG\"\"\")%\"bG\"\"#\"\"\"\"#F*(%(e
psilonGF*F)F.F,F*F/*$-%%sqrtG6#,B*(F+F.)F1F-F.)F)F-F.\"\"**(F,F.F1F.)F
)\"\"%F.!#=*()F,\"\"$F.F1F.F9F.\"#!**(F,F.)F1FAF.F9F.!#O*$)F,\"\"'F.!#
C*$)F1FHF.!\"$*$)F)FHF.FL*&)F,\"\"&F.F1F.!#s*&F,F.)F1FQF.F>*&F@F.FDF.!
#'**&)F,F=F.F8F.!$3\"*&F+F.)F1F=F.!#a*&F*&F " 0 "" {MPLTEXT 1 0 112 "A := matrix([[-a1/a2, 1/a2, 0, 1/
(R*a2)],[1, 0, 0, 0],\n [-q1*a1/a2, q1/a2, 0, a2 + q1/(a2*R)],[q2, 0, \+
1, a1]] );" }{TEXT -1 0 "" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'
matrixG6#7&7&,$*&%#a1G\"\"\"%#a2G!\"\"!\"\"*&F-F-F.F/\"\"!*&F-F-*&%\"R
G\"\"\"F.\"\"\"F/7&\"\"\"F2F2F27&,$*&*&%#q1GF9F,F9F-F.F/F0*&F>F-F.F/F2
,&F.F9*&F>F-*&F5\"\"\"F.\"\"\"F/F97&%#q2GF2F9F," }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 20 "cp := det(lambda-A);" }}{PARA 12 "" 1 ""
{XPPMATH 20 "6#>%#cpG,$*&,8*()%'lambdaG\"\"#\"\"\"%\"RG\"\"\")%#a1GF+F
,F.*(F0F.)F*\"\"$F,F-F,!\"\"**F*F.F-F,%#a2GF.F0F,F.**F0F,F2F,F-F,F6F,F
.*()F*\"\"%F,F6F,F-F,F4*(F)F,)F6F+F,F-F,F.*&F)F,%#q1GF.F.*(F*F,F-F,F0F
,F4*&F)F,F-F,F.*&F-F,F6F,F4*&%#q2GF.F)F,F.F,*&F6\"\"\"F-\"\"\"!\"\"F4
" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "factor(cp);" }}{PARA
12 "" 1 "" {XPPMATH 20 "6#,$*&,8*()%'lambdaG\"\"#\"\"\"%\"RG\"\"\")%#a
1GF)F*F,*(F.F,)F(\"\"$F*F+F*!\"\"**F(F,F+F*%#a2GF,F.F*F,**F.F*F0F*F+F*
F4F*F,*()F(\"\"%F*F4F*F+F*F2*(F'F*)F4F)F*F+F*F,*&F'F*%#q1GF,F,*(F(F*F+
F*F.F*F2*&F'F*F+F*F,*&F+F*F4F*F2*&%#q2GF,F'F*F,F**&F4\"\"\"F+\"\"\"!\"
\"F2" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT
-1 407 "So the characteristic polynomial does not factor. We are expe
cting very complicated roots for this polynomial if we try to solve fo
r lambda. However, if you inspect the polynomial, you will notice tha
t it is symmetric, i.e. coeff(cp,lambda,4) = coeff(cp,lambda,0) and co
eff(cp,lambda,3) = coeff(cp,lambda,1). So solve is able to use a rati
onal decomposition to find the roots in a relatively simple form." }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "solve(cp,lambda);" }}{PARA 11 "" 1
"" {XPPMATH 20 "6#-%'RootOfG6#,,*()%#_ZG\"\"%\"\"\"%#a2G\"\"\"%\"RGF-F
-*&,&*&F.F+%#a1GF-F-*(F2F+F,F+F.F+!\"\"F-)F)\"\"$F+F-*&,,*&)F2\"\"#F+F
.F+F4%#q1GF4F.F4*&F.F+)F,F;F+F4%#q2GF4F-)F)F;F+F-*&F0F+F)F-F-*&F.F+F,F
+F-" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT
-1 165 "The eigenvectors also turn out to be not too complicated when \+
we allow Maple to use it's RootOf notation. The eigenvects command use
s the RootOf notation by default." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0
14 "eigenvects(A);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#7%-%'RootOfG6#,,
*()%#_ZG\"\"%\"\"\"%#a2G\"\"\"%\"RGF.F.*&,&*&F/F,%#a1GF.F.*(F3F,F-F,F/
F,!\"\"F.)F*\"\"$F,F.*&,,*&)F3\"\"#F,F/F,F5%#q1GF5F/F5*&F/F,)F-F " 0 "" {MPLTEXT 1 0 155 "B := matri
x(6,6,\n [0,0,0,0,0,a,\n 0,1,0,0,0,-b,\n 0,0,0,
-a,b,0,\n 0,0,-c,0,0,0,\n 0,0,d,0,0,0,\n c,-d,
0,2,0,0] );" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"BG-%'matrixG6#7(7(
\"\"!F*F*F*F*%\"aG7(F*\"\"\"F*F*F*,$%\"bG!\"\"7(F*F*F*,$F+F0F/F*7(F*F*
,$%\"cGF0F*F*F*7(F*F*%\"dGF*F*F*7(F5,$F7F0F*\"\"#F*F*" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "cp := charpoly(B,lambda);" }}{PARA
12 "" 1 "" {XPPMATH 20 "6#>%#cpG,8*$)%'lambdaG\"\"'\"\"\"\"\"\"*$)F(\"
\"&F*!\"\"*()F(\"\"%F*%\"bGF+%\"dGF+!\"#*(F1F*%\"cGF+%\"aGF+F5*()F(\"
\"$F*F3F*F4F*F+*(F:F*F7F*F8F*\"\"#*()F(F=F*)F3F=F*)F4F=F*F+*,F?F*F7F*F
3F*F8F*F4F*F=*(F?F*)F7F=F*)F8F=F*F+*,F(F+F7F*F3F*F8F*F4F*F/*(F(F*FDF*F
EF*F/" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "f := factor(cp);"
}}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"fG*(%'lambdaG\"\"\",,*$)F&\"\"$F
'\"\"\"*$)F&\"\"#F'!\"\"*(%\"bGF,F&F,%\"dGF,F0*&%\"cGF,%\"aGF,F,*(F5F'
F&F'F6F'F0F,,(*&F2F'F3F'F0F-F,F4F0F," }}}{EXCHG {PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 401 "From the factorization of the \+
characteristic polynomial, we see that one of the eigenvalues is 0, th
at two of the eigenvalues are + - sqrt(ac + bd), but the three others \+
will be the roots of a cubic polynomial, so rather messy. Proceeding \+
this time one step at a time, lets compute the eigenvector correspondi
ng to the eigenvalue 0 by computing the nullspace of the characteristi
c matrix lambda I - A" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "C := charm
at(B,0);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"CG-%'matrixG6#7(7(\"\"
!F*F*F*F*,$%\"aG!\"\"7(F*F-F*F*F*%\"bG7(F*F*F*F,,$F/F-F*7(F*F*%\"cGF*F
*F*7(F*F*,$%\"dGF-F*F*F*7(,$F3F-F6F*!\"#F*F*" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 13 "nullspace(C);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6
#<#-%'vectorG6#7(\"\"\"\"\"!F),$%\"cG#!\"\"\"\"#,$*&*&%\"aGF(F+F(\"\"
\"%\"bG!\"\"F,F)" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 71 "Now for the quadratic factor, here is the eigenvec
tor for + sqrt(ac+bd)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "C := charm
at(B, sqrt(a*c+b*d));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"CG-%'matr
ixG6#7(7(*$-%%sqrtG6#,&*&%\"cG\"\"\"%\"aGF1F1*&%\"bGF1%\"dGF1F1\"\"\"
\"\"!F7F7F7,$F2!\"\"7(F7,&F*F1F9F1F7F7F7F47(F7F7F*F2,$F4F9F77(F7F7F0F*
F7F77(F7F7,$F5F9F7F*F77(,$F0F9F5F7!\"#F7F*" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 13 "nullspace(C);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#<#
-%'vectorG6#7(,$*&*&,(*&%\"cG\"\"\"%\"aGF.F.*&%\"bGF.%\"dGF.F.*$-%%sqr
tG6#,&F,F.F0F.\"\"\"!\"\"F.F/F8F8*&F7\"\"\"F1\"\"\"!\"\"F9F.,$*&F2F8F-
F=#F9\"\"#,$*&F2F8*$-F56#F7F8F=#F.FA,$*&*$)F2FAF8F8*&-F56#F7F8F-\"\"\"
F=F@,$*&,&F3F.F9F.F8F1F=F9" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 166 "Now for the cubic factor. Let's not use
the radical notation here. Let's use the RootOf notation. First, le
t's give the roots of the cubic polynomial a label, beta" }}{PARA 0 ">
" 0 "" {MPLTEXT 1 0 37 "alias( beta=RootOf(op(3,f),lambda) );" }}
{PARA 11 "" 1 "" {XPPMATH 20 "6%%\"IG%&alphaG%%betaG" }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 21 "C := charmat(B,beta);" }}{PARA 11 "" 1 "
" {XPPMATH 20 "6#>%\"CG-%'matrixG6#7(7(%%betaG\"\"!F+F+F+,$%\"aG!\"\"7
(F+,&F*\"\"\"F.F1F+F+F+%\"bG7(F+F+F*F-,$F2F.F+7(F+F+%\"cGF*F+F+7(F+F+,
$%\"dGF.F+F*F+7(,$F6F.F9F+!\"#F+F*" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 13 "nullspace(C);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#<#-%
'vectorG6#7(*&*&%%betaG\"\"\"%\"aG\"\"\"F-,&*&%\"cGF+F,F+F+*&%\"bGF+%
\"dGF+F+!\"\",$*&*&,&F*F+F+F+F+F2F-F-,(F/F+F1F+!\"\"F+F4F:,$*&*(F3F-F2
F-F8F-F-*&F9\"\"\"F0\"\"\"F4#F+\"\"#,$*&*(F2F-F3F-,(F*F+F/F+F1F+F+F-*&
F.\"\"\"F9\"\"\"F4#F:FB,$*&*(F2F-)F3FBF-FFF-F-*(F0\"\"\"F.\"\"\"F9\"\"
\"F4FAF+" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 73 "Finally, lets automate the entire procedure using the eig
envects command." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvects(B);
" }}{PARA 12 "" 1 "" {XPPMATH 20 "6(7%*$-%%sqrtG6#,&*&%\"cG\"\"\"%\"aG
F+F+*&%\"bGF+%\"dGF+F+\"\"\"F+<#-%'vectorG6#7(*&F,F0*$-F&6#F(F0!\"\",$
*&*&,&F$F+F+F+F+F.F0F0,(F)F+F-F+!\"\"F+F:F@,$*&*(F/F0F.F0F>F0F0*&F?\"
\"\"F*\"\"\"F:#F+\"\"#,$*&*(F.F0F/F0,(F$F+F)F+F-F+F+F0*&F(\"\"\"F?\"\"
\"F:#F@FH,$*&*(F.F0)F/FHF0FLF0F0*(F*\"\"\"F(\"\"\"F?\"\"\"F:FGF+7%,$F$
F@F+<#-F36#7(,$F6F@,$*&*&,&F$F@F+F+F+F.F0F0F?F:F@,$*&*(F/F0F.F0F]oF0F0
*&F?\"\"\"F*\"\"\"F:FG,$*&*(F.F0F/F0,(F$F@F)F+F-F+F+F0*&F(\"\"\"F?\"\"
\"F:FP,$*&*(F.F0FTF0FgoF0F0*(F*\"\"\"F(\"\"\"F?\"\"\"F:FGF+7%\"\"!F+<#
-F36#7(F+FcpFcp,$F*FP,$*&*&F,F0F*F0F0F.F:FPFcp7%,(*$),*F)!#sF-\"#O\"\"
)F+*$-F&6#,2*&)F*\"\"$F0)F,FjqF0!#7**)F*FHF0)F,FHF0F/F0F.F0!#O*&F^rF0F
_rF0\"#C**FTF0F*F0)F.FHF0F,F0F`r**F,F0F/F0F.F0F*F0!#gF)F\\r*&)F.FjqF0)
F/FjqF0F\\r*&FdrF0FTF0!\"$F0\"#7#F+FjqF0#F+\"\"'*&,(F)#F@FjqF-Fbs#F@\"
\"*F+F0*$)F`q#\"\"\"FjqF0F:!\"'F]sF+F+<#-F36#7(F+*&,&*$)F]qFHF0F@F)F+F
0*&F/\"\"\"F,\"\"\"F:FcpFcpFcp*&F]qF0F,F:7%,*F^q#F@F\\sF`sFjqF]sF+*(%
\"IGF+-F&6#FjqF0,&F^qF^sF`sF_sF+FGF+<#-F36#7(F+*&,&*$)FgtFHF0F@F)F+F0*
&F/\"\"\"F,\"\"\"F:FcpFcpFcp*&FgtF0F,F:7%,*F^qFhtF`sFjqF]sF+FitFPF+<#-
F36#7(F+*&,&*$)F[vFHF0F@F)F+F0*&F/\"\"\"F,\"\"\"F:FcpFcpFcp*&F[vF0F,F:
" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 388 "We \+
can see that the eigenvector for beta is different from the one we com
puted previously. What has happened is that Maple has made a differen
t entry equal to 1, the second entry, by dividing through. But the ei
genvectors do agree up to multplication by a constant. The roots of t
he quadratic polynomial are displayed using a RootOf because we have \+
not given an alias for this RootOf." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }
}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{SECT 0 {PARA 4 "" 0 "" {TEXT -1 27 " The limitations of Maple V" }}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 454 "We wish \+
now to say something about the limitations of Maple. Will it work for
complex matrices? Will it work for matrices which have algebraic num
bers and functions in them, e.g. sqrt(2) or sqrt(1+x)? Yes it will. \+
And the main facility that makes this possible is Maples factor comma
nd which can factor polynomials over algebraic number fields and, in R
elease 2, algebraic function fields. This example will show what we m
ean. Consider this matrix:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
35 "T := toeplitz( [sqrt(2),x,omega] );" }}{PARA 11 "" 1 "" {XPPMATH
20 "6#>%\"TG-%'matrixG6#7%7%*$-%%sqrtG6#\"\"#\"\"\"%\"xG%&omegaG7%F0F*
F07%F1F0F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "cp := det(lam
bda-T);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#cpG,4*$-%%sqrtG6#\"\"#\"
\"\"!\"#%'lambdaG\"\"'*&F'F+)F-F*F+!\"$*&F'F+)%\"xGF*F+F**$)F-\"\"$F+
\"\"\"*&F-F8F3F+F,*&%&omegaGF8F3F+F,*&)F;F*F+F'F+F8*&F=F+F-F+!\"\"" }}
}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 277 "
The eigenvalues are of course the roots of this polynomial. We could \+
use the general formula for a cubic polynomial to find them, but, it t
urns out that the polynomial factors. The factorization needs to be d
one over the algebraic number field with the sqrt(2) in it. We get" }
}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "factor(cp);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#*&,.*$)%'lambdaG\"\"#\"\"\"\"\"\"*&-%%sqrtG6#F(F)F'F*!
\"#*&%&omegaGF*F'F)!\"\"F(F**&F1F)F,F)F**$)%\"xGF(F)F/F*,(F'F*F1F**$F,
F)F2F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "eigenvals(T);" }}
{PARA 11 "" 1 "" {XPPMATH 20 "6%,(%&omegaG#\"\"\"\"\"#*$-%%sqrtG6#F'\"
\"\"F&*$-F*6#,&*$)F$F'F,F&*$)%\"xGF'F,\"\")F,F%,(F$F%F(F&F-#!\"\"F',&F
$F9F(F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 126 "Some more examples with computing over algebraic number \+
fields. Suppose we have the polynomial below and we try to factor it.
" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "p := x^4-4;" }}{PARA 11 "" 1 "
" {XPPMATH 20 "6#>%\"pG,&*$)%\"xG\"\"%\"\"\"\"\"\"!\"%F+" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "factor(p);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#*&,&*$)%\"xG\"\"#\"\"\"\"\"\"!\"#F*F*,&F%F*F(F*F*" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 416 "O
bserve that the polynomial has not been factored into linear factors. \+
The factor command factors a polynomial over the field implied by the
coefficients in the input. In this example, the coefficients are int
egers. So factor finds all irreducible factors with integer coefficie
nts. To factor the polynomial into linear factors, we have to introdu
ce the sqrt(2) and the complex unit sqrt(-1) which is I in Maple." }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "factor(p,sqrt(2));" }}{PARA 11 ""
1 "" {XPPMATH 20 "6#*(,&*$)%\"xG\"\"#\"\"\"\"\"\"F(F*F*,&F'F**$-%%sqrt
G6#F(F)F*F*,&F'F*F,!\"\"F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
12 "factor(p,I);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&,&*$)%\"xG\"\"#
\"\"\"\"\"\"!\"#F*F*,&F%F*F(F*F*" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 22 "factor(p,\{sqrt(2),I\});" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#**,&%\"xG\"\"\"*&%\"IGF&-%%sqrtG6#\"\"#\"\"\"F&F&,&F%!
\"\"F'F&F&,&F%F&*$F)F-F&F&,&F%F/F1F&F&" }}}{EXCHG {PARA 0 "" 0 ""
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 261 "Now this ability to fact
or polynomials over different number fields is exploited in the eigenv
alues and eigenvectors commands to simplify the eigenvalues. The fac
ilities in Maple also extend to algebraic functions, for example, sqrt
(y). Consider this example" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "p :=
x^4-4*y;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG,&*$)%\"xG\"\"%\"\"
\"\"\"\"%\"yG!\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "factor
(p);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&*$)%\"xG\"\"%\"\"\"\"\"\"%\"
yG!\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "factor(p,sqrt(y))
;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&,&*$)%\"xG\"\"#\"\"\"\"\"\"*$-%
%sqrtG6#%\"yGF)F(F*,&F+!\"#F%F*F*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1
0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "Now here is an example where of a \+
matrix where this factorization capability helps." }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 41 "T := toeplitz([sqrt(1+x), sqrt(2), 1+x]);" }}{PARA
11 "" 1 "" {XPPMATH 20 "6#>%\"TG-%'matrixG6#7%7%*$-%%sqrtG6#,&\"\"\"F/
%\"xGF/\"\"\"*$-F,6#\"\"#F1F.7%F2F*F27%F.F2F*" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 25 "cp := charpoly(T,lambda);" }}{PARA 11 "" 1 ""
{XPPMATH 20 "6#>%#cpG,6*$)%'lambdaG\"\"$\"\"\"\"\"\"*&)F(\"\"#F*-%%sqr
tG6#,&F+F+%\"xGF+F*!\"$F(!\"#*&F3F+F(F+F+*$F/F*\"\"%*&F3F*F/F*F+!\"%F+
F3F:*&F(F*)F3F.F*!\"\"*&F " 0 ""
{MPLTEXT 1 0 21 "factor(cp,sqrt(1+x));" }}{PARA 11 "" 1 "" {XPPMATH
20 "6#*&,2*$)%'lambdaG\"\"#\"\"\"\"\"\"*&F'F*-%%sqrtG6#,&F*F*%\"xGF*F)
!\"#*&F0F*F'F)!\"\"F'F3!\"$F*F0F**&F0F)F,F)F**$F,F)F*F*,*F0F*F6F3F'F*F
*F*F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvects(T);" }}
{PARA 12 "" 1 "" {XPPMATH 20 "6%7%,**$-%%sqrtG6#,&\"\"\"F*%\"xGF*\"\"
\"F*F+#F*\"\"#F-F**$-F'6#,(\"# " 0 "" {MPLTEXT 1 0 90 "s := (2*t^2+2*t)^(1/2):\nP := matri
x(3,3,[t*(t+1), s, 0, s, t*(t+1)+2, s, 0, s, t*(t+1)]);\n" }}{PARA 11
"" 1 "" {XPPMATH 20 "6#>%\"PG-%'matrixG6#7%7%*&%\"tG\"\"\",&F+F,F,F,F,
*$-%%sqrtG6#,&*$)F+\"\"#\"\"\"F5F+F5F6\"\"!7%F.,&F*F,F5F,F.7%F7F.F*" }
}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "cp := charpoly(P,lambda);
" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#cpG,:*$)%'lambdaG\"\"$\"\"\"\"
\"\"*&)F(\"\"#F*)%\"tGF.F*!\"$*&F-F*F0F+F1*&F(F+)F0\"\"%F*F)*&F(F*)F0F
)F*\"\"'*&F(F*F/F*F)*$F-F*!\"#*$)F0F8F*!\"\"*$)F0\"\"&F*F1*$F4F*F>*$F7
F*F)*$F/F*F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "factor(cp);
" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*(,*%'lambdaG\"\"\"!\"#F&%\"tG!\"$
*$)F(\"\"#\"\"\"!\"\"F&,(F%F&F(F&F*F.F&,(F%F&F*F.F(F.F&" }}}{EXCHG
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 280 "This exa
mple is rather interesting because the square roots cancelled out in t
he characteristic polynomial, which factors into 3 simple linear facto
rs. So the eigenvalues are easy to compute. In computing the eigenve
ctors however, we will have to compute with these square roots" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvects(P);" }}{PARA 12 "
" 1 "" {XPPMATH 20 "6%7%,(\"\"#\"\"\"%\"tG\"\"$*$)F'F%\"\"\"F&F&<#-%'v
ectorG6#7%F&*&*$-%%sqrtG6#,&F)F%F'F%F+F+F'!\"\"F&7%,&F)F&F'F&F&<#-F.6#
7%F&\"\"!!\"\"7%,&F'F?F)F&F&<#-F.6#7%,$F1#F?F%F&FF" }}}{EXCHG {PARA 0
"" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 291 "Now our examples
have shown that Maple can work either using radicals or RootOf's, but
actually, all the computations are done in the RootOf notation. I.e.
the codes first convert from radicals too RootOfs. For example, the \+
sqrt s in the example above converted into the RootOf notation is" }}
{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "r := convert(s,RootOf);" }}{PARA
11 "" 1 "" {XPPMATH 20 "6#>%\"rG-%'RootOfG6#,(*$)%#_ZG\"\"#\"\"\"\"\"
\"*$)%\"tGF,F-!\"#F1F2" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT -1 111 "You can see that indeed, s is a root of \+
this polynomial in _Z. Converting back to the radical notation, we ge
t" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "convert(r,radical);" }}{PARA
11 "" 1 "" {XPPMATH 20 "6#*$-%%sqrtG6#,&*$)%\"tG\"\"#\"\"\"F+F*F+F," }
}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "
Now this square root can be factored into the form" }}{PARA 0 "> " 0 "
" {MPLTEXT 1 0 20 "simplify(factor(s));" }}{PARA 11 "" 1 "" {XPPMATH
20 "6#*&-%%sqrtG6#\"\"#\"\"\"-F%6#*&%\"tG\"\"\",&F,F-F-F-F-F(" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 362 "O
ne could of course argue that this isn't really simpler because now we
have two square roots. What we want to show now is that if we have a
n expression that involves both forms for s, Maple will complain and i
nsist on using either one form, or the other, but not both at the same
time. Here is what happens. Suppose we modify the 1,2 entry of the \+
P matrix be" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "P[1,2] := sqrt(2)*sq
rt(t^2+t);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"PG6$\"\"\"\"\"#*&-%
%sqrtG6#F(\"\"\"-F+6#,&*$)%\"tGF(F-F'F3F'F-" }}}{EXCHG {PARA 0 "> " 0
"" {MPLTEXT 1 0 9 "print(P);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'mat
rixG6#7%7%*&%\"tG\"\"\",&F)F*F*F*F**&-%%sqrtG6#\"\"#\"\"\"-F.6#,&*$)F)
F0F1F*F)F*F1\"\"!7%*$-F.6#,&F5F0F)F0F1,&F(F*F0F*F97%F7F9F(" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvects(P);" }}{PARA 8 "" 1 ""
{TEXT -1 194 "Error, (in evala) reducible RootOf detected. Substituti
ons are, \{RootOf(_Z^2-t^2-t) = -1/2*RootOf(_Z^2-2)*RootOf(_Z^2-2*t^2-
2*t), RootOf(_Z^2-t^2-t) = 1/2*RootOf(_Z^2-2)*RootOf(_Z^2-2*t^2-2*t)\}
" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1
362 "We get an error. The first thing we notice is that Maple has con
verted the input radicals into the RootOf notation. What does the err
or mean. It means that Maple has discovered that the different RootOf
's are not independent. Noting that sqrt(2) is RootOf(_Z^2-2) in the \+
RootOf notation, Maple is telling us the relationship between them, na
mely that either." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "sqrt(t^2+t) = \+
-sqrt(2)/2*s;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/*$-%%sqrtG6#,&*$)%\"
tG\"\"#\"\"\"\"\"\"F+F.F-,$*&-F&6#F,F--F&6#,&F)F,F+F,F-#!\"\"F," }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "sqrt(t^2+t) = +sqrt(2)/2*s;
" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/*$-%%sqrtG6#,&*$)%\"tG\"\"#\"\"\"
\"\"\"F+F.F-,$*&-F&6#F,F--F&6#,&F)F,F+F,F-#F.F," }}}{EXCHG {PARA 0 ""
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 704 "Of course, it would
be nice if Maple would automatically do the right simplification for \+
us. But it doesn't. And the reason is that in general, because there
is more than one possibility, it doesn't know which one it should cho
ose. The user has to make sure himself that the input matrix does not
have any such ``algebraic'' dependencies. We wish to conclude this t
utorial by pointing out one further advantage of working algebraically
, i.e. by doing all arithmetic exactly, and one disadvantage. The adv
antage is that by doing all the arithmetic exactly, there are no round
off errors. So for matrices that have repeated eigenvalues, the eigen
vectors will be computed correctly. Here is an example" }}{PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 62 "A := matrix(4,4,[0,1,0,0,-u^2,2*u,0,0,-u*v,v,u
,0,-u*t,t,0,u]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrixG6#
7&7&\"\"!\"\"\"F*F*7&,$*$)%\"uG\"\"#\"\"\"!\"\",$F0F1F*F*7&,$*&F0F+%\"
vGF+F3F8F0F*7&,$*&F0F2%\"tGF+F3F " 0 ""
{MPLTEXT 1 0 20 "cp := det(lambda-A);" }}{PARA 11 "" 1 "" {XPPMATH 20
"6#>%#cpG,,*&%'lambdaG\"\"\")%\"uG\"\"$\"\"\"!\"%*&)F*\"\"#F,)F'F0F,\"
\"'*&F*F()F'F+F,F-*$)F'\"\"%F,F(*$)F*F7F,F(" }}}{EXCHG {PARA 0 "> " 0
"" {MPLTEXT 1 0 11 "factor(cp);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*$)
,&%\"uG!\"\"%'lambdaG\"\"\"\"\"%\"\"\"" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 13 "eigenvals(A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6&%\"u
GF#F#F#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "e := eigenvects(
A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"eG7%%\"uG\"\"%<%-%'vectorG6
#7&*&\"\"\"F.F&!\"\"\"\"\"\"\"!F1-F*6#7&F1F1F1F0-F*6#7&F1F1F0F1" }}}
{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 408 "T
his example shows a matrix in which the eigenvalue u is repeated 4 tim
es. The eigenspace consists of a basis of more than one vector, 3 vec
tors. One normally expects to get 4 vectors in the basis. But it is \+
possible for two vectors to conincide. We end by showing that the thr
ee eigenvectors computed are indeed correct. Instead of doing this on
e vector at a time, we build the matrix X of eigenvectors" }}{PARA 0 "
> " 0 "" {MPLTEXT 1 0 42 "X := augment( e[3][1], e[3][2], e[3][3] );"
}}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"XG-%'matrixG6#7&7%\"\"!F**&\"\"
\"F,%\"uG!\"\"7%F*F*\"\"\"7%F0F*F*7%F*F0F*" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 20 "evalm( (u-A) &* X );" }}{PARA 11 "" 1 "" {XPPMATH
20 "6#-%'matrixG6#7&7%\"\"!F(F(F'F'F'" }}}}{PARA 0 "" 0 "" {TEXT -1 0
"" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "8 0 0" 8 }
{VIEWOPTS 1 1 0 1 1 1803 }