quadratic forms calculator

2-Variable Quadratic Form Tool

Use this calculator for forms of the type Q(x,y) = ax² + bxy + cy². It classifies the form (positive definite, indefinite, etc.), computes eigenvalues, shows the matrix representation, and optionally evaluates Q at a point.

Tip: If both x and y are provided, the calculator also returns Q(x,y).

What is a quadratic form?

A quadratic form is a second-degree polynomial where every term has degree 2. In two variables, the standard form is:

Q(x,y) = ax² + bxy + cy²

Quadratic forms appear all over mathematics and engineering: optimization, machine learning loss functions, conic sections, stability analysis, geometry, and statistics (for example, covariance-related expressions).

Matrix representation

Every 2-variable quadratic form can be written as Q(x,y) = [x y] A [x y]ᵀ with a symmetric matrix:

A = [[a, b/2], [b/2, c]]

The bxy term is split across the off-diagonal entries because matrix multiplication produces two matching cross-terms.

How to interpret the result

1) Definiteness classification

  • Positive definite: Q(x,y) > 0 for all nonzero (x,y).
  • Negative definite: Q(x,y) < 0 for all nonzero (x,y).
  • Indefinite: positive for some directions, negative for others.
  • Semidefinite: never changes sign, but can be zero for nonzero vectors.

For 2×2 forms, the key quantity is det(A) = ac - (b²/4). The calculator uses this determinant and the leading principal term to classify the form.

2) Eigenvalues

Eigenvalues tell you curvature along principal directions. If both eigenvalues are positive, the form is positive definite. If one is positive and one negative, the form is indefinite.

3) Rotation angle

If b ≠ 0, the cross term can be removed by rotating coordinates. The angle θ = 0.5 * atan2(b, a-c) gives principal axis orientation.

Example

Suppose Q(x,y)=2x²+xy+3y². Because the determinant 2·3 - (1²/4) = 5.75 is positive and a=2 is positive, the form is positive definite. That means the graph is bowl-shaped and has a unique minimum at the origin.

Practical use cases

  • Checking convexity in optimization problems.
  • Classifying conic sections in analytic geometry.
  • Analyzing energy functions in physics and mechanics.
  • Studying Hessian matrices in multivariable calculus.

Common mistakes to avoid

  • Using b directly as the matrix off-diagonal term (it should be b/2).
  • Confusing the polynomial discriminant b²-4ac with det(A).
  • Trying to classify using only one coefficient.

Final thoughts

Quadratic forms are one of those topics that reward intuition. Once you see them as geometry encoded in a matrix, concepts like definiteness, curvature, and eigenvectors become much easier to connect. Use the calculator above to test examples quickly and build that intuition.

🔗 Related Calculators

🔗 Related Calculators