Bilinear and quadratic forms — exam-style exercises with a deceptive ramp, a parameter Sylvester cannot settle and a dot product that is not one (and the basis read off the columns)
In a class mock exam I classified a quadratic form as indefinite with total confidence, and it was positive definite. The mistake was in the matrix, not in the classification: I had put the whole cross term in both entries, came out negative and I concluded from that. My Sylvester sums were perfect, on the wrong matrix. That slip is the first snippet in «What is wrong here?», and in this topic it is the one that costs the most marks.
Table of Contents
How to use this article
First of all, how this counts in the AG exam. The exam mark is : is a 20-question test taken from the Campus quizzes and is written exercises. If , the final mark is (the quizzes and the lab assignments, up to 1.5 points each); otherwise, the final mark is . The sums are done for you in the AG grade calculator.
In recent years’ exams, bilinear forms have an exercise of their own: write the quadratic form, diagonalise it with a basis of conjugate vectors, classify it and, if it is a dot product, compute a cosine; sometimes also the subspace conjugate to a vector. Here you have exercises in that format (with points and marking criteria), the last one exactly as it appears, and a 20-question quiz like the Campus one for the T part.
- Do each exercise on paper, without a calculator, with every congruence operation written out (the row one and the column one).
- Compare with the expected result and, if it does not match, open the hint before looking at the solution.
- Read «What is wrong here?» trying to find the mistake yourself before reading the explanation.
- Take the quiz at the end and check everything in MATLAB.
- If you get stuck on method, go back to the guided practice, which has the same kinds of problem solved step by step.
With a symmetric 2 × 2 matrix, the Plane transformations simulator draws the curve and tells you whether the form is definite, semidefinite or indefinite: handy for seeing the exercises in two dimensions.
Exercise 1 (basic level): a deceptive ramp
Exercise 1. [3 points] Let . a) (1 point) Write its matrix and its polar form. b) (0.5 points) Compute a basis of the subspace of vectors conjugate to . c) (1.5 points) Diagonalise by congruence, give the basis and classify it.
Expected result: ; the conjugates of form the line of ; and the form is indefinite, even though both squares have positive coefficients.
In c), to remove the below the 3, the operation is . Thirds appear; do not panic. And check the result by finding a vector with .
Exercise 2 (intermediate level): a parameter Sylvester cannot settle
Exercise 2. [4 points] For each , let . a) (1 point) Write its matrix and explain why Sylvester’s criterion cannot classify it. b) (2 points) Diagonalise it by congruence and classify it depending on the values of . c) (1 point) For , give a vector with and a non-zero vector with .
Expected result: for every ; ; positive semidefinite if and indefinite if . It is never definite.
is a perfect square. Think about its value at the vector .
Exercise 3 (challenge): this is how it appears in the exam
Exercise 3. [9 points] On , let the bilinear form be . a) (4 points) Classify the quadratic form associated with and find a basis in which the matrix of is diagonal. b) (2 points) Find a basis of the subspace of vectors conjugate to . c) (3 points) Study whether is a dot product; if it is, compute the cosine of the angle between and , and if it is not, give a non-zero vector with .
Expected result: , signature , indefinite; is the plane ; it is not a dot product, and the third basis vector works as a vector with .
In a), the leading principal minors tell you in ten seconds whether it is definite. It is not: so you have to diagonalise. In b), the equation is the second row of .
What is wrong here?
Three classmates’ solutions with one mistake each. Read the solution, try to find the flaw and then read the explanation.
Snippet 1: the whole cross term
w = x^2 + 4xy + 5y^2
A = | 1 4 | Delta_1 = 1 > 0
| 4 5 | Delta_2 = 5 - 16 = -11 < 0
Since Delta_2 < 0, it is not positive definite. It is indefinite.
Predict: what type of form is it?
Positive definite. The term is shared between two entries, and : , with and , both positive. With the badly written matrix, , which is a different form (that one is indefinite). In fact, , a sum of squares that is 0 only at the origin.
Copying the coefficient of the cross term into both entries. Always check the matrix with expand([x y]*A*[x; y]) or by multiplying by hand: the statement must come back out.
Snippet 2: Sylvester backwards
w = -2x^2 + 2xy - y^2 - z^2
A = | -2 1 0 | Delta_1 = -2
| 1 -1 0 | Delta_2 = 2 - 1 = 1
| 0 0 -1 | Delta_3 = -1
To be negative definite, all minors would have to be negative.
Delta_2 = 1 is positive, so it is indefinite.
Predict: is it negative definite?
Yes. The criterion for negative definite is not «all negative», but alternating starting with negative: odd orders negative and even orders positive. Here, , and : exactly the pattern. Check: for any non-zero vector.
«all negative». A matrix with a negative diagonal, such as , has a positive determinant: . That is why the even-order minors of a negative definite form are positive.
Snippet 3: the basis read off the columns
w = x^2 - 2xy + 3y^2, A = | 1 -1 |
| -1 3 |
( 1 -1 | 1 0 ) r2 -> r2 + r1 ( 1 -1 | 1 0 ) c2 -> c2 + c1 ( 1 0 | 1 0 )
(-1 3 | 0 1 ) -------------> ( 0 2 | 1 1 ) -------------> ( 0 2 | 1 1 )
D = diag(1, 2). B' = columns on the right = {(1, 1), (0, 1)}
Predict: is the basis correct?
No. The diagonalisation is right, but on the right you are left with , and the basis vectors are its rows: . With the column basis, and are not conjugate: . With the right one, .
To check you read the basis correctly, compute of the last vector: it must give the last number of . Here, . With the wrong vector you get 3.
Solutions
Exercise 1
a) Squares on the diagonal and split into and :
b) The row of is the first row of : . A line, with basis . Check: .
For c), the approach before the calculation. Diagonalising by congruence means reducing while repeating each row operation on the columns, so that it stays symmetric: at the end, is left on the left. The identity on the right only gets the row operations, and its rows end up being the vectors of .
Why not the obvious route? There are two temptations:
- Looking at the coefficients: and are positive, so it “looks” positive definite. That is the deceptive ramp: the cross term counts too, and here it weighs more than the squares.
- Finding the eigenvalues, as in the previous topic: . One positive and one negative, the same classification, but with roots, and the question asks for congruence and the basis .
The calculation below, with the reason for each step:
| Step | Operation | What changes | Why |
|---|---|---|---|
| 1 | Row 2 becomes on the left and on the right | The pivot is the 3 and the has to go: | |
| 2 | Entry becomes 0 | The same operation on the columns restores the symmetry; the right-hand part is not touched |
c) With and :
Entry : .
Signature : indefinite. It is a saddle even though both squares are positive. Check: , and with a fraction-free vector, . And confirms it: in dimension 2, a negative determinant always means indefinite.
Check you’ve got it: what if the cross term were −2xy instead of −4xy?
It would be positive definite.
Step by step: off the diagonal there would be two (half of ). The operation becomes , and entry is . With , signature . Sylvester confirms it: and . Same squares, a different form: what decides is how much the cross term weighs. With , changes sign at , and the in the question is already past that boundary.
Why it is done this way: b) and c) use the same vector: is conjugate to , which is why it works (up to a factor) as the second basis vector. If you spot it, the congruence is just the check.
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | Matrix with the cross term split | 0.5 |
| a) | Polar form | 0.5 |
| b) | Equation and basis of the conjugates | 0.5 |
| c) | Congruence operations on rows and columns | 0.75 |
| c) | , and classification by signature | 0.75 |
Exercise 2
a) . The minors: , , . With a zero minor, Sylvester lets you conclude nothing: the form is not definite (positive or negative) for any , but to know whether it is semidefinite or indefinite you have to diagonalise.
For b), the approach. The obvious thing would be to split the cases of from the start and diagonalise three times. There is no need: does not appear in any cross term, so is alone in its row and its column, and no operation touches it. You diagonalise once, with the letter inside, and look at the cases at the end, on .
And one operation is enough: cancels the 1 below the pivot and leaves the whole of row 2 as zeros. The second pivot is a 0, but there is nothing below it to cancel: you are done.
Thinking that a 0 on the diagonal breaks the method. It only gets in the way if there is something left below it to cancel. Here the row is zero and that 0 goes straight into : rank less than 3, and that is why it is never definite.
b) and :
and . Depending on :
- : signature , rank 2 < 3. Positive semidefinite.
- : signature , rank 1. Positive semidefinite.
- : signature . Indefinite.
It makes sense: . The first part is never negative, but it vanishes along the whole line in the plane : a half-pipe along that diagonal.
c) With : and , although .
Why it is done this way: part a) asks you to explain why Sylvester does not work, and that is worth marks: write the minors and say one is zero. Then the congruence gives the full classification in a single operation.
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | Matrix and minors, concluding that Sylvester does not decide | 1 |
| b) | Congruence and | 1 |
| b) | The three cases of classified correctly | 1 |
| c) | Both vectors, checked | 1 |
Exercise 3
a) Sylvester first, to rule things out: , , . They are neither all positive nor alternating from negative: it is not definite. We have to diagonalise.
The approach for the rest of a). With definiteness ruled out, congruence is what is left, column by column:
- Pivot . Below it there is a 1 and a 0: one operation is enough, because row 3 is already fine.
- New pivot in entry (it comes out as ). Below it, a 1: another operation. Whatever is left in completes .
Why not start with , which has a 1 on the diagonal and would avoid fractions? You can: completing squares from gives , with the same signature . But in congruence that means swapping with and with , and the basis comes out different from the expected one: if it does not match, you will not know whether you have made a mistake. Fractions only appear in the first step; it pays to keep the order.
First pivot, the 2: and (row 3 already has a 0 in the first column):
Second pivot, the : and :
Entry : . Row 3 on the right: .
Signature , rank 3: indefinite. And the ratios of the minors, , and , match .
b) The row of is the second row of : . With free:
c) is symmetric, but is not positive definite, so is not a dot product and the cosine makes no sense. A vector with : the third one in the basis, .
For c), the approach. A dot product has to be symmetric and satisfy for every . The second part is a “for every”, and to knock it down a checked counterexample is enough. Congruence has already given it to you: the vector of that goes with the .
Working out the cosine anyway. The formula gives a number that looks reasonable, (with , and ), but it is not the cosine of any angle, because does not measure lengths.
Check you’ve got it: is the third vector of B’ in the subspace U from b)?
Yes: satisfies .
Step by step, and without substituting: the vectors of are pairwise conjugate (that is why is diagonal). So is conjugate to and to , and therefore to any combination of the two. And is one of them. On the other hand, is not in : .
Why it is done this way: Sylvester at the start saves work if it comes out positive definite (then only the basis is left), and here it warns you that the answer to c) will be «no». The congruence gives both the basis and the classification, and its third vector is the example c) asks for.
How it is marked (rough split, mine, not the official one):
| Part | What is assessed | Points |
|---|---|---|
| a) | Matrix and | 0.5 |
| a) | Congruence operations on rows and columns | 1.5 |
| a) | and (rows of ) | 1 |
| a) | Signature and classification | 1 |
| b) | Equation and basis of | 2 |
| c) | Not a dot product, justified | 2 |
| c) | A vector with , checked | 1 |
Check it in MATLAB
This script checks all three exercises. Run it after doing them on paper:
format rat %% Exercise 1 A1 = [3 -2; -2 1]; syms x y z expand([x y]*A1*[x; y]) % gives back w null([1 0]*A1, 'r') % conjugates of (1,0): (2,3)/3 Ct1 = [1 0; 2/3 1]; Ct1*A1*Ct1' % D = diag(3, -1/3) %% Exercise 2 (a = -1) A2 = [1 1 0; 1 1 0; 0 0 -1]; Ct2 = [1 0 0; -1 1 0; 0 0 1]; Ct2*A2*Ct2' % D = diag(1, 0, -1) %% Exercise 3 A3 = [2 1 0; 1 1 1; 0 1 -1]; det(A3(1,1)), det(A3(1:2,1:2)), det(A3) Ct3 = [1 0 0; -1/2 1 0; 1 -2 1]; Ct3*A3*Ct3' % D = diag(2, 1/2, -3) null([0 1 0]*A3, 'r') % b) basis of U
Output:
ans =
3*x^2 - 4*x*y + y^2
ans =
2/3
1
ans =
3 0
0 -1/3
ans =
1 0 0
0 0 0
0 0 -1
ans =
2
ans =
1
ans =
-3
ans =
2 0 0
0 1/2 0
0 0 -3
ans =
-1 -1
1 0
0 1
In exercise 1, null gives the vector : the same divided by 3. In exercise 3, the minors 2, 1 and and the diagonal of Ct3*A3*Ct3' confirm the signature .
Exam-style quiz
These 20 questions are like the ones in the Campus quiz on bilinear and quadratic forms: true or false, single answer, multiple answers, matching and gap-fill, almost all theoretical and a few with a short calculation. They are original and part of the AG mock exam bank. The rules are those of the exam test: no negative marking, except in multiple-answer questions, where each wrong option ticked cancels a right one. Allow about 15 minutes and repeat it as many times as you like.
Let be a bilinear form on . Say whether each statement is true or false:
- for every .
- .
- is a vector of .
- always holds.
Solution
- T — for every .
- T — .
- F — is a vector of .
- F — always holds.
The first two follow from linearity in each vector. A bilinear form returns a number, not a vector. And only symmetric forms satisfy .
The matrix in the standard basis of is:
Solution
Answer:
The picks the row and the , the column: and . It is not symmetric, so neither is .
Fill in the gaps:
If is the change-of-basis matrix, the matrix of a bilinear form in the new basis is , and and are called ____.
Words:
- C^{-1} A C
- similar
- congruent
- C^t A C
Solution
If is the change-of-basis matrix, the matrix of a bilinear form in the new basis is , and and are called congruent.
For bilinear forms, both coordinates change with and one comes out transposed: . (similar) is the change of basis for linear transformations.
The matrix of the quadratic form is:
Solution
Answer:
Squares on the diagonal and each cross term divided by 2 in its two symmetric entries. Check: .
About the quadratic form and its polar form :
- .
- .
- Infinitely many bilinear forms give this , but only one is symmetric.
- .
Solution
- T — .
- F — .
- T — Infinitely many bilinear forms give this , but only one is symmetric.
- T — .
The polar form is the symmetric bilinear form, with the cross term shared out: 2 and 2. The second expression gives the same , but it is not symmetric, so it is not the polar form. And .
With respect to , which vectors are conjugate to ?
- Those on the line
- Those on the line
- Those on the line
- None
Solution
Answer: Those on the line
With , and the condition is , that is, . For instance, is conjugate to : .
In , match each signature with the type of quadratic form:
| (3, 0) | |
| (0, 3) | |
| (2, 0) | |
| (1, 1) |
Definitions:
- Negative semidefinite
- Positive definite
- Indefinite
- Negative definite
- Positive semidefinite
Solution
- (3, 0) → Positive definite
- (0, 3) → Negative definite
- (2, 0) → Positive semidefinite
- (1, 1) → Indefinite
With : and are the definite ones; with , positive semidefinite; if there are positives and negatives, indefinite (even with zeros). Negative semidefinite would be or .
By Sylvester’s criterion, a quadratic form on is negative definite if and only if:
- , and
- , and
- , and
- Its determinant is negative
Solution
Answer: , and
If is negative definite, is positive definite, and changing the sign of a matrix of order multiplies its determinant by .
About diagonalising a quadratic form by congruence:
- Each elementary row operation is followed by the same operation on columns.
- The numbers on the diagonal of are always the eigenvalues of .
- The number of positive and negative entries of does not depend on the operations chosen.
- It requires the matrix to be symmetric.
Solution
- T — Each elementary row operation is followed by the same operation on columns.
- F — The numbers on the diagonal of are always the eigenvalues of .
- T — The number of positive and negative entries of does not depend on the operations chosen.
- T — It requires the matrix to be symmetric.
By congruence, the diagonal depends on the operations (there may be fractions or different numbers); what does not change is how many are positive, negative and zero: that is Sylvester’s law of inertia. Only by similarity is the diagonal made of eigenvalues.
When diagonalising by congruence with , once the left side is diagonal, a matrix is left on the right. The vectors of the basis are:
- The rows of
- The columns of
- The rows of
- The eigenvectors of
Solution
Answer: The rows of
The identity follows only the row operations and ends up as , with . The columns of are the rows of .
What type is ?
- Indefinite
- Positive definite
- Positive semidefinite
- Negative definite
Solution
Answer: Indefinite
It is already diagonal: the signs of give signature . It takes positive values () and negative ones ().
Tick the quadratic forms on whose polar form is a dot product:
Solution
Answer: ·
A dot product is a symmetric bilinear form with positive definite. With Sylvester: gives 1 and 1; gives 3 and . The other two are not positive definite.
Fill in the gaps:
Two vectors , are ____ with respect to a quadratic form if ; with the usual dot product, this is the same as being ____.
Words:
- conjugate
- orthogonal
- parallel
- similar
Solution
Two vectors , are conjugate with respect to a quadratic form if ; with the usual dot product, this is the same as being orthogonal.
Conjugate is «perpendicular» under the rule of . If is the usual dot product, conjugate and orthogonal coincide.
If , and are the leading principal minors of the matrix of , what can be said for sure?
- That is not definite, and to classify it you have to diagonalise
- That is positive semidefinite
- That is indefinite
- That is positive definite
Solution
Answer: That is not definite, and to classify it you have to diagonalise
With a zero minor, the form is not definite (positive or negative), but the minors do not say whether it is semidefinite or indefinite. For example, in , (positive semidefinite) and (indefinite) have those very minors.
With the dot product defined by the matrix , the cosine of the angle between and is:
- 0
Solution
Answer:
. The matrix is positive definite (, ), so it is a dot product.
About the quadratic form :
- It is positive semidefinite.
- .
- It is positive definite because the coefficients of the squares are positive.
- Its rank is 1.
Solution
- T — It is positive semidefinite.
- T — .
- F — It is positive definite because the coefficients of the squares are positive.
- T — Its rank is 1.
, and it is 0 along the whole line (a half-pipe). By congruence, : signature and rank 1.
The bilinear form is:
- Antisymmetric, and its quadratic form is zero
- Symmetric
- A dot product
- Neither symmetric nor antisymmetric
Solution
Answer: Antisymmetric, and its quadratic form is zero
Its matrix is , with . It is the determinant of the two columns, the signed area from topic 5.
Let and be the matrices of the same quadratic form in two bases. Tick what they always share:
- The rank
- The signature
- The determinant
- The eigenvalues
Solution
Answer: The rank · The signature
Congruence preserves the rank and, by the law of inertia, the signature. The determinant only keeps its sign, and the eigenvalues can change.
Diagonalising by congruence gives . The form is:
- Negative semidefinite
- Negative definite
- Indefinite
- Positive semidefinite
Solution
Answer: Negative semidefinite
positives and negatives with : with , negative semidefinite. An upside-down half-pipe.
Fill in the gaps:
By Sylvester’s law of ____, every diagonal matrix that represents the same quadratic form has the same number of positive, negative and zero entries; the pair is called the ____.
Words:
- trace
- inertia
- signature
- similarity
Solution
By Sylvester’s law of inertia, every diagonal matrix that represents the same quadratic form has the same number of positive, negative and zero entries; the pair is called the signature.
That is what lets you classify with any diagonalisation: the numbers change, the signs do not.
What next?
This topic closes the «pure» linear algebra part of AG. In topic 7, complex numbers, the roots that was missing finally appear (the eigenvalues of the 90° rotation), and in topic 8, affine space, quadratic forms return as conics and quadrics: an ellipse is the curve of a positive definite form. Carry on with complex numbers. Meanwhile, in MATLAB, expand([x y z]*A*[x; y; z]), Ct*A*Ct' and det(A(1:k,1:k)) check any part.
Cheat sheet: bilinear and quadratic forms
The essentials in 30 seconds: with the coefficient of in ; the matrix of is symmetric and the cross terms are split by 2; change of basis ; conjugates: ; diagonalise by congruence with the same ERO on rows and columns, basis = rows of ; signature and classification; Sylvester for «definite»; dot product = symmetric and positive definite.
| I want… | By hand | MATLAB |
|---|---|---|
| The matrix of | Coefficient of in row , column | A = [ ... ] |
| Row · matrix · column | u'*A*v | |
| The matrix of | Squares on the diagonal; cross terms / 2 in and | expand([x y z]*A*[x; y; z]) to check |
| The polar form | with symmetric, or | (A + A')/2 |
| Change of basis | , or | C'*A*C |
| Conjugates of | times = 0 | null(u'*A, 'r') |
| Diagonalise | , same ERO on rows and columns | Ct*A*Ct' (check) |
| Classify | Signs of : signature | eig(A) (same signs) |
| Definite? | Sylvester: all (positive) or (negative) | det(A(1:k,1:k)) |
| Cosine with | , only if positive definite | (u'*A*v)/sqrt((u'*A*u)*(v'*A*v)) |
Exercise templates:
- Classify with a basis: matrix (cross terms / 2) → Sylvester to rule out → congruence pivot by pivot → , = rows of → signature → type → check of the last vector.
- With a parameter: minors in terms of the parameter → intervals where it is definite → at the edges (some ) and outside, congruence.
- Conjugate subspace: rows of for the given vectors (or ) → implicit equations → basis with parameters.
- Dot product: symmetric? positive definite? If both, cosine; if not, justify and give a vector with .
| Symptom | Likely cause |
|---|---|
expand does not give back your | Cross term not split, or a sign copied wrong |
| The left side ends up triangular, not diagonal | You did the ERO on rows only |
| of the last vector is not the last number of | Basis read off the columns, or the column ERO applied to the identity |
| A «negative definite» rejected because | Sylvester for negative backwards: the even ones are positive |
| A cosine greater than 1 or the root of a negative number | The form was not positive definite |
| not symmetric when starting from a symmetric one | You used instead of |
Before handing in, ask yourself:
- Have I split every cross term by 2 when writing the matrix?
- Have I written each row operation with its column operation?
- Have I taken the basis from the rows on the right and checked of the last vector?
- If a cosine is asked for, have I first justified that it is a dot product?
Did this article help you? Here is how you can support SergioLearns →
Ready for the exam?AG theory mock exam — the 20-question test with the Campus rules, no negative marking (and the catch in the several-correct ones)


