Bilinear and quadratic forms — theory with skatepark ramps, the bowl, the channel and the saddle (and the cross term I did not split in half)
In the first quiz on this topic I got a really easy question wrong because I did not split the cross term in half. I was given and wrote the matrix with a 6 off the diagonal, in both entries. With that matrix, gives : twice what was there. The 6 of the cross term is shared between the two entries that produce it, 3 and 3, and that detail, which looks trivial, changes the classification, the conjugate vectors and everything that follows.
For this topic it helps me to think about a skatepark. The height of the ground around the lowest point of a ramp is, close up, a quadratic form: an expression like or in which every term has degree 2. Depending on the form, the ramp is a bowl (it rises in every direction), a channel (the half-pipe, flat along its length and rising towards the sides) or a saddle (it rises in one direction and falls in another). Today we see how each form is written with a symmetric matrix, how it is diagonalised so it can be read at a glance and how it is classified without drawing anything. First comes the tool that holds it all up, the bilinear form, which is a dot product with different rules. You are coming from linear transformations and diagonalisation, and here you will use symmetric matrices and elementary operations all the time. After this theory comes the guided practice with problems solved step by step.
In a nutshell: a bilinear form assigns a number to each pair of vectors and is linear in each of them, ; a quadratic form is , with symmetric. It is classified (definite, semidefinite or indefinite) by the signs of its diagonalised matrix or with Sylvester’s criterion.
Table of Contents
Before you start. For this topic all you need is to multiply row by matrix by column, work out small determinants, do elementary row operations and know what a basis and coordinates are (and, for one section, the eigenvalues from topic 5). Nothing else. The topic has three big ideas, in this order: a rule that takes two vectors and returns a number (the bilinear form), with its matrix and how it changes basis; the height of the ramp, which comes from putting the same vector in twice (the quadratic form), with its symmetric matrix, its polar form and conjugate vectors; and how to tell which ramp it is without drawing it (diagonalising, the signature and Sylvester’s criterion). At the end the circle closes with the dot product from topic 4. If you get lost at any point, go back to the skatepark: the whole topic can be told with it.
What a bilinear form is
Before the definition, look at what the dot product you already know does: a bilinear form is that with other numbers. Take and : . Now nudge the vectors a little and watch what happens to the result:
| Test | Calculation | Result | Why |
|---|---|---|---|
| The original | 1 | Starting point | |
| doubled | 2 | Each term carries a single coordinate of : if they all double, the total doubles | |
| split in two pieces | 1 | : each piece contributes its share and they add up | |
| doubled | 2 | The same with the second vector |
Scaling a vector scales the result, and splitting it into pieces splits the result: that is being linear in that vector. The dot product is linear in both, hence the «bi» in bilinear. The clue to spot it: each term carries exactly one coordinate from each vector, like or .
Check you’ve got it: is the rule f(u, v) = x1y1 + x2 bilinear?
No. Step by step: with and it gives . If you double , it gives with : , not 10. The term carries no coordinate of , so it does not notice that you have doubled . Quicker still, with a property that comes a bit further down: with it should give 0, and it gives .
And the skatepark? The height of the ramp will come from a rule like this by putting the same vector in twice: is the bowl. First the rule; the ramp, later. Now, the official names.
A bilinear form on a vector space is a rule that takes two vectors and returns a real number:
and that is linear in each vector when the other one is held fixed:
The example you already know is the dot product from topic 4: , with and . A bilinear form is the same thing with other coefficients. For instance,
is like a dot product that «weighs» each direction differently. With and it gives , even though those vectors are perpendicular under the usual dot product.
Two properties that follow from linearity and come up in the test:
- : if either of them is zero, the result is 0.
- .
Confusing a bilinear form with a linear transformation. A transformation returns a vector; a bilinear form returns a number and takes two vectors. If an expression has products (one coordinate from each vector), it is bilinear; if each coordinate of the result is a sum of , it is a transformation.
The matrix of a bilinear form
Before the rule, a question: why are four numbers enough to know all of ? Because of linearity. Write and . Linearity in the first vector lets you take and outside, and linearity in the second, and . You are left with four pieces, one for each pair of basis vectors:
If you know on those four pairs, you know it on any pair. With the of the example, , , and . With and , piece by piece:
| Piece | Contributes | Why | |||
|---|---|---|---|---|---|
| 1 | 3 | 2 | 6 | First coordinate of both, with its weight 2 | |
| 1 | 1 | First of with second of | |||
| 2 | 3 | 1 | 6 | Second of with first of : it is a different piece, even if it weighs the same | |
| 2 | 3 | Second of both, with its weight 3 | |||
| Total | 5 | The four pieces are added up |
Those four numbers, placed in a table with the row for the first vector and the column for the second, are the matrix of . That is exactly what the definition says.
As with transformations, everything is decided in a basis. If , the associated matrix of in is the one with the number
in entry , and with it, writing the coordinates of as a row and those of as a column,
With the standard basis there is a quick rule: the coefficient of goes in row , column . The picks the row and the , the column. In the example above:
Let us do a calculation to see that the product works. With and , first and then the row times that:
And substituting into the expression: . It matches.
Writing or putting the coordinates of in a column. The order is row · matrix · column: the first vector as a row (transposed), the second as a column. With a matrix that is not symmetric, changing the order changes the result.
Symmetric and antisymmetric
A bilinear form is:
- Symmetric if for every pair of vectors, that is, if its matrix is symmetric (). The example above and the dot product are.
- Antisymmetric if , that is, if . An example with history: is the determinant , the signed area of the parallelogram spanned by and , the one you saw in topic 5.
Not every bilinear form is one or the other: has matrix , which is neither symmetric nor antisymmetric.
Change of basis: congruent matrices
If you change basis, the matrix of changes, and the formula is not the one from topic 5. If is the change-of-basis matrix from the new basis to the old one (the vectors of in columns):
The reason: if and , then . The two matrices come from the two vectors that takes.
There is another way to compute , straight from the definition: . It is slower, but useful as a check.
Two matrices with (with invertible) are called congruent. They have the same rank, called the rank of the bilinear form. But, careful, in general they do not have the same determinant or the same eigenvalues.
| Linear transformation (topic 5) | Bilinear form (topic 6) | |
|---|---|---|
| Takes | One vector | Two vectors |
| Returns | A vector | A number |
| Expression | ||
| Change of basis | (similar) | (congruent) |
| Preserved | Determinant, trace, eigenvalues, rank | The rank (and the signs of the diagonal, as you will see) |
With the example and the basis :
Diagonal, and not by chance: . The two basis vectors are «perpendicular for ». That is called being conjugate, and it is the idea behind almost everything left in this topic.
Using with a bilinear form. That is the formula for transformations. Here, : no inverses, with the transpose. If you start from a symmetric matrix and get one that is not symmetric, you used the wrong formula ( always preserves symmetry).
The new matrix, entry by entry
gives in one go; the other way, , shows what each entry means. The new vectors are and , and the rule is :
| Entry | Pair | Calculation | Result | Why |
|---|---|---|---|---|
| with | 2 | is the old : the entry does not change | ||
| with | 0 | The 2 and the cancel: the two vectors are conjugate | ||
| with | 0 | The form is symmetric: it has to give the same as | ||
| with | 10 | The four pieces, with |
The same as with the product, and you can see where the 10 comes from: of the second vector with itself.
Look at the determinants: and . They do not match, as warned above, but they do not change at random: . Since is always positive, the sign of the determinant is preserved.
Quadratic forms: the height of the ramp
Before the formula, get on the ramp: work out the height at a few points on the ground for the bowl , the half-pipe and the saddle :
| Point | Bowl | Half-pipe | Saddle | Why |
|---|---|---|---|---|
| 1 | 1 | 1 | One step in the direction: all three rise | |
| 1 | 0 | One step in the direction: the bowl rises, the half-pipe stays flat, the saddle falls | ||
| 4 | 4 | 4 | Twice as far as : four times higher, not twice | |
| 1 | 1 | 1 | Backwards it rises as much as forwards: the signs disappear when squaring | |
| 2 | 1 | 0 | In the saddle, what it gains in it loses in |
Three things come out on their own. At the origin, height 0. Going twice as far multiplies the height by 4: the mark that every term has degree 2. And the height at is the dot product of with itself: , exactly what the bowl gives.
Check you’ve got it: which ramp is w = -x², and what height does it have at (0, 3) and at (2, 0)?
It is the upside-down half-pipe: and . Step by step: at the is 0, so the height is 0: flat along its length. At , : towards the sides it falls, four times more than at . It never rises and there are points other than the origin with height 0: negative semidefinite.
A quadratic form is exactly that, a vector «with itself», but with any symmetric bilinear form instead of the dot product.
If you put the same vector twice into a symmetric bilinear form, you get a quadratic form:
With the example, . Every term has degree 2: squares , and cross products . With the usual dot product, : the squared length.
This is where the skatepark comes in. If is the position on the ground measured from the lowest point of a ramp, the height at each point is, close up, a quadratic form. Three ramps, three forms:
- The bowl: . It rises in every direction.
- The half-pipe (channel): . It rises towards the sides and is flat along its length (in the direction, the height does not change).
- The saddle ramp: . It rises in the direction and falls in the direction.
Properties of a quadratic form you will be asked about:
- : at the lowest point, height zero.
- : if you go twice as far in the same direction, the height is multiplied by 4. That is why it is «quadratic».
- .
From the expression to the matrix: the cross term is split in half
The matrix of is that of its symmetric bilinear form, so it is always symmetric. To write it from the expression:
- The coefficients of the squares go on the diagonal.
- The coefficient of each cross term is divided by 2 and goes in entries and .
The reason is the one from my story: adds and , which are the same term. If you put 6 in both entries, you get .
Check: .
The polar form: the symmetric bilinear form behind it
One quadratic form comes from infinitely many bilinear forms: , and all give when . But only one is symmetric: the polar form, computed as
or, faster, with the symmetric matrix: . For :
Some Campus quizzes give as «associated bilinear form» an expression with the cross term not shared out, for example in one entry and nothing in the other. That bilinear form gives the same , so it is not false that it is «associated», but the polar form, the one that defines the matrix of , is the symmetric one, with the term split in half. In the written exam, always the symmetric one.
The polar form formula, in words
The formula for comes from the last property of the quadratic form. If is symmetric, and are the same number, and the property becomes . Read aloud: the height of the sum is the height of each one plus twice what they «share». Solve for what they share and you have the polar form: from the height of the sum you take away the two separate heights and split what is left by 2.
With , and :
| Step | Calculation | Result | Why |
|---|---|---|---|
| Height of the sum | 9 | ||
| Height of | 1 | Only the is left | |
| Height of | 2 | Only the is left | |
| What is left over | 6 | It is the whole cross term, the | |
| Divided by 2 | 3 | It is entry of the matrix |
The 3 in the matrix comes out again, this time only from heights.
Conjugate vectors: perpendicular for the ramp
Two vectors and are conjugate with respect to if
It is the idea of «perpendicular» with the rule of instead of the usual dot product. With the usual dot product, conjugate and orthogonal are the same.
All the vectors conjugate to a given one (or to a set) form a subspace. You compute it by writing the known vector as a row and the unknown as a column: you get a linear equation (or several), that is, implicit equations like the ones in topic 3.
With (matrix ), the vectors conjugate to :
A line of , with basis . It is exactly the second vector of the basis that gave us the diagonal matrix in the change-of-basis section. In the picture, the curve is a tilted ellipse, and the conjugate vectors are the directions of two diameters that «share» the ellipse: the tangent at the tip of one is parallel to the other.
Checking whether two vectors are conjugate by looking at their usual dot product. and are not perpendicular (), but they are conjugate with respect to this . Always with the matrix of the form.
Classifying a quadratic form: which ramp is it?
Classifying means saying what sign it has for every non-zero vector. There are five types:
| Type | Condition (for every ) | Ramp | Example in |
|---|---|---|---|
| Positive definite | Bowl: rises in every direction | ||
| Negative definite | Mound: falls in every direction | ||
| Positive semidefinite | , with some giving 0 | Half-pipe: rises or stays flat | |
| Negative semidefinite | , with some giving 0 | Upside-down half-pipe | |
| Indefinite | Takes positive and negative values | Saddle |
With these «clean» expressions (only squares) you see it at a glance. With you no longer do: the cross term could make the total negative for some vector. The strategy is to get rid of the cross terms: find a basis in which the matrix is diagonal, because then and you read the type from the signs of
The signature and the law of inertia
When you diagonalise , the numbers on the diagonal are not unique: they depend on the operations you do. But there is something that never changes: how many are positive, how many negative and how many zero. That is Sylvester’s law of inertia. That is why we define the signature
with the number of positive entries on the diagonal and the number of negative ones. Also, , and if :
| Signature | Type |
|---|---|
| Positive definite | |
| Negative definite | |
| with | Positive semidefinite |
| with | Negative semidefinite |
| with and | Indefinite |
Diagonalising by congruence
Before the algorithm, do it in your head: complete the square. Take the hidden saddle from the example coming up, . The terms with are , and has both of them, but with too many. So you take them away:
If you call and , the form is : no cross terms, and you can read that it is a saddle. That is diagonalising. The new basis comes from undoing the change: and , so the first new vector () is and the second () is . The algorithm will give exactly this basis.
With three or more variables it is easy to get lost completing squares; the algorithm does the same, in order: the operation is the «» in , and what is left on the diagonal are the numbers in front of each square. With the example that comes later it is the same: , and the numbers in front, 1, 1 and 2, are those of its .
Check you’ve got it: complete the square of w = 2x² + 2xy + 3y². Which ramp is it?
: a bowl, positive definite. Step by step: , and the square that starts with is , so : you have overshot by , and of you have left. Both numbers in front are positive: signature . With the basis from the change of basis we got 2 and 10: different numbers, same signs. That is the law of inertia.
This is the exam method. It looks for a basis of conjugate vectors (the basis ) in which the matrix is diagonal, , using elementary operations.
The algorithm:
- Write and, to its right, the identity: .
- Do an elementary row operation on the whole strip (left and right) and, right after it, the same operation on the columns, but only on the left part. That way the left part stays symmetric.
- Repeat until the left is diagonal: that is . On the right you are left with , and its rows are the vectors of the basis .
An example in ℝ²: the hidden saddle
, with (the 4 is split into 2 and 2). We need a 0 below the 1:
The column operation only touches the left part: it removes the 2 left at the top. Result:
Signature : indefinite. It looked like a bowl because every coefficient is positive, but it is a saddle. Check with the vector : , and with : . And the two vectors of are conjugate: .
In the new basis, with coordinates , the form is simply : the saddle from the table, seen through the right glasses.
The same calculation, slowly and with the reason for each step:
| Step | Operation | Left (A) | Right | Why |
|---|---|---|---|---|
| 0 | Write | rows and | rows and | The right side will keep a record of the row operations |
| 1 | , on the whole strip | rows and | rows and | The pivot is the 1: subtracting row 1 twice makes the 0 below it (, ) |
| 2 | , only on the left | rows and | unchanged | The same operation on columns removes the 2 at the top () and the left is symmetric again |
| 3 | Read | : diagonal 1 and | : rows and | The left is now diagonal; the rows on the right are the basis |
Why is the column operation not done on the right? Because the right is only the record of the row operations, and those rows end up being the basis. And the basis you get, , is the one from completing the square: the is the «» in , undone.
Doing the operation only on the rows. You are left with , which is triangular, neither diagonal nor symmetric. In congruence, every row operation is followed by the same one on the columns.
An example in ℝ³
, with
First step: the pivot is the 1 at the top; with and we get zeros in row and column 1 (row 3 already has a 0).
Second step: the pivot is the 1 in the center; with and :
Signature : positive definite. A bowl in three dimensions (it cannot be drawn, but the numbers say the same).
Check the last row of by computing of that vector: it must give the last number of . Here, . And any two rows must be conjugate.
The other method: finding the conjugates by hand
Exam solutions also use a second method, which gives the same: choose a first vector with (for instance ), compute the subspace of its conjugates and pick a there with ; then a conjugate to both, and so on. The matrix in the basis is diagonal with on the diagonal. In the example, the conjugates of satisfy , hence ; the conjugates of both satisfy and , hence . The same basis.
And by similarity, with eigenvalues
Since is symmetric, it can also be diagonalised as in topic 5, with . Then the diagonal holds the eigenvalues, and the signature is read from their signs: = positive eigenvalues and = negative ones. The drawback is practical: the eigenvalues are almost never integers. Those of are , that is, about and : one positive and one negative, signature , as by congruence, but with much more work.
There is one case where the eigenvalue method is lovely: when they do come out nicely. The form has the matrix of the diagonal filter from topic 5, , with eigenvalues 1 and 3 and eigenvectors and . It is an elongated bowl, and its axes are the eigenvectors: it rises slowly () in the direction and quickly () in the direction .
In the Plane transformations simulator, if you type a symmetric matrix you can see the curve (an ellipse if it is positive definite, a hyperbola if it is indefinite) with its axes, which are the eigenvectors.
Sylvester’s criterion: classifying without diagonalising
Before the criterion, an observation. In the example, the diagonal came out 1, 1 and 2. Multiply them from left to right, accumulating: 1, then , then . Now work out the determinants of the top-left corners of its matrix : the one is 1, the one is and the one is 2. The same numbers come out. With the hidden saddle, the same: diagonal 1 and , products 1 and , and the corners give 1 and .
It is not a coincidence. If you diagonalise only with «to a lower row, add or subtract a multiple of a row above» (and the same on columns), the determinants of the corners do not change. And at the end, with the matrix diagonal, each corner equals the product of the diagonal numbers that fall inside it. The other way round: each diagonal number is a corner divided by the previous one.
With that, the criterion follows on its own: if all the diagonal numbers are positive, so are the accumulated products; if they are all negative, the products alternate (one negative, two give positive, three give negative…). Those corner determinants have an official name, leading principal minors, and the shortcut that comes out of this is called Sylvester’s criterion.
Check you’ve got it: classify w = -x² + 2xy – 2y² with Sylvester.
Negative definite. Step by step: the matrix is (the is split into 1 and 1). The first corner is and the second, : they alternate starting with negative. The diagonal numbers would be and , both negative. Completing the square: , a mound.
To find out whether a form is definite (positive or negative) there is a shortcut with determinants. The leading principal minors of are the determinants of the top-left corners:
Sylvester’s criterion:
- is positive definite for all .
- is negative definite the signs alternate starting with negative: , , , … (odd orders negative, even orders positive).
With the example: , and . All three positive: positive definite, the same as by congruence (and notice that , and are 1, 1 and 2: the diagonal we got).
Why do they alternate for negative definite? Because if is negative definite, is positive definite, and changing the sign of a matrix of order multiplies its determinant by : the odd-order ones change sign.
Thinking negative definite means «all minors negative». With , but . The even ones are positive.
Sylvester only decides whether it is definite. If some minor is 0, or the signs follow neither pattern, the form is semidefinite or indefinite, and to know which you have to diagonalise. The half-pipe has and : Sylvester says nothing, and it is positive semidefinite.
A dot product with another rule: the cosine «according to f»
This closes the circle with topic 4. A dot product (inner product) is precisely a symmetric bilinear form whose quadratic form is positive definite. So every positive definite form gives you a new way of measuring lengths and angles:
With the positive definite form of the example (matrix ), the angle between and is:
With the usual dot product, those two vectors form 90°; with this rule, 45°. It is a classic exam question: «study whether defines a dot product and, if so, compute the cosine of the angle between…». If the form is not positive definite, the answer is that it is not a dot product and there is no cosine to compute.
Computing the cosine without first checking that is positive definite. If it is not, can be negative or zero and the square root in the denominator makes no sense. Classify first; cosine after.
The same in MATLAB
MATLAB has no command to diagonalise by congruence, but it checks everything else. This script goes over the example: the expression of from the matrix, the diagonal with , Sylvester’s minors and the cosine.
format rat A = [1 1 0; 1 2 -1; 0 -1 3]; % symmetric matrix of w syms x y z w = expand([x y z]*A*[x; y; z]) % the expression of w Ct = [1 0 0; -1 1 0; -1 1 1]; % rows = basis B' (congruence) D = Ct*A*Ct' % C^t A C, with C = Ct' det(A(1,1)), det(A(1:2,1:2)), det(A) % leading principal minors e1 = [1;0;0]; e2 = [0;1;0]; c = (e1'*A*e2) / sqrt((e1'*A*e1)*(e2'*A*e2)) % cosine according to f
Output:
w =
x^2 + 2*x*y + 2*y^2 - 2*y*z + 3*z^2
D =
1 0 0
0 1 0
0 0 2
ans =
1
ans =
1
ans =
2
c =
985/1393
What to look at:
[x y z]*A*[x; y; z]is literally with letters;expandmultiplies it out and the cross terms come out with their whole coefficient (), even though in the matrix they are shared (1 and 1).Ct*A*Ct'is with : it gives the paper . If you get a row ofCtwrong, it stops coming out diagonal.A(1:2,1:2)is the top-left corner: its determinants are Sylvester’s minors.- The cosine comes out as , the fraction
format ratuses for . Typeformat shortto see it as a decimal.
And the hidden saddle, by eigenvalues:
format short A2 = [1 2; 2 3]; % w = x^2 + 4xy + 3y^2 eig(A2) % one negative and one positive eigenvalue det(A2) % Delta_2 < 0: not definite
Output:
ans =
-0.2361
4.2361
ans =
-1
The eigenvalues, about and (the ), have different signs: indefinite, as by congruence.
Try it in the MATLAB playground
In the website’s MATLAB playground you can run this script without installing anything. It computes the height of three skatepark ramps at a few points and classifies them by their eigenvalues.
P = [1 0; 0 1; 1 1; 1 -1]'; % four points in columns A = [1 0; 0 1]; % bowl: x^2 + y^2 heights = diag(P'*A*P)' % w at each point eig(A)' % signs of the eigenvalues A = [1 0; 0 0]; % half-pipe: x^2 heights = diag(P'*A*P)' eig(A)' A = [1 0; 0 -1]; % saddle: x^2 - y^2 heights = diag(P'*A*P)' eig(A)'
Things to look at:
- In the half-pipe, the point has height 0 even though it is not the origin: that is what tells a semidefinite form from a definite one.
- In the saddle, gives and gives : values of both signs, indefinite.
- Change the last
Ato[1 2; 2 3](the hidden saddle) and look for a point with negative height. - Try
[2 1; 1 2](the elongated bowl) and check that at it rises faster than at .
Summary
| Concept | What it is | How to do it by hand | In MATLAB |
|---|---|---|---|
| Bilinear form | Two vectors → a number, linear in each | , | x'*A*y |
| Change of basis | Congruent matrices | C'*A*C | |
| Quadratic form | ; cross terms divided by 2 | expand([x y]*A*[x; y]) | |
| Polar form | The symmetric bilinear form of | with symmetric | x'*A*y |
| Conjugates | Known vector as a row: implicit equations | u'*A (coefficients) | |
| Diagonalising | with conjugate | : same ERO on rows and columns | Ct*A*Ct' (check) |
| Signature | : positives and negatives of | Signs of the diagonal or of the eigenvalues | eig(A) |
| Sylvester | Positive or negative definite | Signs of | det(A(1:k,1:k)) |
| Dot product | Symmetric and positive definite | (u'*A*v)/sqrt(...) |
Three ideas to take away:
- A quadratic form is the height of a ramp: its matrix is symmetric and the cross terms are split in half between the two entries.
- Classifying means getting rid of the cross terms. Diagonalising by congruence (the same operation on rows and columns), the signs of the diagonal give the signature, and that signature does not depend on how you diagonalise.
- Sylvester is a shortcut only for «definite»: all positive, or alternating starting with negative. If you get anything else, diagonalise. And only a positive definite form is a dot product you can measure angles with.
Now it is your turn: in the guided practice on bilinear and quadratic forms we solve five problems step by step, each one checked in MATLAB. And to check you have got it, the bilinear and quadratic forms exercises go from easy to hard, come with commented solutions and include a quiz like the Campus ones. After that, topic 7: complex numbers, where the roots of that the 90° rotation was missing finally appear. You will find them in complex numbers.
Next step: practiceBilinear and quadratic forms — guided practice with ramps that look like bowls, conjugates that are not perpendicular and a dot product with its cosine (and the diagonal that came out with fractions)Did this article help you? Here is how you can support SergioLearns →



