\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
(%i1) kill(all)$
load(eigen)$

appendix:repeated eigenvalues
[email protected],26/03/2017

see:
Lecture 26: Continuation: Repeated Real Eigenvalues

(%i2) depends(x,t);
\[\tag{\%{}o2}\label{o2} [\operatorname{x}(t)]\]
(%i5) p[1]:'diff(x[1],t)=-2*x[1]+x[2]+x[3];
p[2]:'diff(x[2],t)=x[1]-2*x[2]+x[3];
p[3]:'diff(x[3],t)=x[1]+x[2]-2*x[3];
\[\tag{\%{}o3}\label{o3} \frac{d}{dt}{{x}_{1}}={{x}_{3}}+{{x}_{2}}-2{{x}_{1}}\] \[\tag{\%{}o4}\label{o4} \frac{d}{dt}{{x}_{2}}={{x}_{3}}-2{{x}_{2}}+{{x}_{1}}\] \[\tag{\%{}o5}\label{o5} \frac{d}{dt}{{x}_{3}}=-2{{x}_{3}}+{{x}_{2}}+{{x}_{1}}\]
(%i7) M1:zeromatrix(3,3)$
for i:1 thru 3 do
 for j:1 thru 3 do
M1[i,j]:coeff(part(p[i],2),x[j]);
\[\tag{\%{}o7}\label{o7} \mathit{done}\]

coef.Marix : 'p[i] , i=1..3'

(%i8) M1;
\[\tag{\%{}o8}\label{o8} \begin{pmatrix}-2 & 1 & 1\\ 1 & -2 & 1\\ 1 & 1 & -2\end{pmatrix}\]

eigenvalues ,M2       '|A-lambda*I|=0'
I=matrix(M3)

(%i12) M2:zeromatrix(3,3)$
M3:zeromatrix(3,3)$
for i:1 thru 3 do
 M3[i,i]:1;
for i:1 thru 3 do
 for j:1 thru 3 do
 M2[i,j]:M1[i,j]-lambda*M3[i,j];
\[\tag{\%{}o11}\label{o11} \mathit{done}\] \[\tag{\%{}o12}\label{o12} \mathit{done}\]
(%i13) M2;
\[\tag{\%{}o13}\label{o13} \begin{pmatrix}-\mathit{lambda}-2 & 1 & 1\\ 1 & -\mathit{lambda}-2 & 1\\ 1 & 1 & -\mathit{lambda}-2\end{pmatrix}\]

find :eigenvalues 'lambda'

(%i14) p1:-1*ratsimp(determinant(M2))=0;
\[\tag{p1}\label{p1}{{\mathit{lambda}}^{3}}+6{{\mathit{lambda}}^{2}}+9\mathit{lambda}=0\]

find only :two eigenvalues,normal three values

(%i15) p2:factor(p1);
\[\tag{p2}\label{p2}\mathit{lambda}\,{{\left( \mathit{lambda}+3\right) }^{2}}=0\]
(%i16) p3:solve(p2,lambda);
\[\tag{p3}\label{p3}[\mathit{lambda}=-3,\mathit{lambda}=0]\]

find : three eigenvalues

(%i20) p31:allroots(p2)$
p32:p31[1];
p33:p31[2];
p34:p31[3];
\[\tag{p32}\label{p32}\mathit{lambda}=0.0\] \[\tag{p33}\label{p33}\mathit{lambda}=-3.0\] \[\tag{p34}\label{p34}\mathit{lambda}=-3.0\]
(%i23) p320:part(p32,2);
p330:part(p33,2);
p340:part(p34,2);
\[\tag{p320}\label{p320}0.0\] \[\tag{p330}\label{p330}-3.0\] \[\tag{p340}\label{p340}-3.0\]

? find multiplicities = 2  for lambda = -3

build in 'Maxima'
statement 'eigenvectors','uniteigenvectors'

(%i24) p4:eigenvectors(M1);
\[\tag{p4}\label{p4}[[[-3,0],[2,1]],[[[1,0,-1],[0,1,-1]]]]\]

build in 'Maxima'
construction : 1e)[vals,vecs]:eigenvectors(matrix)
              2e)[uvals,uvecs]:uniteigenvectors(matrix)

1e)[vals,vecs]:eigenvectors(matrix)

(%i27) p5:[vals,vecs]:eigenvectors(M1);
p6:vals[1];
p7:vecs[1];
\[\tag{p5}\label{p5}[[[-3,0],[2,1]],[[[1,0,-1],[0,1,-1]]]]\] \[\tag{p6}\label{p6}[-3,0]\] \[\tag{p7}\label{p7}[[1,0,-1],[0,1,-1]]\]

2e)[uvals,uvecs]:uniteigenvectors(matrix)

(%i30) p8:[uvals,uvecs]:uniteigenvectors(M1);
p9:uvals[1];
p10:uvecs[1];
\[\tag{p8}\label{p8}[[[-3,0],[2,1]],[[[\frac{1}{\sqrt{2}},0,-\frac{1}{\sqrt{2}}],[0,\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}]]]]\] \[\tag{p9}\label{p9}[-3,0]\] \[\tag{p10}\label{p10}[[\frac{1}{\sqrt{2}},0,-\frac{1}{\sqrt{2}}],[0,\frac{1}{\sqrt{2}},-\frac{1}{\sqrt{2}}]]\]

rem: p32 = lambda = 0 →  'eigenvector' = [1,1,1]
eigenvector = constant eigenvector.

solution : eigenvectors

(%i33) p71:p7[1];
p72:p7[2];
p73:[1,1,1];
\[\tag{p71}\label{p71}[1,0,-1]\] \[\tag{p72}\label{p72}[0,1,-1]\] \[\tag{p73}\label{p73}[1,1,1]\]

solution 'system diff.equations':p[i],i=1,2,3

(%i36) x[1]=c1*p73[1]*e^(p320*t)+c2*p71[1]*e^(p330*t)+c3*p72[1]*e^(p330*t);
x[2]=c1*p73[2]*e^(p320*t)+c2*p71[2]*e^(p330*t)+c3*p72[2]*e^(p330*t);
x[3]=c1*p73[3]*e^(p320*t)+c2*p71[3]*e^(p330*t)+c3*p72[3]*e^(p330*t);
\[\tag{\%{}o34}\label{o34} {{x}_{1}}=\frac{\mathit{c2}}{{{e}^{3.0t}}}+1.0\mathit{c1}\] \[\tag{\%{}o35}\label{o35} {{x}_{2}}=\frac{\mathit{c3}}{{{e}^{3.0t}}}+1.0\mathit{c1}\] \[\tag{\%{}o36}\label{o36} {{x}_{3}}=-\frac{\mathit{c3}}{{{e}^{3.0t}}}-\frac{\mathit{c2}}{{{e}^{3.0t}}}+1.0\mathit{c1}\]
Created with wxMaxima.