Change of Variable Quadratic Form Calculator
Transform a quadratic form under a linear substitution, compute the new coefficients instantly, and visualize how the quadratic, cross, and constant-free structure changes from one coordinate system to another.
Calculator
Results
Enter coefficients and a change of variables, then click Calculate Transformation.
How this works
For the quadratic form
Q(x, y) = ax² + bxy + cy²
with substitution
x = pu + qv, y = ru + sv,
the transformed form becomes
Q(u, v) = Au² + Buv + Cv²
where:
- A = ap² + bpr + cr²
- B = 2apq + b(ps + qr) + 2crs
- C = aq² + bqs + cs²
Matrix view: if M = [[a, b/2], [b/2, c]] and T = [[p, q], [r, s]], then the new symmetric matrix is TᵀMT.
Expert Guide to the Change of Variable Quadratic Form Calculator
A change of variable quadratic form calculator is designed to help you transform a quadratic expression from one coordinate system into another. In two variables, the standard form is Q(x, y) = ax² + bxy + cy². This kind of expression appears constantly in linear algebra, multivariable calculus, optimization, statistics, mechanics, and differential equations. When you substitute new variables such as x = pu + qv and y = ru + sv, the same quadratic form is rewritten in terms of u and v. The calculator on this page performs that conversion quickly and makes it easy to inspect the resulting coefficients.
The practical reason this matters is simple: some coordinate systems reveal the geometry of a quadratic form better than others. In one basis, a cross-term like bxy can make the expression look complicated. After a suitable change of variables, the cross-term may shrink or disappear, exposing whether the form is positive definite, negative definite, indefinite, or degenerate. That is why change-of-variable methods are central to diagonalization, conic section analysis, and matrix-based optimization.
What the calculator computes
This calculator starts with the original coefficients a, b, and c, and then uses the transformation matrix
T = [[p, q], [r, s]].
In matrix notation, the original quadratic form corresponds to the symmetric matrix
M = [[a, b/2], [b/2, c]].
After the substitution, the transformed matrix is
N = TᵀMT.
That matrix produces the new coefficients A, B, and C in
Q(u, v) = Au² + Buv + Cv².
The formulas used are exactly:
- A = ap² + bpr + cr²
- B = 2apq + b(ps + qr) + 2crs
- C = aq² + bqs + cs²
These formulas are not approximations. They are the direct algebraic expansion of the substitution. As long as the input values are entered correctly, the calculator returns the exact transformed coefficients up to the decimal precision you choose.
Why invertibility matters
In a true change of variables, the matrix T should be invertible. That means its determinant must be nonzero:
det(T) = ps – qr ≠ 0.
If the determinant is zero, the substitution collapses the plane into a line or a point, so it no longer represents a reversible coordinate change. The calculator still helps you see the algebraic effect, but a zero determinant means you do not have a valid one-to-one change of coordinates.
A useful invariant relationship connects the old discriminant and the new one. For the form ax² + bxy + cy², the discriminant is D = b² – 4ac. Under a linear change of variables, the transformed discriminant becomes
D’ = B² – 4AC = (det(T))²D.
This tells you something profound: the sign of the discriminant is preserved under any invertible real change of variables. So a form that is indefinite does not become positive definite simply because you renamed the coordinates.
How to use this calculator step by step
- Enter the original quadratic form coefficients a, b, and c.
- Enter the substitution coefficients p, q, r, and s.
- Choose your preferred decimal precision.
- Click Calculate Transformation.
- Read the transformed form, determinant, discriminants, and classification.
- Use the chart to compare the original coefficients with the new coefficients visually.
This workflow is especially useful when checking homework, validating symbolic manipulations, or exploring how different substitutions alter the shape of a quadratic expression.
Interpreting the transformed quadratic form
Once the calculator returns A, B, and C, you can interpret the new expression geometrically. If B = 0, then the cross-term disappears, which is often the goal of diagonalization. If both A and C are positive and the matrix is nonsingular in the appropriate sense, the form is generally positive definite. If one is positive and the other negative after diagonalization, the form is indefinite. The exact classification is tied to the signs of the leading principal minors or, equivalently in two dimensions, to the determinant and the sign of a.
- Positive definite: values are strictly positive for all nonzero vectors.
- Negative definite: values are strictly negative for all nonzero vectors.
- Indefinite: takes both positive and negative values.
- Semidefinite or degenerate: can be zero for nonzero vectors.
These classifications matter in optimization because a positive definite quadratic form indicates local convexity, while an indefinite form often corresponds to saddle behavior. In multivariable calculus, this is part of the second derivative test. In statistics, symmetric positive definite matrices appear in covariance structures and Mahalanobis-distance formulations. In mechanics and vibrations, quadratic energy expressions determine stability and mode interactions.
Comparison table: computed examples of variable changes
| Original form | Substitution | New form | det(T) | Original D = b² – 4ac | New D’ = B² – 4AC |
|---|---|---|---|---|---|
| 5x² + 4xy + y² | x = u + v, y = u – v | 10u² + 8uv + 2v² | -2 | -4 | -16 |
| 2x² – 6xy + 8y² | x = u + 2v, y = v | 2u² + 2uv + 4v² | 1 | -28 | -28 |
| x² – 4xy + 3y² | x = v, y = u | 3u² – 4uv + v² | -1 | 4 | 4 |
The examples above show a real and important pattern: when |det(T)| = 1, the discriminant magnitude stays the same. When |det(T)| is larger than 1, the discriminant scales by its square. This is a concise way to verify whether your transformed coefficients are consistent with the underlying linear substitution.
Where this tool is useful in practice
Students first encounter quadratic forms in linear algebra courses, but the same framework is used in many applied fields. Here are common use cases:
- Linear algebra: basis changes, orthogonal diagonalization, and canonical forms.
- Calculus: classifying critical points with Hessian matrices.
- Optimization: identifying convex and non-convex quadratic objectives.
- Statistics: understanding covariance-based quadratic expressions.
- Physics and engineering: kinetic energy, potential energy, inertia, and stress transformations.
- Computer graphics: conic and quadric transformations under coordinate changes.
Comparison table: effect of the substitution matrix on interpretation
| Transformation type | Typical matrix T | det(T) | Main effect on the form | Practical interpretation |
|---|---|---|---|---|
| Coordinate swap | [[0, 1], [1, 0]] | -1 | Interchanges the variable roles | Useful for checking symmetry and basis ordering |
| Shear | [[1, k], [0, 1]] | 1 | Can reduce or reshape the cross-term | Common in algebraic simplification and canonical reduction |
| Rotation-style change | [[cos θ, -sin θ], [sin θ, cos θ]] | 1 | Preserves lengths and often removes mixed terms | Essential in principal axis analysis |
| Scaling | [[m, 0], [0, n]] | mn | Stretches coefficient magnitudes | Used in normalization and dimensional rescaling |
Common mistakes the calculator helps prevent
By far the most common mistake is mishandling the mixed term. Because the matrix representation uses b/2 in the off-diagonal positions, many manual calculations incorrectly double or halve the cross coefficient. Another frequent error is entering a singular substitution matrix and assuming it is a valid coordinate change. This calculator reports the determinant so you can check invertibility immediately.
Another issue appears when learners confuse a substitution in the variables with a similarity transform on a matrix. For quadratic forms, the correct matrix update is TᵀMT, not TMT⁻¹. Those are different operations with different meanings. The former preserves the scalar value of the form under the variable substitution; the latter changes matrix representation in a different context.
Authoritative references for further study
If you want to deepen your understanding, consult high-quality educational and public resources on linear algebra, quadratic forms, and matrix transformations:
- MIT 18.06 Linear Algebra
- Not included because it is not .gov or .edu
- MIT OpenCourseWare: Linear Algebra
- National Institute of Standards and Technology
- UC Berkeley Department of Mathematics
Final takeaway
A change of variable quadratic form calculator is more than a convenience tool. It is a fast way to inspect how a quadratic expression behaves under a new coordinate system, verify hand calculations, and connect algebra with geometry. Whether you are simplifying a mixed term, studying principal axes, classifying a critical point, or checking a matrix computation, the transformed coefficients A, B, and C tell the story. Use the calculator above to test examples, compare old and new coefficients visually, and build intuition about how coordinate changes reshape quadratic forms without changing their essential nature.