Matrix Vector Form
Matrix Vector Form
Matrix Vector Form
warning
In example 1, do not write q = A. The quadratic form does not equal a matrix (q is
x
ÛT Û Û 1
a scalar quantity, not a matrix). What q does equal is x Ax where x = »
x4
example 2
2 3 5
If q has matrix 3 7 -2 then q = 2x2 + 7y2 + 12 z2 + 6xy + 10xz - 4yz.
5 -2 1/2
page 2 of Section 9.1
u1 v1 w1
P = u2 v2 w2
u v3 w3
3
Then the new matrix for q in the new coord system with variables X,Y,Z and
basis vectors u,v,w is given by
new = PT old P
example 3
Suppose
(3) q = x2 + 6xy + y2.
Let
u = i + 2j
v = -i + 2j
Find the matrix for q w.r.t. basis u,v and express q in terms of new coordinates X
and Y.
solution method 1 (using an algebraic substitution)
Let
1 -1
P =
2 2
The old coordinates x,y and new coordinates X,Y are related by
[ xy ] = P [ XY ]
so
x = X - Y
y = 2X + 2Y
17 3
The matrix for q w.r.t. basis u,v is .
3 -7
method 2 (using the basis changing rule for the matrix of a quadratic form)
The matrix for q (w.r.t. the standard coord system) is A = [ 13 3
1 ].
By the basis changing rule above, the new matrix for q is
page 3 of Section 9.1
1 2 1 3 1 -1 17 3
PT AP = 3 2 = 3
-1 2 1 2 -7
X T X
= P Y A P Y by the basis changing rule
Z Z for coords of a vector
X
= [ X Y Z ]
PTAP Y
Z by T rule
warning
1. The matrix of a quadratic form must be symmetric.
2. If A is symmetric then PTAP is also symmetric.
If yours isn't, check your arithmetic.
Remember from Section 6.2 that P-1 AP and A are called similar (whether or not A is
symmetric).
The matrix P-1AP represents the same linear transformation as A but w.r.t. a new
basis consisting of the cols of P.
If the matrix P is orthogonal, which happens when the new basis is orthonormal,
then PT = P-1 and congruence is the same as similarity.
mathematical catechism
question 1 What is a quadratic form.
answer A quadratic form say in variables x1, x2, x3, x4 is an expression of the form
2 2 2 2
a1x1 + a2x2 + a3x3 + a4x4 + cross terms like b1x1x2, b2x1x3 etc.
question 2 What is the matrix of a quadratic form.
answer The matrix of a quadratic form in variables x1,..., xn is the symmetric
page 4 of Section 9.1
x1
matrix A such that q = [x1 ... xn] A »
xn
Find the matrix A for q and write q in terms of A using matrix notation.
2 3 4
2. Write out the quadratic form which has matrix 3 6 7 .
4 7 9
page 5 of Section 9.1
2
3. Suppose q = x2 + 3x4 x5. Find the matrix for q.
1 2 3 4
2 5
4. Find the quadratic form with matrix 3 0
0 0 .
0 -3
4 0 -3 6
5. Let
q = x2 + 4xy + 3y2
Û Û Û
u = 3i + j
Û Û Û
v = 2i - j.
(a) Find the new formula for q w.r.t. the basis u,v using the basis changing rule
for a quadratic form.
(b) Find the new formula for q w.r.t. the basis u,v again using an algebraic
substitution.
(c) Suppose a point has coords X=1, Y=2 w.r.t. basis u,v.
Find the value of q at the point two ways, using its X,Y coordinates and then
again using its x,y coordinates.
X = x - y
Y = x + y
x = 2X - Y
y = X + 3Y
8. Suppose the X—axis is the same as the x—axis and the Y—axis is found by rotating
the y—axis clockwise 45o. Use the basis changing rule for a quadratic form to find
(a) the new formula for q = x2 + y2.
(b) the old formula for q = XY.
(c) the equation of the circle x2 + y2 = 1 in the new system.
diagonalizing q
Start with a quadratic form q, in say 3 variables, with matrix A.
Diagonalizing q means finding a new X,Y,Z coord system in which the formula for q
has no cross terms, i.e., is of the form aX2 + bY2 + cZ2.
Equivalently, diagonalizing q means finding an invertible matrix P so that the
T
P AP, the new matrix for q, is diagonal.
In other words, the new matrix for q w.r.t. the new basis is
¬1 0 0
Ò = 0 ¬2 0
0 0 ¬3
proof
Let u,v,w be the orthonormal eigenvectors and let P be the matrix with cols u,v,w.
Then
new matrix for q = PT AP basis changing rule for q
-1
= P AP P is an orthog matrix since its cols are orthonormal
= Ò by (1) in Section 8.3
example 1
Let
(1) q = 5x2 + 8y2 + 5z2 - 4xy + 8xz + 4yz
x X
y = P Y
z Z
where P = [r s ]
t
2 1
x = 3 X + Z
√45
1 2 2
y = 3 x + Y - Z
5
√ 45
√
2 1 4
z = - 3 X + Y + Z
5
√ 45
√
As a check, if you substitute for x,y,z in (1) you should get the new version of q
in (2):
2 1 1 2 2 2 1 4
q = 5( 3 X + Z)2 + 8( 3 x + Y - Z)2 + 5(- 3 X + Y + Z)2
45
√ 45
√ 45
√ 5
√ 45
√
2 1 1 2 2
- 4( 3 X + Z)( 3 x + Y - Z)
45
√ 45
√ 45
√
2 1 2 1 4
+ 8( 3 X + Z)(- 3 X + Y + Z)
√45 5
√ 45
√
1 2 2 2 1 4
+ 4( 3 X + Y - Z)(- 3 X + Y + Z)
45
√ 45
√ 5
√ 45
√
= 9Y2 + 9Z2
warning
You need orthonormal eigenvectors to get q to be ¬1X2 + ¬2Y2 + ¬3Z2. In example 1,
if you use the original eigenvectors u,v,w (v and w are not orthog) as a basis, you
won't get a diagonal q. And if you use eigenectors u, v1, w1 (orthogonal but not
normalized) you will get a diagonal q but not ¬1X2 + ¬2Y2 + ¬3Z2.
example 2
Diagonalize q = 3x2 + 3y2 + 2xy.
Find the new basis vectors and the change of variable that produces the diagonal q.
solution The matrix for q is
A =
3 1
1 3 [ ]
The eigenvalues are 2,4 with respective eigenvectors r = (1,-1), s = (1,1). They are
orthog since A is symmetric. Normalize them to get
1 1 1 1
u = ( , - ), v = ( , ).
2
√ √ 2 2 √ 2
√
In the new coord system with basis u,v,
q = 2X2 + 4Y2.
[ xy ]= P[ XY ] where P = [u
1 1
]
v
x = X + Y
2
√ 2
√
1 1
y = - X + Y
2
√ 2
√
warning
Don't forget to use orthonormal eigenvectors if you claim that q = ¬1X2 + ¬2Y2.
Remember to normalize!
page 3 of Section 9.2
example 2 continued
Identify the graph of
3x2 + 3y2 + 2xy = 2
solution In the new X,Y cord system with basis u,v, the equation is
2X2 + 4Y2 = 2
y-axis
Y-axis
((-1,0))•
• ((0, 1
2
))
x-axis
1
((0, - 2
)) •
• ((1,0))
X-axis
FIG 1
warning
Example 2 involved the quadratic form q = 3x2 + 3y2 + 2xy. The ellipse in Fig 1 is
not the graph of q. It's the graph of the equation q = 2 (the ellipse is actually one
of the level sets of q).
R6 = 3R1 + R6
C6 = 3C1 + C6
Note that row/col operations preserve symmetry; i.e., if you row/col operate on a
symmetric matrix, the result is also symmetric.
Let A be the matrix of a quadratic form q w.r.t. the standard basis i,j,k.
Do some row/col ops on A to get matrix B.
Do just the col ops to I to get a new matrix P.
Then B is the matrix of q w.r.t. a new basis consisting of the cols of P.
proof
Each col op corresponds to right multiplication by an elementary matrix (±1.3).
Each row op corresponds to left mult by an elem matrix.
When the operations are matching, the elem matrices turn out to be transposes of
one another.
So row/col operations on A (say there are three of them) and the col ops on I
amount to the scheme in Fig 2 where
page 4 of Section 9.2
T T T
B = E3E2E1 AE1E2E3 P = IE1E2E3 = E1E2E3
FIG 2
example 3
Let q = 2x2 + 5y2 + 6z2 + 8xy + 4xz + 2yz.
Let A be the matrix for q. To diagonalize q using row/col ops, do the following
row/col ops to A and do just the col ops to I.
2 4 2 1 0 0
start with A = 4 5 1 start with I = 0 1 0
2 1 6 0 0 1
R2 = -2R1 + R2 2 4 2 2 0 2 1 -2 0
C2 = -2C1 + C2 0 -3 -3 0 -3 -3 0 1 0
2 1 6 2 -3 6 0 0 1
R3 = R1 + R3 2 0 2 2 0 0 1 -2 -1
C3 = C1 + C3 0 -3 -3 0 -3 -3 0 1 0
0 -3 4 0 -3 4 0 0 1
R3 = -R2 + R3 2 0 0 2 0 0 1 -2 1
C3 = -C2 + C3 0 -3 -3 0 -3 0 0 1 -1
0 0 7 0 0 7 0 0 1
After every step, you get a new symmetric matrix in the A column and a new set of
basis col vectors in the I col. Each of the symmetric matrices represents q w.r.t.
the new basis. For instance, after the first row/col op you know (but it isn't very
page 5 of Section 9.2
useful) that
q = 2X2 - 3Y2 + 6Z2 + 4XZ - 6YZ
in the new coord system with basis vectors (1,0,0), (-2,1,0), (0,0,1).
At the end you know (very useful) that
q = 2X2 - 3Y2 + 7Z2
so q does come out to be 2X2 - 3Y2 + 7Z2 in the coord system with basis u,v,w.
warning
In example 3, the diagonal coeffs 2,-3,7 are not eigenvalues of A and the cols of P
are not eigenvectors. This was a different method of diagonalizing.
1 2 1 1 1 1
( , 0, 0 ), (- , , 0 ), ( , - , )
2
√ 3 √
√ 3 7
√ √ 7 √7
1 1 1 2 2 2
q = 2( X1)2 - 3( Y1)2 + 7( Z1)2 = X1 - Y1 + Z1.
2
√ 3
√ 7
√
This substitution amounts to changing the scale on the X,Y,Z axes, i.e., to
getting new basis vectors by multiplying the latest basis vectors by 1/√2,
1/
√ 3 and 1/√ 7 respectively (Section 2.4).
a generalization of the row/col operation rule for getting a new matrix for q
old rule
(This works whether or not you have reached a diagonal matrix on the left side
although that's usually what you're aiming for.)
The more general version says you don't have to start at the "beginning", with the
matrix for q w.r.t. the usual basis i,j,k.
solution
2 1 1 2
q = 2X2 - 3Y2 w.r.t. basis u = ( , ), v = (- , ).
5 √
√ 5 5 √
√ 5
Now pick up where the eigenvalue method left off and use row/col ops to make q
diagonal with diagonal coeffs –1's.
solution
matrix for q w.r.t. basis u,v [u v]
2 0 2/√ 5 -1/√ 5
0 -3 -1/√ 5 2/√ 5
Do these row /col ops on the left side and the col ops on the right side:
1 1
R1 = R , C = C
2 1 1 2 1
√
1 1
R2 = R2, C2 = C
3
√ 3 2
√
page 7 of Section 9.2
You get
1 0 √
2/5 -1/√ 5
0 -1 1/√10 2/√15
X2 Y2
+ = 1
4 9
is a (non—circular) ellipse with vertices (0, –3); the Y—axis is the major axis, the
X—axis is the minor axis. But in a non—orthonormal system all you can conclude is
that it is either a circle or an ellipse. Even if it is an ellipse, the points
(0, –3) are not necessarily vertices, the X—axis and Y—axis are not necessarily the
axes of the ellipse (Fig 2).
So to distinguish a hyperbola from an ellipse/circle, any diagonalization method
is OK. But to graph accurately and locate vertices and axes of the conic and
distinguish circles from non—circular ellipses, you have to use the eigenvector
method to get q diagonal in a new orthonormal coord system.
y
vertex Y
•
• ((0,3))
X
x
((0,-3))•
•
vertex
X2 Y2
possible graph of + = 1
4 9
FIG 2
example 4
Suppose q is a function of four variables and in some coord system q is
2 2 2
2X1 + 5X3 - 7X4. Then every diagonalization of q has two positive coeffs, one
negative coeff and one zero coeff. And the matrix for q has two positive
eigenvalues, one negative eigenvalue (not necessarily 2,5 and -7 though) and one
zero eigenvalue.
q = 3 [ x2 + (y + 2z)x ] + y2 + 4z2
The coeff of x in the bracket is y+2z. Take half the coeff, square it and add it
on to complete the square.
q = 3
[ x2 + (y+2z)x + (y+2z
2
)
2
] + y2 + 4z2 - 3 (
y+2z 2
2
)
2
[ 2 ] + y2 - 3yz + z2
= 3 x +
y+2z 1
4
2 2
[
= 3 x +
y+2z
2 ] [1
+ 4 y - 6z - 8z2]
Now let
y+2z
(4) X = x + , Y = y - 6z, Z = z.
2
Then
1
(5) q = 3X2 + 4 Y2 -8Z2
If you want the basis vectors corresponding to the new coords X,Y,Z, write (4) in
matrix form:
X 1 1/2 1 x
Y = 0 1 -6 y
Z 0 0 1 z
P-1
Invert to get
page 9 of Section 9.2
2 -1/2 -4
(6) P = 0 1 6
0 0 1
2. (a) Sketch the graph of 2x2 + 2y2 + 3z2 + 4xy+ 2xz + 2yz = 9 by switching to a
new orthonormal coord system.
The eigenvalues you need come out to be 2,5,0 with corresponding eigenvectors
u = (-1,-1,2), v = (1,1,1), w = (1,-1,0).
(b) Why did you need eigenvalues in part (a). Wouldn't row/col ops or completing the
square also have worked.
(c) What change of variables did you use in part (a). Express x,y,z in terms of X,Y,Z
and vice versa.
(d) Repeat part (a) but change the 9 on the righthand side to -9.
1 1 2
4. Let q have matrix A = 1 3 5 .
2 5 9
(a) Diagonalize q using row/col ops and make the diagonal coeffs –1's.
(b) What change of variable produced the diagonal q in part (a).
2 0 2
5. Let A = 0 1 3 .
2 3 4
Without computing the eigenvalues, find their sign distribution (how many positives
and how many negatives).
6. Suppose q has matrix A and the eigenvalues of A are 1/3 and -4 with corresponding
eigenvectors u = (-4,3), v = (3,4).
Diagonalize q so that the coeffs are –1's, and find the new basis vectors.
7. Diagonalize q by completing the square and find the new basis vectors.
(a) q = x2 + 4xy - 2y2
(b) q = 2x2 + 3xy + y2
(c) q = 3x2 - 6y2 + z2 + 6xy + 18xz
(d) q = 3x2 + y2 + 4z2 + 2xy + 5xz + 6yz
page 1 of Section 9.3
negative definiteness
Let q be a quadratic form with matrix A (necessarily symmetric)
The following are equivalent (either all happen or none happen).
When they do happen then q and A are called negative definite.
Û
(1) q is negative at every point (x,y,z) except at the origin 0 (where q = 0).
(2) In every diagonal version of q, the coeffs are negative.
In particular if you use row/col ops on A to get a diagonal matrix, the diagonal
entries are negative.
indefiniteness
If q and A are none of the above then they are called indefinite.
For each kind of definiteness, the equivalence of (1)-(3) follows from the
preceding sections.
The proof that (4) belongs on the list with (1)-(3) is too messy.
example 1
Let q = x2 - 3y2 + 7xy. Find the definiteness of q.
[ 1
7/2 -3
7/2
]
The pm's are 1, -61/4 which makes q indefinite.
7
method 3 Start with the matrix for q and diagonalize it by adding - 2 row1 to
7
row2 and adding - 2 col1 to col2 to get
[ 10 0
-61/4 ]
61
In another coord system (I don't care about the basis vectors), q = X2 - 4 Y2. There
is one positive and one negative coeff. So q is indefinite.
-8 – 4√65
method 4 The matrix for q has eigenvalues . One is positive and one is
8
negative. So q is indefinite.
page 3 of Section 9.3
1. Let
2 1 1
A = 1 1 0
1 0 1
6. Suppose q has matrix A, say 3 ≈ 3. What can you conclude about the definiteness
of A, the eigenvalues of A, and |A| if
(a) in some new coord system, q = -2X2 - 3Y2 - 5Z2
(b) in some new coord system, q = X2 - 2Y2 + Z2
a b c
11. Let A = b d e . True or False.
c e f
(a) If A is positive definite then the diagonal entries a,d,f are positive.
(b) If the diagonal entries a,d,f are positive then A is positive definite.
SUMMARY OF BASIS CHANGING AND DIAGONALIZING
Read this before the 3rd exam and then again before the final exam.
coords
new
coords
old
of = P-1 of
vector
the vector
a
new Matrix for T = P-1 oldMatrix P (the old and new matrices are called similar)
new Matrix for q = PT oldMatrix P (the old and new matrices are called congruent)
warning
The rule involves PT when you get a new matrix for a quadratic form.
The rule involves P-1 when you get a new matrix for a transformation.
(If the new coord system is orthonormal then PT = P-1.)
diagonalizing a matrix
Diagonalizing M means finding a diagonal matrix Ò and an invertible matrix P so
that P-1MP = Ò.
Equivalently, diagonalizing M means finding a new basis so that the transformation
which has matrix M w.r.t. the standard basis will have a diagonal matrix Ò w.r.t.
the new basis.
There is only one method. The columns of P must be eigenvectors of M and the
diagonal entries of Ò are the corresponding eigenvalues of M.
Not all matrices can be diagonalized (only the ones that have a complete set of
eigenvectors).
Hermitian matrices are not only diagonalizable but you can do it with a real
Ò and a unitary P provided you take the trouble to choose orthogonal normalized
eigenvectors.
(c) Sketch the graph of 2x2 - 4xy + 5y2 = 7 and identify some of its significant
features (in the old coord system).
2. Let
2 -1 1
A = -1 2 -1
1 -1 2
5. Let A be symmetric.
If row/col ops turn A into B and the col ops turn I into M, how are A,B,M related.