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, Δ2\Delta_2 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.

How to use this article

First of all, how this counts in the AG exam. The exam mark is EX=(T+P)/2EX = (T + P)/2: TT is a 20-question test taken from the Campus quizzes and PP is written exercises. If EX≥4.5EX \ge 4.5, the final mark is 0.7⋅EX+C+TP0.7 \cdot EX + C + TP (the quizzes and the lab assignments, up to 1.5 points each); otherwise, the final mark is EXEX. 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.

  1. Do each exercise on paper, without a calculator, with every congruence operation written out (the row one and the column one).
  2. Compare with the expected result and, if it does not match, open the hint before looking at the solution.
  3. Read «What is wrong here?» trying to find the mistake yourself before reading the explanation.
  4. Take the quiz at the end and check everything in MATLAB.
  5. 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 XtAX=1X^tAX = 1 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 w(x,y)=3x2−4xy+y2w(x, y) = 3x^2 – 4xy + y^2. a) (1 point) Write its matrix and its polar form. b) (0.5 points) Compute a basis of the subspace of vectors conjugate to (1,0)(1, 0). c) (1.5 points) Diagonalise ww by congruence, give the basis B′B' and classify it.

Expected result: A=(3−2−21)A = \begin{pmatrix} 3 & -2 \\ -2 & 1 \end{pmatrix}; the conjugates of (1,0)(1, 0) form the line of (2,3)(2, 3); D=diag⁡(3,−13)D = \operatorname{diag}\big(3, -\tfrac13\big) and the form is indefinite, even though both squares have positive coefficients.

In c), to remove the −2-2 below the 3, the operation is r2→r2+23r1r_2 \to r_2 + \tfrac23 r_1. Thirds appear; do not panic. And check the result by finding a vector with w<0w < 0.

Exercise 2 (intermediate level): a parameter Sylvester cannot settle

Exercise 2. [4 points] For each a∈Ra \in \mathbb{R}, let wa(x,y,z)=x2+2xy+y2+az2w_a(x, y, z) = x^2 + 2xy + y^2 + az^2. 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 aa. c) (1 point) For a=−1a = -1, give a vector with w<0w < 0 and a non-zero vector with w=0w = 0.

Expected result: Δ2=0\Delta_2 = 0 for every aa; D=diag⁡(1,0,a)D = \operatorname{diag}(1, 0, a); positive semidefinite if a≥0a \ge 0 and indefinite if a<0a < 0. It is never definite.

x2+2xy+y2x^2 + 2xy + y^2 is a perfect square. Think about its value at the vector (1,−1,0)(1, -1, 0).

Exercise 3 (challenge): this is how it appears in the exam

Exercise 3. [9 points] On R3\mathbb{R}^3, let the bilinear form be f(u⃗,v⃗)=2x1y1+x1y2+x2y1+x2y2+x2y3+x3y2−x3y3f(\vec u, \vec v) = 2x_1y_1 + x_1y_2 + x_2y_1 + x_2y_2 + x_2y_3 + x_3y_2 – x_3y_3. a) (4 points) Classify the quadratic form ww associated with ff and find a basis in which the matrix of ww is diagonal. b) (2 points) Find a basis of the subspace UU of vectors conjugate to (0,1,0)(0, 1, 0). c) (3 points) Study whether ff is a dot product; if it is, compute the cosine of the angle between (1,0,0)(1, 0, 0) and (0,1,0)(0, 1, 0), and if it is not, give a non-zero vector with w(v⃗)≤0w(\vec v) \le 0.

Expected result: D=diag⁡(2,12,−3)D = \operatorname{diag}\big(2, \tfrac12, -3\big), signature (2,1)(2, 1), indefinite; UU is the plane x+y+z=0x + y + z = 0; it is not a dot product, and the third basis vector works as a vector with w<0w < 0.

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

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 4xy4xy is shared between two entries, 22 and 22: A=(1225)A = \begin{pmatrix} 1 & 2 \\ 2 & 5 \end{pmatrix}, with Δ1=1\Delta_1 = 1 and Δ2=5−4=1\Delta_2 = 5 – 4 = 1, both positive. With the badly written matrix, XtAX=x2+8xy+5y2X^tAX = x^2 + 8xy + 5y^2, which is a different form (that one is indefinite). In fact, w=(x+2y)2+y2w = (x + 2y)^2 + y^2, a sum of squares that is 0 only at the origin.

One wrong entry, a different classificationThe form x² + 4xy + 5y². Left: with 4 in the cross entries, the second minor comes out as −11 and it looks indefinite. Right: with 2, it comes out as 1 and it is positive definite: it is (x + 2y)² + y².w = x² + 4xy + 5y² = (x + 2y)² + y²1445Δ₂ = 5 − 16 = −11«indefinite» (wrong)1225Δ₂ = 5 − 4 = 1positive definitesame Sylvester,different matrix
Sylvester is only as good as the matrix you give it.

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, Δ1=−2<0\Delta_1 = -2 < 0, Δ2=1>0\Delta_2 = 1 > 0 and Δ3=−1<0\Delta_3 = -1 < 0: exactly the pattern. Check: −w=2x2−2xy+y2+z2=x2+(x−y)2+z2>0-w = 2x^2 – 2xy + y^2 + z^2 = x^2 + (x – y)^2 + z^2 > 0 for any non-zero vector.

«all negative». A 2×22 \times 2 matrix with a negative diagonal, such as −I-I, has a positive determinant: (−1)(−1)=1(-1)(-1) = 1. 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 CtC^t, and the basis vectors are its rows: B′={(1,0),  (1,1)}B' = \{(1, 0),\; (1, 1)\}. With the column basis, (1,1)(1, 1) and (0,1)(0, 1) are not conjugate: (1    1) A (0,1)t=(0    2)⋅(0,1)=2≠0(1 \;\; 1)\,A\,(0, 1)^t = (0 \;\; 2) \cdot (0, 1) = 2 \neq 0. With the right one, (1    0) A (1,1)t=(1    −1)⋅(1,1)=0(1 \;\; 0)\,A\,(1, 1)^t = (1 \;\; {-1}) \cdot (1, 1) = 0.

To check you read the basis correctly, compute ww of the last vector: it must give the last number of DD. Here, w(1,1)=1−2+3=2w(1, 1) = 1 – 2 + 3 = 2. With the wrong vector (0,1)(0, 1) you get 3.

Solutions

Exercise 1

a) Squares on the diagonal and −4xy-4xy split into −2-2 and −2-2:

A=(3−2−21),fp(u⃗,v⃗)=3x1y1−2x1y2−2x2y1+x2y2 A = \begin{pmatrix} 3 & -2 \\ -2 & 1 \end{pmatrix}, \qquad f_p(\vec u, \vec v) = 3x_1y_1 – 2x_1y_2 – 2x_2y_1 + x_2y_2

b) The row of (1,0)(1, 0) is the first row of AA: 3x−2y=03x – 2y = 0. A line, with basis {(2,3)}\{(2, 3)\}. Check: (3    −2)⋅(2,3)=6−6=0(3 \;\; {-2}) \cdot (2, 3) = 6 – 6 = 0.

For c), the approach before the calculation. Diagonalising by congruence means reducing A A while repeating each row operation on the columns, so that it stays symmetric: at the end, D D is left on the left. The identity on the right only gets the row operations, and its rows end up being the vectors of B′ B' .

Why not the obvious route? There are two temptations:

  • Looking at the coefficients: 3x2 3x^2 and y2 y^2 are positive, so it “looks” positive definite. That is the deceptive ramp: the cross term −4xy -4xy counts too, and here it weighs more than the squares.
  • Finding the eigenvalues, as in the previous topic: λ=2±5 \lambda = 2 \pm \sqrt5 . One positive and one negative, the same classification, but with roots, and the question asks for congruence and the basis B′ B' .

The calculation below, with the reason for each step:

StepOperationWhat changesWhy
1r2→r2+23r1 r_2 \to r_2 + \tfrac23 r_1 Row 2 becomes (0,−13) (0, -\tfrac13) on the left and (23,1) (\tfrac23, 1) on the rightThe pivot is the 3 and the −2 -2 has to go: −2+23⋅3=0 -2 + \tfrac23 \cdot 3 = 0
2c2→c2+23c1 c_2 \to c_2 + \tfrac23 c_1 Entry (1,2) (1, 2) becomes 0The same operation on the columns restores the symmetry; the right-hand part is not touched

c) With r2→r2+23r1r_2 \to r_2 + \tfrac23 r_1 and c2→c2+23c1c_2 \to c_2 + \tfrac23 c_1:

(3−210−2101)→ r2→r2+23r1 (3−2100−13231)→ c2→c2+23c1 (30100−13231) \left(\begin{array}{cc|cc} 3 & -2 & 1 & 0 \\ -2 & 1 & 0 & 1 \end{array}\right) \xrightarrow{\, r_2 \to r_2 + \frac23 r_1 \,} \left(\begin{array}{cc|cc} 3 & -2 & 1 & 0 \\ 0 & -\tfrac13 & \tfrac23 & 1 \end{array}\right) \xrightarrow{\, c_2 \to c_2 + \frac23 c_1 \,} \left(\begin{array}{cc|cc} 3 & 0 & 1 & 0 \\ 0 & -\tfrac13 & \tfrac23 & 1 \end{array}\right)

Entry (2,2)(2, 2): 1+23⋅(−2)=1−43=−131 + \tfrac23 \cdot (-2) = 1 – \tfrac43 = -\tfrac13.

D=(300−13),B′={(1,0),  (23,1)} D = \begin{pmatrix} 3 & 0 \\ 0 & -\tfrac13 \end{pmatrix}, \qquad B' = \left\{(1, 0),\; \left(\tfrac23, 1\right)\right\}

Signature (1,1)(1, 1): indefinite. It is a saddle even though both squares are positive. Check: w(23,1)=43−83+1=−13w\big(\tfrac23, 1\big) = \tfrac43 – \tfrac83 + 1 = -\tfrac13, and with a fraction-free vector, w(2,3)=12−24+9=−3<0w(2, 3) = 12 – 24 + 9 = -3 < 0. And Δ2=∣A∣=3−4=−1<0\Delta_2 = |A| = 3 – 4 = -1 < 0 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 −1 -1 (half of −2 -2 ). The operation becomes r2→r2+13r1 r_2 \to r_2 + \tfrac13 r_1 , and entry (2,2) (2, 2) is 1+13⋅(−1)=23 1 + \tfrac13 \cdot (-1) = \tfrac23 . With D=diag⁡(3,23) D = \operatorname{diag}\big(3, \tfrac23\big) , signature (2,0) (2, 0) . Sylvester confirms it: Δ1=3>0 \Delta_1 = 3 > 0 and Δ2=3−1=2>0 \Delta_2 = 3 – 1 = 2 > 0 . Same squares, a different form: what decides is how much the cross term weighs. With 3x2+bxy+y2 3x^2 + bxy + y^2 , Δ2=3−b24 \Delta_2 = 3 – \tfrac{b^2}{4} changes sign at b=±23≈±3.46 b = \pm 2\sqrt3 \approx \pm 3.46 , and the −4 -4 in the question is already past that boundary.

Why it is done this way: b) and c) use the same vector: (2,3)(2, 3) is conjugate to (1,0)(1, 0), 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):

PartWhat is assessedPoints
a)Matrix with the cross term split0.5
a)Polar form0.5
b)Equation and basis of the conjugates0.5
c)Congruence operations on rows and columns0.75
c)DD, B′B' and classification by signature0.75

Exercise 2

a) A=(11011000a)A = \begin{pmatrix} 1 & 1 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & a \end{pmatrix}. The minors: Δ1=1\Delta_1 = 1, Δ2=1−1=0\Delta_2 = 1 – 1 = 0, Δ3=a⋅0=0\Delta_3 = a \cdot 0 = 0. With a zero minor, Sylvester lets you conclude nothing: the form is not definite (positive or negative) for any aa, 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 a a from the start and diagonalise three times. There is no need: z z does not appear in any cross term, so a a 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 D D .

And one operation is enough: r2→r2−r1 r_2 \to r_2 – r_1 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 D D : rank less than 3, and that is why it is never definite.

b) r2→r2−r1r_2 \to r_2 – r_1 and c2→c2−c1c_2 \to c_2 – c_1:

(11010011001000a001)⟶(100100000−11000a001) \left(\begin{array}{ccc|ccc} 1 & 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 0 & 0 & 1 & 0 \\ 0 & 0 & a & 0 & 0 & 1 \end{array}\right) \longrightarrow \left(\begin{array}{ccc|ccc} 1 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -1 & 1 & 0 \\ 0 & 0 & a & 0 & 0 & 1 \end{array}\right)

D=diag⁡(1,0,a)D = \operatorname{diag}(1, 0, a) and B′={(1,0,0),  (−1,1,0),  (0,0,1)}B' = \{(1, 0, 0),\; (-1, 1, 0),\; (0, 0, 1)\}. Depending on aa:

  • a>0a > 0: signature (2,0)(2, 0), rank 2 < 3. Positive semidefinite.
  • a=0a = 0: signature (1,0)(1, 0), rank 1. Positive semidefinite.
  • a<0a < 0: signature (1,1)(1, 1). Indefinite.

It makes sense: wa=(x+y)2+az2w_a = (x + y)^2 + az^2. The first part is never negative, but it vanishes along the whole line y=−xy = -x in the plane z=0z = 0: a half-pipe along that diagonal.

c) With a=−1a = -1: w(0,0,1)=−1<0w(0, 0, 1) = -1 < 0 and w(−1,1,0)=0w(-1, 1, 0) = 0, although (−1,1,0)≠0⃗(-1, 1, 0) \neq \vec 0.

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):

PartWhat is assessedPoints
a)Matrix and minors, concluding that Sylvester does not decide1
b)Congruence and DD1
b)The three cases of aa classified correctly1
c)Both vectors, checked1

Exercise 3

A=(21011101−1),w(x,y,z)=2x2+2xy+y2+2yz−z2 A = \begin{pmatrix} 2 & 1 & 0 \\ 1 & 1 & 1 \\ 0 & 1 & -1 \end{pmatrix}, \qquad w(x, y, z) = 2x^2 + 2xy + y^2 + 2yz – z^2

a) Sylvester first, to rule things out: Δ1=2\Delta_1 = 2, Δ2=2−1=1\Delta_2 = 2 – 1 = 1, Δ3=2(−1−1)−1(−1−0)+0=−4+1=−3\Delta_3 = 2(-1 – 1) – 1(-1 – 0) + 0 = -4 + 1 = -3. 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:

  1. Pivot 2 2 . Below it there is a 1 and a 0: one operation is enough, because row 3 is already fine.
  2. New pivot in entry (2,2) (2, 2) (it comes out as 12 \tfrac12 ). Below it, a 1: another operation. Whatever is left in (3,3) (3, 3) completes D D .

Why not start with y y , which has a 1 on the diagonal and would avoid fractions? You can: completing squares from y y gives w=(x+y+z)2+(x−z)2−3z2 w = (x + y + z)^2 + (x – z)^2 – 3z^2 , with the same signature (2,1) (2, 1) . But in congruence that means swapping r1 r_1 with r2 r_2 and c1 c_1 with c2 c_2 , 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: r2→r2−12r1r_2 \to r_2 – \tfrac12 r_1 and c2→c2−12c1c_2 \to c_2 – \tfrac12 c_1 (row 3 already has a 0 in the first column):

(21010011101001−1001)⟶(2001000121−121001−1001) \left(\begin{array}{ccc|ccc} 2 & 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & -1 & 0 & 0 & 1 \end{array}\right) \longrightarrow \left(\begin{array}{ccc|ccc} 2 & 0 & 0 & 1 & 0 & 0 \\ 0 & \tfrac12 & 1 & -\tfrac12 & 1 & 0 \\ 0 & 1 & -1 & 0 & 0 & 1 \end{array}\right)

Second pivot, the 12\tfrac12: r3→r3−2r2r_3 \to r_3 – 2r_2 and c3→c3−2c2c_3 \to c_3 – 2c_2:

⟶(2001000120−121000−31−21) \longrightarrow \left(\begin{array}{ccc|ccc} 2 & 0 & 0 & 1 & 0 & 0 \\ 0 & \tfrac12 & 0 & -\tfrac12 & 1 & 0 \\ 0 & 0 & -3 & 1 & -2 & 1 \end{array}\right)

Entry (3,3)(3, 3): −1−2⋅1=−3-1 – 2 \cdot 1 = -3. Row 3 on the right: (0,0,1)−2(−12,1,0)=(1,−2,1)(0, 0, 1) – 2\big(-\tfrac12, 1, 0\big) = (1, -2, 1).

D=(200012000−3),B′={(1,0,0),  (−12,1,0),  (1,−2,1)} D = \begin{pmatrix} 2 & 0 & 0 \\ 0 & \tfrac12 & 0 \\ 0 & 0 & -3 \end{pmatrix}, \qquad B' = \left\{(1, 0, 0),\; \left(-\tfrac12, 1, 0\right),\; (1, -2, 1)\right\}

Signature (2,1)(2, 1), rank 3: indefinite. And the ratios of the minors, 22, 12\tfrac12 and −31=−3-\tfrac31 = -3, match DD.

b) The row of (0,1,0)(0, 1, 0) is the second row of AA: x+y+z=0x + y + z = 0. With y,zy, z free:

U={(−y−z,  y,  z)},BU={(−1,1,0),  (−1,0,1)} U = \{(-y – z,\; y,\; z)\}, \qquad B_U = \{(-1, 1, 0),\; (-1, 0, 1)\}

c) ff is symmetric, but ww is not positive definite, so ff is not a dot product and the cosine makes no sense. A vector with w<0w < 0: the third one in the basis, w(1,−2,1)=2−4+4−4−1=−3w(1, -2, 1) = 2 – 4 + 4 – 4 – 1 = -3.

The conjugate basis and what it saysThe three vectors of the basis B prime with their value of w: (1, 0, 0) gives 2, (−1/2, 1, 0) gives 1/2 and (1, −2, 1) gives −3. Two positive and one negative: indefinite, so it is not an inner product. Below, the equation of the subspace conjugate to (0, 1, 0).(1, 0, 0)w = 2(−½, 1, 0)w = ½(1, −2, 1)w = −3sig = (2, 1): indefinite → not an inner productU (conjugate to (0, 1, 0)): x + y + z = 0
The vector with negative w is the proof that it is not an inner product.

For c), the approach. A dot product has to be symmetric and satisfy w(v⃗)>0 w(\vec v) > 0 for every v⃗≠0⃗ \vec v \neq \vec 0 . 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 B′ B' that goes with the −3 -3 .

Working out the cosine anyway. The formula gives a number that looks reasonable, 12⋅1=22 \frac{1}{\sqrt2 \cdot 1} = \frac{\sqrt2}{2} (with f((1,0,0),(0,1,0))=1 f\big((1, 0, 0), (0, 1, 0)\big) = 1 , w(1,0,0)=2 w(1, 0, 0) = 2 and w(0,1,0)=1 w(0, 1, 0) = 1 ), but it is not the cosine of any angle, because f f does not measure lengths.

Check you’ve got it: is the third vector of B’ in the subspace U from b)?

Yes: (1,−2,1) (1, -2, 1) satisfies x+y+z=1−2+1=0 x + y + z = 1 – 2 + 1 = 0 .

Step by step, and without substituting: the vectors of B′ B' are pairwise conjugate (that is why D D is diagonal). So (1,−2,1) (1, -2, 1) is conjugate to (1,0,0) (1, 0, 0) and to (−12,1,0) \big(-\tfrac12, 1, 0\big) , and therefore to any combination of the two. And (0,1,0)=(−12,1,0)+12(1,0,0) (0, 1, 0) = \big(-\tfrac12, 1, 0\big) + \tfrac12 (1, 0, 0) is one of them. On the other hand, (−12,1,0) \big(-\tfrac12, 1, 0\big) is not in U U : −12+1+0=12≠0 -\tfrac12 + 1 + 0 = \tfrac12 \neq 0 .

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):

PartWhat is assessedPoints
a)Matrix and ww0.5
a)Congruence operations on rows and columns1.5
a)DD and B′B' (rows of CtC^t)1
a)Signature and classification1
b)Equation and basis of UU2
c)Not a dot product, justified2
c)A vector with w≤0w \le 0, checked1

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 (2/3,1)(2/3, 1): the same (2,3)(2, 3) divided by 3. In exercise 3, the minors 2, 1 and −3-3 and the diagonal of Ct3*A3*Ct3' confirm the signature (2,1)(2, 1).

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.

Question 1True or false

Let ff be a bilinear form on VV. Say whether each statement is true or false:

  1. f(u⃗,0⃗)=0f(\vec u, \vec 0) = 0 for every u⃗\vec u.
  2. f(−u⃗,v⃗)=−f(u⃗,v⃗)f(-\vec u, \vec v) = -f(\vec u, \vec v).
  3. f(u⃗,v⃗)f(\vec u, \vec v) is a vector of VV.
  4. f(u⃗,v⃗)=f(v⃗,u⃗)f(\vec u, \vec v) = f(\vec v, \vec u) always holds.
Solution
  • T — f(u⃗,0⃗)=0f(\vec u, \vec 0) = 0 for every u⃗\vec u.
  • T — f(−u⃗,v⃗)=−f(u⃗,v⃗)f(-\vec u, \vec v) = -f(\vec u, \vec v).
  • F — f(u⃗,v⃗)f(\vec u, \vec v) is a vector of VV.
  • F — f(u⃗,v⃗)=f(v⃗,u⃗)f(\vec u, \vec v) = f(\vec v, \vec u) 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 f(u⃗,v⃗)=f(v⃗,u⃗)f(\vec u, \vec v) = f(\vec v, \vec u).

Question 2Single choice

The matrix in the standard basis of f(u⃗,v⃗)=x1y1−3x1y2+2x2y1+5x2y2f(\vec u, \vec v) = x_1y_1 – 3x_1y_2 + 2x_2y_1 + 5x_2y_2 is:

  1. (1−325)\begin{pmatrix} 1 & -3 \\ 2 & 5 \end{pmatrix}
  2. (12−35)\begin{pmatrix} 1 & 2 \\ -3 & 5 \end{pmatrix}
  3. (1−12−125)\begin{pmatrix} 1 & -\tfrac12 \\ -\tfrac12 & 5 \end{pmatrix}
  4. (1−1−15)\begin{pmatrix} 1 & -1 \\ -1 & 5 \end{pmatrix}
Solution

Answer: (1−325)\begin{pmatrix} 1 & -3 \\ 2 & 5 \end{pmatrix}

The xx picks the row and the yy, the column: a12=−3a_{12} = -3 and a21=2a_{21} = 2. It is not symmetric, so neither is ff.

Question 3Fill in the gaps

Fill in the gaps:

If CC is the change-of-basis matrix, the matrix of a bilinear form in the new basis is A′=[[CtAC]]A' = ____, and AA and A′A' are called ____.

Words:

  • C^{-1} A C
  • similar
  • congruent
  • C^t A C
Solution

If CC is the change-of-basis matrix, the matrix of a bilinear form in the new basis is A′=[[CtAC]]A' = C^t A C, and AA and A′A' are called congruent.

For bilinear forms, both coordinates change with CC and one comes out transposed: A′=CtACA' = C^tAC. C−1ACC^{-1}AC (similar) is the change of basis for linear transformations.

Question 4Single choice

The matrix of the quadratic form w(x,y)=2x2−6xy+5y2w(x, y) = 2x^2 – 6xy + 5y^2 is:

  1. (2−3−35)\begin{pmatrix} 2 & -3 \\ -3 & 5 \end{pmatrix}
  2. (2−6−65)\begin{pmatrix} 2 & -6 \\ -6 & 5 \end{pmatrix}
  3. (2−605)\begin{pmatrix} 2 & -6 \\ 0 & 5 \end{pmatrix}
  4. (2335)\begin{pmatrix} 2 & 3 \\ 3 & 5 \end{pmatrix}
Solution

Answer: (2−3−35)\begin{pmatrix} 2 & -3 \\ -3 & 5 \end{pmatrix}

Squares on the diagonal and each cross term divided by 2 in its two symmetric entries. Check: XtAX=2x2−3xy−3yx+5y2X^tAX = 2x^2 – 3xy – 3yx + 5y^2.

Question 5True or false

About the quadratic form w(x,y)=x2+4xy+3y2w(x, y) = x^2 + 4xy + 3y^2 and its polar form fpf_p:

  1. fp(u⃗,v⃗)=x1y1+2x1y2+2x2y1+3x2y2f_p(\vec u, \vec v) = x_1y_1 + 2x_1y_2 + 2x_2y_1 + 3x_2y_2.
  2. fp(u⃗,v⃗)=x1y1+4x1y2+3x2y2f_p(\vec u, \vec v) = x_1y_1 + 4x_1y_2 + 3x_2y_2.
  3. Infinitely many bilinear forms give this ww, but only one is symmetric.
  4. w(2u⃗)=4w(u⃗)w(2\vec u) = 4w(\vec u).
Solution
  • T — fp(u⃗,v⃗)=x1y1+2x1y2+2x2y1+3x2y2f_p(\vec u, \vec v) = x_1y_1 + 2x_1y_2 + 2x_2y_1 + 3x_2y_2.
  • F — fp(u⃗,v⃗)=x1y1+4x1y2+3x2y2f_p(\vec u, \vec v) = x_1y_1 + 4x_1y_2 + 3x_2y_2.
  • T — Infinitely many bilinear forms give this ww, but only one is symmetric.
  • T — w(2u⃗)=4w(u⃗)w(2\vec u) = 4w(\vec u).

The polar form is the symmetric bilinear form, with the cross term shared out: 2 and 2. The second expression gives the same ww, but it is not symmetric, so it is not the polar form. And w(λu⃗)=λ2w(u⃗)w(\lambda\vec u) = \lambda^2w(\vec u).

Question 6Single choice

With respect to w(x,y)=x2+2xy+3y2w(x, y) = x^2 + 2xy + 3y^2, which vectors are conjugate to (1,1)(1, 1)?

  1. Those on the line x+2y=0x + 2y = 0
  2. Those on the line x+y=0x + y = 0
  3. Those on the line 2x+5y=02x + 5y = 0
  4. None
Solution

Answer: Those on the line x+2y=0x + 2y = 0

With A=(1113)A = \begin{pmatrix} 1 & 1 \\ 1 & 3 \end{pmatrix}, (1    1)A=(2,4)(1 \;\; 1)A = (2, 4) and the condition is 2x+4y=02x + 4y = 0, that is, x+2y=0x + 2y = 0. For instance, (2,−1)(2, -1) is conjugate to (1,1)(1, 1): (2,4)⋅(2,−1)=0(2, 4)\cdot(2, -1) = 0.

Question 7Match

In R3\mathbb{R}^3, 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 n=3n = 3: (3,0)(3, 0) and (0,3)(0, 3) are the definite ones; (r,0)(r, 0) with r<3r < 3, positive semidefinite; if there are positives and negatives, indefinite (even with zeros). Negative semidefinite would be (0,1)(0, 1) or (0,2)(0, 2).

Question 8Single choice

By Sylvester’s criterion, a quadratic form on R3\mathbb{R}^3 is negative definite if and only if:

  1. Δ1<0\Delta_1 < 0, Δ2>0\Delta_2 > 0 and Δ3<0\Delta_3 < 0
  2. Δ1<0\Delta_1 < 0, Δ2<0\Delta_2 < 0 and Δ3<0\Delta_3 < 0
  3. Δ1>0\Delta_1 > 0, Δ2<0\Delta_2 < 0 and Δ3>0\Delta_3 > 0
  4. Its determinant is negative
Solution

Answer: Δ1<0\Delta_1 < 0, Δ2>0\Delta_2 > 0 and Δ3<0\Delta_3 < 0

If ww is negative definite, −w-w is positive definite, and changing the sign of a matrix of order kk multiplies its determinant by (−1)k(-1)^k.

Question 9True or false

About diagonalising a quadratic form by congruence:

  1. Each elementary row operation is followed by the same operation on columns.
  2. The numbers on the diagonal of DD are always the eigenvalues of AA.
  3. The number of positive and negative entries of DD does not depend on the operations chosen.
  4. 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 DD are always the eigenvalues of AA.
  • T — The number of positive and negative entries of DD 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.

Question 10Single choice

When diagonalising by congruence with (A∣I)(A \mid I), once the left side is diagonal, a matrix MM is left on the right. The vectors of the basis B′B' are:

  1. The rows of MM
  2. The columns of MM
  3. The rows of M−1M^{-1}
  4. The eigenvectors of AA
Solution

Answer: The rows of MM

The identity follows only the row operations and ends up as CtC^t, with D=CtACD = C^tAC. The columns of CC are the rows of CtC^t.

Question 11Single choice

What type is w(x,y,z)=x2+4y2−2z2w(x, y, z) = x^2 + 4y^2 – 2z^2?

  1. Indefinite
  2. Positive definite
  3. Positive semidefinite
  4. Negative definite
Solution

Answer: Indefinite

It is already diagonal: the signs of 1,4,−21, 4, -2 give signature (2,1)(2, 1). It takes positive values (w(1,0,0)=1w(1, 0, 0) = 1) and negative ones (w(0,0,1)=−2w(0, 0, 1) = -2).

Question 12Multiple · wrong ticks subtract

Tick the quadratic forms on R2\mathbb{R}^2 whose polar form is a dot product:

  1. x2+y2x^2 + y^2
  2. 3x2+2xy+y23x^2 + 2xy + y^2
  3. x2+4xy+y2x^2 + 4xy + y^2
  4. x2x^2
Solution

Answer: x2+y2x^2 + y^2 · 3x2+2xy+y23x^2 + 2xy + y^2

A dot product is a symmetric bilinear form with ww positive definite. With Sylvester: x2+y2x^2 + y^2 gives 1 and 1; 3x2+2xy+y23x^2 + 2xy + y^2 gives 3 and 3−1=23 – 1 = 2. The other two are not positive definite.

Question 13Fill in the gaps

Fill in the gaps:

Two vectors u⃗\vec u, v⃗\vec v are ____ with respect to a quadratic form if fp(u⃗,v⃗)=0f_p(\vec u, \vec v) = 0; with the usual dot product, this is the same as being ____.

Words:

  • conjugate
  • orthogonal
  • parallel
  • similar
Solution

Two vectors u⃗\vec u, v⃗\vec v are conjugate with respect to a quadratic form if fp(u⃗,v⃗)=0f_p(\vec u, \vec v) = 0; with the usual dot product, this is the same as being orthogonal.

Conjugate is «perpendicular» under the rule of fpf_p. If fpf_p is the usual dot product, conjugate and orthogonal coincide.

Question 14Single choice

If Δ1=2\Delta_1 = 2, Δ2=0\Delta_2 = 0 and Δ3=0\Delta_3 = 0 are the leading principal minors of the matrix of ww, what can be said for sure?

  1. That ww is not definite, and to classify it you have to diagonalise
  2. That ww is positive semidefinite
  3. That ww is indefinite
  4. That ww is positive definite
Solution

Answer: That ww 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 R3\mathbb{R}^3, 2x22x^2 (positive semidefinite) and 2x2−z22x^2 – z^2 (indefinite) have those very minors.

Question 15Single choice

With the dot product defined by the matrix (4229)\begin{pmatrix} 4 & 2 \\ 2 & 9 \end{pmatrix}, the cosine of the angle between (1,0)(1, 0) and (0,1)(0, 1) is:

  1. 13\tfrac13
  2. 0
  3. 213\tfrac{2}{13}
  4. 29\tfrac29
Solution

Answer: 13\tfrac13

cos⁡θ=f(e⃗1,e⃗2)w(e⃗1)w(e⃗2)=a12a11a22=22⋅3=13\cos\theta = \dfrac{f(\vec e_1, \vec e_2)}{\sqrt{w(\vec e_1)}\sqrt{w(\vec e_2)}} = \dfrac{a_{12}}{\sqrt{a_{11}}\sqrt{a_{22}}} = \dfrac{2}{2 \cdot 3} = \dfrac13. The matrix is positive definite (4>04 > 0, 36−4>036 – 4 > 0), so it is a dot product.

Question 16True or false

About the quadratic form w(x,y)=x2−2xy+y2w(x, y) = x^2 – 2xy + y^2:

  1. It is positive semidefinite.
  2. w(1,1)=0w(1, 1) = 0.
  3. It is positive definite because the coefficients of the squares are positive.
  4. Its rank is 1.
Solution
  • T — It is positive semidefinite.
  • T — w(1,1)=0w(1, 1) = 0.
  • F — It is positive definite because the coefficients of the squares are positive.
  • T — Its rank is 1.

w=(x−y)2≥0w = (x – y)^2 \ge 0, and it is 0 along the whole line y=xy = x (a half-pipe). By congruence, D=diag⁡(1,0)D = \operatorname{diag}(1, 0): signature (1,0)(1, 0) and rank 1.

Question 17Single choice

The bilinear form f(u⃗,v⃗)=x1y2−x2y1f(\vec u, \vec v) = x_1y_2 – x_2y_1 is:

  1. Antisymmetric, and its quadratic form is zero
  2. Symmetric
  3. A dot product
  4. Neither symmetric nor antisymmetric
Solution

Answer: Antisymmetric, and its quadratic form is zero

Its matrix is (01−10)\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}, with At=−AA^t = -A. It is the determinant of the two columns, the signed area from topic 5.

Question 18Multiple · wrong ticks subtract

Let AA and A′=CtACA' = C^tAC be the matrices of the same quadratic form in two bases. Tick what they always share:

  1. The rank
  2. The signature
  3. The determinant
  4. 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.

Question 19Single choice

Diagonalising ww by congruence gives D=diag⁡(−1,0,−3)D = \operatorname{diag}(-1, 0, -3). The form is:

  1. Negative semidefinite
  2. Negative definite
  3. Indefinite
  4. Positive semidefinite
Solution

Answer: Negative semidefinite

p=0p = 0 positives and q=2q = 2 negatives with n=3n = 3: (0,r)(0, r) with r=2<3r = 2 < 3, negative semidefinite. An upside-down half-pipe.

Question 20Fill in the gaps

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 (p,q)(p, q) 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 (p,q)(p, q) 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 λ2+1=0\lambda^2 + 1 = 0 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 w=1w = 1 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.

AG exam coming up?The test and practical packs with new solved questions and exercises, their cheat sheets, a blank test and practical exam and MATLAB functions, for free.See the pack

Cheat sheet: bilinear and quadratic forms

The essentials in 30 seconds: f=XtAYf = X^tAY with the coefficient of xiyjx_iy_j in (i,j)(i, j); the matrix of ww is symmetric and the cross terms are split by 2; change of basis A′=CtACA' = C^tAC; conjugates: u⃗ tAv⃗=0\vec u^{\,t}A\vec v = 0; diagonalise by congruence (A∣I)(A \mid I) with the same ERO on rows and columns, basis = rows of CtC^t; signature (p,q)(p, q) and classification; Sylvester for «definite»; dot product = symmetric and positive definite.

I want…By handMATLAB
The matrix of ffCoefficient of xiyjx_iy_j in row ii, column jjA = [ ... ]
f(u⃗,v⃗)f(\vec u, \vec v)Row · matrix · columnu'*A*v
The matrix of wwSquares on the diagonal; cross terms / 2 in (i,j)(i, j) and (j,i)(j, i)expand([x y z]*A*[x; y; z]) to check
The polar formXtAYX^tAY with AA symmetric, or 12[w(u⃗+v⃗)−w(u⃗)−w(v⃗)]\tfrac12[w(\vec u + \vec v) – w(\vec u) – w(\vec v)](A + A')/2
Change of basisA′=CtACA' = C^tAC, or aij′=f(e⃗i′,e⃗j′)a'_{ij} = f(\vec e'_i, \vec e'_j)C'*A*C
Conjugates of u⃗\vec uu⃗ tA\vec u^{\,t}A times (x,y,z)(x, y, z) = 0null(u'*A, 'r')
Diagonalise(A∣I)(A \mid I), same ERO on rows and columnsCt*A*Ct' (check)
ClassifySigns of DD: signature (p,q)(p, q)eig(A) (same signs)
Definite?Sylvester: Δk\Delta_k all >0> 0 (positive) or −,+,−,…-, +, -, \dots (negative)det(A(1:k,1:k))
Cosine with fff(u⃗,v⃗)/w(u⃗)w(v⃗)f(\vec u, \vec v)/\sqrt{w(\vec u)w(\vec v)}, 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 → DD, B′B' = rows of CtC^t → signature → type → check ww of the last vector.
  • With a parameter: minors in terms of the parameter → intervals where it is definite → at the edges (some Δ=0\Delta = 0) and outside, congruence.
  • Conjugate subspace: rows of AA for the given vectors (or u⃗ tA\vec u^{\,t}A) → implicit equations → basis with parameters.
  • Dot product: symmetric? positive definite? If both, cosine; if not, justify and give a vector with w≤0w \le 0.
SymptomLikely cause
expand does not give back your wwCross term not split, or a sign copied wrong
The left side ends up triangular, not diagonalYou did the ERO on rows only
ww of the last vector is not the last number of DDBasis read off the columns, or the column ERO applied to the identity
A «negative definite» rejected because Δ2>0\Delta_2 > 0Sylvester for negative backwards: the even ones are positive
A cosine greater than 1 or the root of a negative numberThe form was not positive definite
A′A' not symmetric when starting from a symmetric oneYou used C−1ACC^{-1}AC instead of CtACC^tAC

Before handing in, ask yourself:

  1. Have I split every cross term by 2 when writing the matrix?
  2. Have I written each row operation with its column operation?
  3. Have I taken the basis from the rows on the right and checked ww of the last vector?
  4. If a cosine is asked for, have I first justified that it is a dot product?
Keep goingAll Linear algebra articles

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)