Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Diagonalizing a Quadratic Form: Changing the Basis and Finding Eigenvectors, Lecture notes of Algebra

How to diagonalize a quadratic form by changing the basis and finding eigenvectors. It includes examples and proofs of the basis changing rule and the diagonalization method using eigenvalues. The document also covers the connection between the old and new matrices for the quadratic form.

What you will learn

  • What is the difference between diagonalizing a matrix and diagonalizing a quadratic form?
  • What is the basis changing rule for a quadratic form?
  • How do you find the new formula for a quadratic form in a new coordinate system using the basis changing rule?
  • How do you diagonalize a quadratic form using eigenvalues?
  • What is the connection between the old and new matrices for a quadratic form after a basis change?

Typology: Lecture notes

2021/2022

Uploaded on 09/27/2022

riciard
riciard 🇬🇧

4.4

(7)

234 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
page 1 of Section 9.1
CHAPTER 9 QUADRATIC FORMS
SECTION 9.1 THE MATRIX OF A QUADRATIC FORM
quadratic forms and their matrix notation
Ifq=a
1x2+a
2y2+a
3z2+a
4xy+a
5xz+a
6yz
then q is called a quadratic form (in variables x,y,z). There is a q value (a
scalar) at every point. (To a physicist, q is probably the energy of a system with
ingredients x,y,z.)
The matrix for q is
A=
a11
2a41
2a5
1
2a4a21
2a6
1
2a51
2a6a3
It's the symmetric matrix A with this connection to q:
(1) q = []
xyz A
x
y
z
or equivalently
(2) q = xÛTAx
Ûwhere xÛ=
x
y
z
example 1
Ifq=3x
2
1+6x
2
2-7x
2
3x
2
4-
2x
1x2+8x
1x3x
3x4+ 10x2x4-1
2x1x4
then the matrix for q is
A=
3-
2/2 4 -1/4
-
2/2 6 0 5
4 0 -7 π/2
-1/4 5 π/2 π
warning
In example 1, do
not
writeq=A.Thequadratic form does not
equal
a matrix (q is
a scalar quantity, not a matrix). What q
does
equal is xÛTAxÛwhere xÛ=
x1
»
x4
example 2
If q has matrix
23 5
37-2
5 -2 1/2 thenq=2x
2+7y
2+1
2z2+ 6xy + 10xz - 4yz.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Diagonalizing a Quadratic Form: Changing the Basis and Finding Eigenvectors and more Lecture notes Algebra in PDF only on Docsity!

CHAPTER 9 QUADRATIC FORMS
SECTION 9.1 THE MATRIX OF A QUADRATIC FORM

quadratic forms and their matrix notation

If q = a 1 x^2 + a 2 y^2 + a 3 z^2 + a 4 xy + a 5 xz + a 6 yz

then q is called a quadratic form (in variables x,y,z). There is a q value (a scalar) at every point. (To a physicist, q is probably the energy of a system with ingredients x,y,z.) The matrix for q is

A =

a 1 

1 2 a 4

1 2 a 5 1 2 a 4 a 2

1 2 a 6 1 2 a 5

1 2 a 6 a 3

It's the symmetric matrix A with this connection to q:

(1) q = [x y z] A

x

y z

or equivalently

(2) q = x

Û T A x

Û where x

Û

x

y z

example 1

If q = 3x

2 1 + 6x

2 2 - 7x

2 3 +^ πx

2

4 -^ √^ 2 x 1 x 2 + 8x 1 x 3 + πx 3 x 4 + 10x 2 x 4 -^

1 2 x 1 x 4 then the matrix for q is

A =

  • √ 2/2 6 0 5 4 0 -7 π/ -1/4 5 π/2 π

warning In example 1, do not write q = A. The quadratic form does not equal a matrix (q is

a scalar quantity, not a matrix). What q does equal is x

Û T Ax

Û where x

Û

x 

1 » x 4

example 2

If q has matrix

3 7 - 5 -2 1/

then q = 2x^2 + 7y^2 +

1 2 z

(^2) + 6xy + 10xz - 4yz.

basis changing rule for the matrix of a quadratic form

Suppose q is a quadratic form in variables x,y,z with (old) matrix A. Let

u = u 1 i + u 2 j + u 3 k v = v 1 i + v 2 j + v 3 k w = w 1 i + w 2 j + w 3 k

be a new basis for R^3. Let P be the usual basis—changing matrix:

P =

u 1 v 1 w 1 

u 2 v 2 w 2 u 3 v 3 w 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 = x^2 + 6xy + y^2.

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

P =

2 2

The old coordinates x,y and new coordinates X,Y are related by

[ ]

x y = P^ [ ]

X Y

so x = X - Y y = 2X + 2Y

Substitute for x and y in (3):

q = (X-Y)^2 + 6(X-Y)(2X+2Y) + (2X+2Y)^2.

Multiply out and collect terms to get q in terms of X and Y:

q = 17X^2 + 6XY - 7Y^2.

The matrix for q w.r.t. basis u,v is

3 -

.

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 = (^) [ ]

1 3 3 1.

By the basis changing rule above, the new matrix for q is

matrix A such that q = [x 1 ... xn] A

x 

1 » xn

question 3 What are congruent matrices. answer Matrices A and B are congruent if A is symmetric and there exists an

invertible matrix P such that B = PTAP (this automatically makes B symmetric too).

question 4 What are similar matrices. answer Matrices A and B are similar if there exists a matrix P such that B = P-1AP.

PROBLEMS FOR SECTION 9.

  1. Let q = x^2 + 3y^2 + 8z^2 - 3xy - 4yz.

Find the matrix A for q and write q in terms of A using matrix notation.

  1. Write out the quadratic form which has matrix

3 6 7 4 7 9

.

  1. Suppose q = x

2 2 + 3x 4 x 5. Find the matrix for q.

  1. Find the quadratic form with matrix

2 5 0 0 3 0 0 - 4 0 -3 6

.

  1. Let

q = x^2 + 4xy + 3y^2

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.

  1. Start with q = x^2 + 3xy - 5y^2 and make the change of variable

X = x - y Y = x + y

(a) Find q in terms of X and Y just with algebra. (b) What new basis is involved when you use variables X and Y. (c) Find q in terms of X and Y again using the basis changing rule for q. (d) Find the (old) matrix for q. What is the connection between q and the old matrix (write an equation beginning "q = "). (e) Find the new matrix for q. What is the connection between q and the new matrix (write an equation beginning "q = "). (f) What's the connection between the old matrix for q and the new matrix for q.

  1. Start with q = x^2 + 4xy - y^2 and make the change of variable

x = 2X - Y y = X + 3Y

(a) Find q in terms of X and Y just with algebra. (b) What new basis is involved when you use coordinates X and Y. (c) Find q in terms of X and Y again using the basis changing rule for q.

  1. 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 = x^2 + y^2. (b) the old formula for q = XY. (c) the equation of the circle x^2 + y^2 = 1 in the new system.

  1. In the usual x,y coord system, q is 2x^2 + 3xy + 4y^2. Switch to a new X,Y coord system which has the same axes as before but new scales. If the old scale was the inch, on the new X-axis use the foot and on the new Y-axis use a half—inch. Find q in the new coord system.

x

y z

= P

X

Y
Z

where P = (^) [ r s t]

x =

2 3 X +^

1

Z

y =

1 3 x +^

2

Y -

2

Z

z = -

2 3 X +^

1

Y +

4

Z

As a check, if you substitute for x,y,z in (1) you should get the new version of q in (2):

q = 5(

2 3 X +^

1

Z)^2 + 8(

1 3 x +^

2

Y -

2

Z)^2 + 5(-

2 3 X +^

1

Y +

4

Z)^2

2 3 X +^

1

Z)(

1 3 x +^

2

Y -

2

Z)

2 3 X +^

1

Z)(-

2 3 X +^

1

Y +

4

Z)

1 3 X +^

2

Y -

2

Z)(-

2 3 X +^

1

Y +

4

Z)
= 9Y^2 + 9Z^2

warning

You need orthonormal eigenvectors to get q to be ¬ 1 X^2 + ¬ 2 Y^2 + ¬ 3 Z^2. 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, v 1 , w 1 (orthogonal but not

normalized) you will get a diagonal q but not ¬ 1 X^2 + ¬ 2 Y^2 + ¬ 3 Z^2.

example 2

Diagonalize q = 3x^2 + 3y^2 + 2xy. Find the new basis vectors and the change of variable that produces the diagonal q. solution The matrix for q is

A = (^) [ ]

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

u = (

), v = (

In the new coord system with basis u,v,

q = 2X^2 + 4Y^2.

The change of variable is

[ ]

x y = P[ ]

X

Y where P =^ [u^ v]

x =

1

X +

1

Y

y = -

1

X +

1

Y

warning

Don't forget to use ortho normal eigenvectors if you claim that q = ¬ 1 X^2 + ¬ 2 Y^2. Remember to normalize!

example 2 continued Identify the graph of 3x^2 + 3y^2 + 2xy = 2

(temporarily obscured because of the cross term 2xy).

solution In the new X,Y cord system with basis u,v, the equation is

2X^2 + 4Y^2 = 2

so the graph is an ellipse (Fig 1).

1 2 )) x-axis

y-axis

Y-axis

X-axis

1 2 ))

FIG 1

warning

Example 2 involved the quadratic form q = 3x^2 + 3y^2 + 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).

row/col operations on a matrix A row/col operation is a pair of matching row and col ops such as

R 6 = 3R 1 + R 6 C 6 = 3C 1 + C 6

Note that row/col operations preserve symmetry; i.e., if you row/col operate on a symmetric matrix, the result is also symmetric.

row/col operation rule

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.

In other words, B = PTAP.

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

useful) that

q = 2X^2 - 3Y^2 + 6Z^2 + 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 = 2X^2 - 3Y^2 + 7Z^2

in the coord system with basis vectors

u = (1,0,0), v = (-2,1,0), w = (1,-1,1).

As a check, let P = (^) [u v w ]. Then

PTAP =

so q does come out to be 2X^2 - 3Y^2 + 7Z^2 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.

diagonalization process continued You can continue the diagonalization in example 3 so that the coeffs are –1's. Do some more row/col ops:

divide R 1 by √ 2; divide C 1 by √ 2

divide R 2 by √ 3; divide C 2 by √ 3

divide R 3 by √ 7; divide C 3 by √ 7

Do the col ops to P, where the earlier col ops left off. All in all, this turns A into 1 0 0 0 -1 0 0 0 1 and turns I into

So

q = X^2 - Y^2 + Z^2

in the coord system with basis vectors

footnote This continuation in example 3 can also be accomplished algebraically by going from the latest X,Y,Z coord system to a new X 1 , Y 1 ,

Z 1 coord system by substituting X =

X 1 , Y =
Y 1 , Z =

Z 1. You get

q = 2(

X 1 )^2 - 3(
Y 1 )^2 + 7(
Z 1 )^2 = X
1 - Y
1 + Z

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

Start here with the matrix of q Start with I, i.e., with [i j k] w.r.t.the usual basis i,j,k

Row/col operate on the left side. Col op on the right side. You end up on the left side with a new matrix for q w.r.t. a new basis consisting of the cols on the right side.

more general rule

Start here with the matrix of q Start here with [u v w] w.r.t. basis u,v,w

Row/col operate on the left side. Col op on the right side. You end up on the left side with a new matrix for q w.r.t. a new basis consisting of the cols on the right side.

(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.

example 4 (mixing two methods). Suppose the matrix (2 ≈ 2) for q has eigenvalues ¬ = 2, -3 with corresponding eigenvectors (2,1), (-1,2). Diagonalize q so that the diagonal coeffs are –1's and find the new basis.

solution

q = 2X^2 - 3Y^2 w.r.t. basis u = (

), v = (-

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]

Do these row /col ops on the left side and the col ops on the right side:

R 1 =
R 1 , C 1 =
C 1
R 2 =
R 2 , C 2 =
C 2

example 4 Suppose q is a function of four variables and in some coord system q is

2X

1 + 5X
3 - 7X
  1. 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.

third method for diagonalizing q: completing the square Look at the quadratic form

(3) q = 3x^2 + y^2 + 4z^2 + 3xy + 6xz

To diagonalize q, first collect the x terms like this:

q = 3[ x^2 + (y + 2z)x (^) ]+ y^2 + 4z^2

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 [ ]

x^2 + (y+2z)x + (

y+2z 2

  • y^2 + 4z^2 - 3 (

y+2z 2

[ ]

x +

y+2z 2

1 4 y

(^2) - 3yz + z 2

Now collect the y terms and complete the square again:

q = 3 [ ]

x +

y+2z 2

1 4 [y^ ]

(^2) - 12yz + z 2

The coeff of y in the second brackets is 12z. Take half the coeff, square it and add it on to complete the square.

q = 3 [ ]

x +

y+2z 2

1 4 [ y ]

(^2) - 12zy + 36z (^2) + z (^2) - 1 4 36z

[ ]

x +

y+2z 2

1 4 [ y - 6z]

  • 8z^2

Now let

(4) X = x +

y+2z 2

, Y = y - 6z, Z = z.

Then

(5) q = 3X^2 +

1 4 Y

2 -8Z 2

If you want the basis vectors corresponding to the new coords X,Y,Z, write (4) in matrix form:

X

Y
Z

x

y z

P-

Invert to get

(6) P =

The new basis vector are u = (2,0,0), v = (-1/2, 1, 0),(-4,6,1).

PROBLEMS FOR SECTION 9.
  1. (a) Let q = x^2 + 4xy - 2y^2. Use the eigenvalue method here. (i) Diagonalize q and find the basis for the new coord system in which q is diagonal. (ii) What change of variable produced the diagonal q. (iii) Find the old matrix for q and find the connection between q and the old matrix. (iv) Find the new matrix for q and find the connection between q and the new matrix. (v) What's the connection between the old matrix and the new matrix.

(b) Sketch the graph of x^2 + 4xy - 2y^2 = 2 and identify the major axis and vertices.

  1. (a) Sketch the graph of 2x^2 + 2y^2 + 3z^2 + 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.
  2. Let q = x^2 + 4xy - 2y^2. (a) Diagonalize q using row/col ops. (b) Find the change of variable that produces the diagonal q in part (a) and check that it really works.

(c) Check that the new matrix for q really is PT old P.

  1. Let q have matrix A =

(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).

  1. Let A =

Without computing the eigenvalues, find their sign distribution (how many positives and how many negatives).

  1. 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.
  2. Diagonalize q by completing the square and find the new basis vectors.

(a) q = x^2 + 4xy - 2y^2 (b) q = 2x^2 + 3xy + y^2 (c) q = 3x^2 - 6y^2 + z^2 + 6xy + 18xz (d) q = 3x^2 + y^2 + 4z^2 + 2xy + 5xz + 6yz

Let q be a quadratic form matrix with A (necessarily symmetric) The following are equivalent (either all happen or none happen). When they do happen then q and A are called non—positive definite or negative semi—definite. (1) q ≤ 0 at every point. (2) In any diagonal version of q, the coeffs are ≤ 0. In particular if you use row/col ops on A to get a diagonal matrix, the diagonal entries are ≤ 0.

(3) The eigenvalues of A are ≤ 0. (4) The pm's of A starting with the most northwesterly are ≤ 0, ≥ 0, ≤ 0, ≥ 0, etc.

The categories negative definite and negative semi—definite overlap: If A is negative definite then it is also negative semi—definite.

If in addition to (1)-(4) above, q actually is 0 somewhere besides the origin or in some diagonal version of q one of the coeffs actually is 0 or one of the eigenvalues of A actually is 0 or one of the pm's actually is 0 then q and A are negative semi— definite but not negative definite.

indefiniteness If q and A are none of the above then they are called indefinite.

Only symmetric matrices are assigned a definiteness. So if a matrix is called positive, positive semi, neg, negative semi or indefinite you may assume that the matrix is symmetric to begin with.

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 = x^2 - 3y^2 + 7xy. Find the definiteness of q.

method 1 If x = 0, y = 1 then q =-3, negative. If y=0 and x = 1 then q = 1, positive. So by inspection, q is indefinite. (But it's not always this easy to find the definiteness by inspection.)

method 2 The matrix for q is

[ ]

The pm's are 1, -61/4 which makes q indefinite.

method 3 Start with the matrix for q and diagonalize it by adding -

7 2 row1 to

row2 and adding -

7 2 col1 to col2 to get

[ ]

In another coord system (I don't care about the basis vectors), q = X^2 -

61 4 Y

(^2). There

is one positive and one negative coeff. So q is indefinite.

method 4 The matrix for q has eigenvalues

. One is positive and one is

negative. So q is indefinite.

PROBLEMS FOR SECTION 9.
  1. Let
A =

Find the definiteness of A with several methods, for practice.

2. Find the definiteness. (a) [ ]

1 2 (b)^ [ ]

  1. True or False. If q is a quadratic form with all positive coeffs (e.g.,

q = ax^2 + bxy + cy^2 where a,b,c are positive) then q is positive definite.

  1. Show that if A is negative definite then -A is positive definite (a) using (1) on the lists (b) using (4) on the lists
  2. Suppose A is positive definite. What about 3A.
  3. 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 = -2X^2 - 3Y^2 - 5Z^2 (b) in some new coord system, q = X^2 - 2Y^2 + Z^2

  1. Let B be an arbitrary matrix.

(a) Show that BTB is symmetric.

(b) Let q be the quadratic form with matrix BTB. Write q in matrix notation.

(c) Show that BTB is positive semi—definite by continuing from part (b) with matrix algebra until you can see that q ≥ 0.

Suggestion: Use the fact that for column vectors u and v, u…v = uTv (Section 2.1).

  1. Suppose A is symmetric. True or False. (a) If A is positive definite then |A| is positive (b) If |A| is positive then A is positive definite.
  2. Let q = 2x^2 + 3y^2 + bxy. For what values of b will q be (a) positive definite (b) positive semi—definite (c) positive semi—definite but not positive definite (i.e., only positive semi—definite) (d) indefinite (e) negative definite
  3. (a) Show that if A is positive definite then A is invertible. (b) Is the converse true? (c) Suppose A is positive definite (so that by part (a), it is invertible). Show that the inverse must also be positive definite by thinking further about the

eigenvalues of A-1.

  1. Let A =

a b c

b d e c e f

. True or False.

(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.

warning To diagonalize q, you don't have to use eigenvectors at all. And the coeffs of the square terms in the new coord system don't have to be eigenvalues.

But if you want to turn q into ¬ 1 X^2 + ¬ 2 Y^2 + ¬ 3 Z^2 , you must not only use

eigenvectors as the new basis then you must use orthonormal eigenvectors. To diagonalize a matrix M you must use eigenvectors but they don't have to be orthogonal or unit length. It's just convenient if they are.

page 1 of review problems for chapter 9

REVIEW PROBLEMS FOR CHAPTER 9

  1. Let q = 2x^2 - 4xy + 5y^2

(a) Find the new formula for q in the coord system with basis u = 2i, v =

1 3 j twice. (i) Find the connection between X,Y and x,y and then use algebra (ii) Use the basis changing rule

(b) Diagonalize q using three different methods.

(c) Sketch the graph of 2x^2 - 4xy + 5y^2 = 7 and identify some of its significant features (in the old coord system).

  1. Let

A =

-1 2 - 1 -1 2

(a) Use two methods to show that A is positive definite.

(b) Find an invertible P so that PTAP = I.

  1. Suppose a quadratic form in variables x 1 , x 2 , x 3 has matrix A.

Let x

Û

x 1 

x 2 x 3

. Write the equation relating q,A, and x

Û .

  1. Show that if A is congruent to B then |AB| ≥ 0.
  2. 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.
  3. Suppose q = x^2 - y^2 + 3xy in the standard coord system, and q = -2X^2 + 3Y^2 in another coord system with basis vectors u,v. Find the old matrix for q, the new matrix for q and write an equation relating the two matrices.