Calculus Practical Semester1 DU University

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Practical 8 Matrix Operations

MatrixForm i, b, c, d, e, f

i b c
d e f

Dimensions i, b, c, d, e, f


{2, 3}

MatrixForm [{{p, q, r}, {s, t, u}}]

p q r 
s t u

Dimensions [{{p, q, r}, {s, t, u}}]


{2, 3}

MatrixForm i+p, b +q, c +r, d +s, e +t, f +u

 i+p b +q c +r 
d +s e +t f +u

Dimensions i+p, b +q, c +r, d +s, e +t, f +u


{2, 3}

MatrixForm [{{1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}}]


1 1 0 0
1 0 0 0
1 0 0 1
0 0 1 1

MatrixForm [{{1, 2, 3}, {4, 0, 4}, {7, 5, 4}}]


1 2 3
4 0 4
7 5 4

Matrix Addition
MatrixForm a, b, c, d, e, f+{{p, q, r}, {r, s, t}}

 a +p b +q c +r 
d +r e +s f +t

Matrix Multiplication
MatrixForm a, b, c, d, e, f.{{p, q}, {r, s}, {u, v}}

 a p +b r +c u a q +b s +c v 
d p +e r +f u d q +e s +f v

Inverse
m = a, b, c, d
{{a, b}, {c, d}}
2 Practical 9 Matrix Operations(2).nb

Inverse[m ]
d b c a
 ,- , - , 
-b c +a d -b c +a d -b c +a d -b c +a d

d b c a
MatrixForm  ,- , - , 
-b c +a d -b c +a d -b c +a d -b c +a d
d b
-b c+a d
- -b c+a d
c a
- -b c+a d -b c+a d

Inverse[{{1, 2}, {3, 4}}]


3 1
{-2, 1},  , - 
2 2

3 1
MatrixForm {-2, 1},  , - 
2 2
-2 1
3
2
- 12

MatrixForm [Inverse[{{1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}}]]


0 1 0 0
1 -1 0 0
0 1 -1 1
0 -1 1 0

MatrixForm [Inverse[{{1, 2, 3}, {4, 0, 4}, {7, 5, 4}}]]


5 7 1
- 16 64 8
3
16
- 17
64
1
8
5 9
16 64
- 18

Transpose
m = a, b, c, d
{{a, b}, {c, d}}

Transpose[m ]
{{a, c}, {b, d}}

MatrixForm {a, c}, b, d

a c 
b d

MatrixForm [{{1, 2}, {3, 4}}]

1 2 
3 4

MatrixForm [Transpose[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]]


1 4 7
2 5 8
3 6 9
Practical 9 Matrix Operations(2).nb 3

MatrixForm [Transpose[{{1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}}]]


1 1 1 0
1 0 0 0
0 0 0 1
0 0 1 1

MatrixForm [Transpose[{{1, 2, 3}, {4, 0, 6}, {7, 8, 9}}]]


1 4 7
2 0 8
3 6 9

Determinant
m = a, b, c, d
{{a, b}, {c, d}}

Det[m ]
-b c +a d

Det[{{1, 2}, {3, 4}}]


-2

Det[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]


0

Det[{{1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}}]


1

Det[{{1, 2, 3}, {4, 0, 4}, {7, 5, 4}}]


64

Rank
MatrixRanka, b, c, d
2

MatrixRank[{{1, 2}, {3, 4}}]


2

MatrixRank[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]


2

MatrixRank[{{1, 1, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}}]


4

MatrixRank[{{1, 2, 3}, {4, 0, 4}, {7, 5, 4}}]


3

Eigenvectors
4 Practical 9 Matrix Operations(2).nb

Eigenvectorsa, b, c, d

-a +d + a2 +4 b c -2 a d +d2 -a +d - a2 +4 b c -2 a d +d2
- , 1, - , 1
2c 2c

Eigenvectors[{{4, 5, 6}, {1, 2, 3}, {3, 4, 5}}]


1 1 1 1
 23 - 109 , -8 + 109 , 1,  23 + 109 , -8 - 109 , 1, {1, -2, 1}
10 5 10 5

Eigenvalues and Characteristic Equations


Eigenvalues[{{4, 5, 6}, {1, 2, 3}, {3, 4, 5}}]
1 1
 11 + 109 , 11 - 109 , 0
2 2

Eigenvalues[{{1, 2, 3}, {0, -4, 2}, {0, 0, 7}}]


{7, -4, 1}

Det[{{1 -t, 2, 3}, {0, -4 -t, 2}, {0, 0, 7 -t}}]


(7 -t) -4 +3 t +t2 

NSolve(7 -t) -4 +3 t +t2 


{{t → -4.}, {t → 1.}, {t → 7.}}

Eigenvalues[{{-5, -5, -4}, {-8, -8, -7}, {-16, -16, -14}}]


1 1
 -27 - 705 , -27 + 705 , 0
2 2

Det[{{-5 -t, -5, -4}, {-8, -8 -t, -7}, {-16, -16, -14 -t}}]
-6 t -27 t2 -t3

NSolve-6 t -27 t2 -t3 


{{t → -26.7759}, {t → -0.224082}, {t → 0.}}

Eigenvalues[{{6, 7, 8}, {11, 12, 13}, {21, 22, 23}}]


1 1
 41 + 1861 , 41 - 1861 , 0
2 2

Det[{{6 -t, 7, 8}, {11, 12 -t, 13}, {21, 22, 23 -t}}]


45 t +41 t2 -t3

NSolve45 t +41 t2 -t3 


{{t → -1.06965}, {t → 0.}, {t → 42.0697}}

You might also like