Matrices Algebra
Matrices Algebra
1. Matrix algebra.
In section D we calculated the determinants of square arrays of numbers. Such arrays are
important in mathematics and its applications; they are called matrices. In general, they
need not be square, only rectangular.
A rectangular array of numbers having m rows and n columns is called an m x n matrix.
The number in the i-th row and j-th column (where 1 5 i 5 m , 1 5 j 5 n) is called the
ij-entry, and denoted aij; the matrix itself is denoted by A, or sometimes by (aij).
Two matrices of the same size are equal if corresponding entries are equal.
Two special kinds of matrices are the row-vectors: the 1 x n matrices ( a l , az, . . . ,a,);
and the column vectors: the m x 1 matrices consisting of a column of m numbers.
From now on, row-vectors or column-vectors will be indicated by boldface small
letters; when writing them by hand, put an arrow over the symbol.
Matrix operations
There are four basic operations which produce new matrices from old.
1. Scalar multiplication: Multiply each entry by c : cA = (caij)
+
2. Matrix addition: Add the corresponding entries: A B = (aij bij); the two +
matrices must have the same number of rows and the same number of columns.
3. Transposition: The transpose of the m x n matrix A is the n x m matrix obtained by
making the rows of A the columns of the new matrix. Common notations for the transpose
are AT and A'; using the first we can write its definition as AT = (aji).
If the matrix A is square, you can think of AT as the matrix obtained by flipping A over
around its main diagonal.
2 -3 1 5
Example 1.1 Let A = . F i n d A + B , AT, 2A-3B.
2 18.02 NOTES
The two most important types of multiplication, for multivariable calculus and
differential equations, are:
1. AB, where A and B are two square matrices of the same size - these can
always be multiplied;
2. Ab, where A is a square n x n matrix, and b is a column n-vector.
I is called the identity matrix of order 3. There is an analogously defined square identity
matrix Inof any order n, obeying the same multiplication laws.
M-4. In general, for two square n x n matrices A and B , AB # BA: matrix multiplication
is not commutative. (There are a few important exceptions, but they are very special - for
example, the equality A I = I A where I is the identity matrix.)
M-5. For two square n x n matrices A and B , we have the determinant law:
For 2 x 2 matrices, this can be verified by direct calculation, but this naive method is
unsuitable for larger matrices; it's better to use some theory. We will simply assume it in
these notes; we will also assume the other results above (of which only the associative law
M-2 offers any difficulty in the proof).
M. MATRICES AND LINEAR ALGEBRA 3
M-6. A useful fact is this: matrix multiplication can be used to pick out a row or column
of a given matrix: you multiply by a simple row or column vector to do this. Two examples
should give the idea:
(1 0 0 )
(: : :)
4 5 6 = ( 1 2 3) thefirstrow
Exercises: Section 1F
In these systems, the aij and bi are given, and we want to solve for the xi.
As a simple mathematical example, consider the linear change of coordinates given by
the equations
If we know the y-coordinates of a point, then these equations tell us its x-coordinates
immediately. But if instead we are given the x-coordinates, to find the y-coordinates we
must solve a system of equations like (7) above, with the yi as the unknowns.
Using matrix multiplication, we can abbreviate the system on the right in (7) by
where A is the square matrix of coefficients ( a i j ). (The 2 x 2 system and the n x n system
would be written analogously; all of them are abbreviated by the same equation Ax = b,
notice.)
You have had experience with solving small systems like (7) by elimination: multiplying
the equations by constants and subtracting them from each other, the purpose being to
4 18.02 NOTES
eliminate all the variables but one. When elimination is done systematically, it is an efficient
method. Here however we want to talk about another method more compatible with hand-
held calculators and MatLab, and which leads more rapidly to certain key ideas and results
in linear algebra.
Inverse matrices.
Referring to the system (8), suppose we can find a square matrix M , the same size as A,
such that
M ( A x ) = (MA)x, by M-2;
=Ix, by (9);
= x, by M-3 .
Moreover, the solution is unique, since (10) gives an explicit formula for it.
The same procedure solves the problem of determining the inverse to the linear change
of coordinates x = Ay, as the next example illustrates.
1 2
E x a m p l e 2.1 Let A = 2, Verify that M satisfies (9)
( 2 3) and M = (-32 -1 '
above, and use it to solve the first system below for xi and the second for the yi in terms of
the xi:
Solution.
1 2
We have ( 2 3) (-3 2 -12,(i :),
= by matrix multiplication. To
Our problem now is: how do we get the matrix M ? In practice, you mostly press a key
on the calculator, or type a Matlab command. But we need to be able to work abstractly
M. MATRICES AND LINEAR ALGEBRA 5
with the matrix - i.e., with symbols, not just numbers, and for this some theoretical ideas
are important. The first is that M doesn't always exist.
M exists IAI # 0.
The implication + follows immediately from the law M-5, since
The implication in the other direction requires more; for the low-dimensional cases, we will
produce a formula for M. Let's go to the formal definition first, and give M its proper
name, A-l:
(It is actually enough to verify either equation; the other follows automatically - see the
exercises.)
Using the above notation, our previous reasoning (9) - (10) shows that
T
1 All
1 A12 A13
(13) A-' = - adj A = - Azl
I A1 1 1( A
Azz
A t::) '
In the formula, Aij is the cofactor of the element aij in the matrix, i.e., its minor with its
sign changed by the checkerboard rule (see section 1 on determinants).
Formula (13) shows that the steps in calculating the inverse matrix are:
1. Calculate the matrix of minors.
2. Change the signs of the entries according to the checkerboard rule.
3. 3-anspose the resulting matrix; this gives adj A.
4. Divide every entry by IAl.
(If inconvenient, for example if it would produce a matrix having fractions for every entry,
you can just leave the 1/IA( factor outside, as in the formula. Note that step 4 can only be
taken if IAl # 0, so if you haven't checked this before, you'll be reminded of it now.)
The notation Aij for a cofactor makes it look like a matrix, rather than a signed
determinant; this isn't good, but we can live with it.
6 18.02 NOTES
Solution. We calculate that IAl = 2. Then the steps are (T means transpose):
1 0 -1 1 -1 1 0
To get practice in matrix multiplication, check that A . A-l = I , or to avoid the fractions,
check that A . adj (A) = 21.
The same procedure works for calculating the inverse of a 2 x 2 matrix A. We do it for
a general matrix, since it will save you time in differential equations if you can learn the
resulting formula.
2 2
Example 2.3 Find the inverses to:
3 2
1 2 0 1
Solution. a) Use the formula: IAI = 2, so A-' = -
2 (-3 1) = (4 $)0 .
b) Follow the previous scheme:
To prove (14), it will be enough to look at two typical entries in the matrix on the right -
say the first two in the top row. According to the rule for multiplying the two matrices on
the left, what we have to show is that
M. MATRICES AND LINEAR ALGEBRA 7
These two equations are both evaluating determinants by Laplace expansions: the first
equation (15) evaluates the determinant on the left below by the cofactors of the first row;
the second equation (16) evaluates the determinant on the right below by the cofactors of
the second row (notice that the cofactors of the second row don't care what's actually in
the second row, since to calculate them you only need to know the other two rows).
The two equations (15) and (16) now follow, since the determinant on the left is just JAl,
while the determinant on the right is 0, since two of its rows are the same.
The procedure we have given for calculating an inverse works for n x n matrices, but gets
to be too cumbersome if n > 3, and other methods are used. The calculation of A-' for
reasonable-sized A is a standard package in computer algebra programs and MatLab. Unfor-
tunately, social scientists often want the inverses of very large matrices, and for this special
techniques have had to be devised, which produce approximate but acceptable results.
Exercises: Section 1G
When this solution is written out and simplified, it becomes a rule for solving the system
A x = b known as Cramer's rule. We illustrate with the 2 x 2 case first; the system is
The formulas in the 3 x 3 case are similar, and may be expressed this way:
Crarner's rule. If IAI # 0, the solution of A x = b is given by
l Ail
xi = -
1A.I '
where lAil is the determinant obtained by replacing the i-th column of IA( by the column
vector b.
8 18.02 NOTES
Cramer's rule is particularly useful if one only wants one of the xi, as in the next example.
Example 3.1. Solve for x, using Cramer's rule (19):
Solution. We rewrite the system on the left below, then use Cramer's rule (19):
I-: I: -7
Proof of (19). Since the solution to the system is x = A-'b, when we write it out
explicitly, it becomes
We show that this gives formula (19) for X I ; the arguments for the other xi go similarly.
From the definition of matrix multiplication, we get from the above
according to the Laplace expansion of the determinant by its first column. But this last
equation is exactly Cramer's rule for finding x l .
Cramer's rule is also valid for n x n systems; it is not normally used for systems larger
than 3 x 3 however. You would use A-l, or systematic elimination of variables. Nonetheless,
the formula (19) is important as a theoretical tool in proofs and derivations.
Exercises: Section 1H
Notice that (21) is the special case of (20) where b = 0 . Often it is stated and used in the
contrapositive form:
(23) IAl = 0 +- A x = b usually has no solutions, but has solutions for some b.
In other words, we are looking for a row vector x which is orthogonal to three given vectors,
namely the three rows of A. By Section 1, we have
It follows that if IAl = 0, the parallelepiped has zero volume, and therefore the origin vectors
a , b , c lie in a plane. Any non-zero vector x which is orthogonal to this plane will then be
orthogonal to a,b, c, and therefore will be a solution to the system (24). This proves (22):
if JAl = 0, then A x = 0 has a nontrivial solution.
10 18.02 NOTES
Partial proof of (23). We write the system as A x = d , where d is the column vector
d = (dl, d2, d3)T .
Writing this out as we did in (24), it becomes the system
If IAl = 0, the three origin vectors a , b, c lie in a plane, which means we can write one of
them, say c, as a linear combination of a and b:
Now if x is also a solution to (25), we see from (25) and (27) that
this shows that unless the components of d satisfy the relation (28), there cannot be a
solution to (25); thus in general there are no solutions.
If however, d does satisfy the relation (28), then the last equation in (25) is a conse-
quence of the first two and can be discarded, and we get a system of two equations in three
unknowns, which will in general have a non-zero solution, unless they represent two planes
which are parallel.
Exercises: Section 1H