Why Complete Squares?
A quadratic equation in \(x\), \(y\), and \(z\) may not immediately reveal what surface it describes. Linear terms can hide the location of the surface, and different coefficients can obscure its shape. Completing the square separates these features: it moves the equation to a suitable center or vertex and puts the equation into a form that can be classified.
This method applies to equations with no mixed terms such as \(xy\), \(xz\), or \(yz\). The goal is not only to name the surface. The completed equation also tells us where its center or vertex is, and which coordinate directions determine its axes.
The Completing-Squares Formula
For a nonzero coefficient \(A\), the quadratic and linear terms in \(x\) combine according to this identity:
The square is centered at \(x=-D/(2A)\). Apply the same identity to each variable whose quadratic coefficient is nonzero. If \(A\), \(B\), and \(C\) are all nonzero, the equation becomes
where
Thus the translation coordinates are \(x_0=-D/(2A)\), \(y_0=-E/(2B)\), and \(z_0=-F/(2C)\). In translated coordinates \(X=x-x_0\), \(Y=y-y_0\), and \(Z=z-z_0\), the equation is \(AX^2+BY^2+CZ^2=H\). These coordinates identify the center for a centered surface such as an ellipsoid or hyperboloid.
Classifying the Centered Forms
After completing squares, divide by the nonzero right-hand side or by the absolute values of the coefficients to obtain standard form. The squared terms’ signs determine the broad type of surface; their denominators determine the scale along each coordinate direction.
| Standard form | Classification and location |
|---|---|
| \(\frac{X^2}{a^2}+\frac{Y^2}{b^2}+\frac{Z^2}{c^2}=1\) | Ellipsoid centered at the translated origin \((x_0,y_0,z_0)\). |
| \(\frac{X^2}{a^2}+\frac{Y^2}{b^2}-\frac{Z^2}{c^2}=1\) | Hyperboloid of one sheet, centered at \((x_0,y_0,z_0)\); the negative term’s direction is the axis direction. |
| \(-\frac{X^2}{a^2}-\frac{Y^2}{b^2}+\frac{Z^2}{c^2}=1\) | Hyperboloid of two sheets, centered at \((x_0,y_0,z_0)\); the positive term’s direction is the axis direction. |
| \(\frac{X^2}{a^2}+\frac{Y^2}{b^2}-\frac{Z^2}{c^2}=0\) | Elliptic cone with vertex at \((x_0,y_0,z_0)\). |
Here \(a\), \(b\), and \(c\) are positive. The coordinate directions of the translated variables are the principal directions in these forms. If all three squared terms have the same sign before normalization, the right-hand side determines whether the surface is an ellipsoid, a single point, or empty. For example, a sum of nonnegative squares can equal zero only when every square is zero; it cannot equal a negative number.
For a mixed-sign equation, first multiply the entire equation by \(-1\), if needed, so that two squared terms are positive and one is negative. Then compare the resulting right-hand side with zero. A positive right-hand side gives the one-sheet form; a negative right-hand side can be multiplied through by \(-1\) to give the two-sheet form; a zero right-hand side gives a cone.
Worked Example: A Translated Ellipsoid
Worked Example: A Translated Ellipsoid
Classify \(2x^2+y^2+4z^2-8x+6y-16z+21=0\), and find its center and axis lengths.
Group the terms by variable, including the constant:
Complete each square. For \(x\), factor out \(2\), then use half of \(-4\); for \(y\), use half of \(6\); for \(z\), factor out \(4\), then use half of \(-2\):
Evaluate the constants: \(2(-4)=-8\), \(-9\), and \(4(-4)=-16\). Their sum with \(21\) is \(-12\). Therefore,
Divide by \(12\) and write each term with denominator one:
All three terms are positive, so this is an ellipsoid. Its center is \((2,-3,2)\); its semi-axis lengths along the \(x\)-, \(y\)-, and \(z\)-directions are \(\sqrt{6}\), \(\sqrt{12}\), and \(\sqrt{3}\), respectively.
To check, expand the completed equation: \(2(x-2)^2=2x^2-8x+8\), \((y+3)^2=y^2+6y+9\), and \(4(z-2)^2=4z^2-16z+16\). Setting their sum equal to \(12\) and subtracting \(12\) gives \(2x^2+y^2+4z^2-8x+6y-16z+21=0\), the original equation.
Worked Example: A Hyperboloid of One Sheet
Worked Example: A Hyperboloid of One Sheet
Classify \(x^2+4y^2-z^2-2x+8y+4z=0\), and locate its center and axis direction.
Complete the square in each variable:
The first group is \((x-1)^2-1\). The second is \(4((y+1)^2-1)=4(y+1)^2-4\). Since \(-(z^2-4z)=-((z-2)^2-4)=-(z-2)^2+4\). Substituting gives
The constant terms sum to \(-1\), so
or, in standard form,
There are two positive terms and one negative term, with right-hand side \(1\), so this is a hyperboloid of one sheet. Its center is \((1,-1,2)\), and its axis direction is the \(z\)-direction, corresponding to the negative squared term.
For a check, expand the completed equation’s left side: \((x-1)^2=x^2-2x+1\), \(4(y+1)^2=4y^2+8y+4\), and \(-(z-2)^2=-z^2+4z-4\). Subtracting the right-hand side \(1\) leaves \(x^2+4y^2-z^2-2x+8y+4z=0\), as required.
When a Variable Is Linear
Completing a square requires a nonzero quadratic coefficient. If, for example, the equation contains \(-z\) but no \(z^2\), do not try to complete a square in \(z\). Complete squares in the variables that have quadratic terms, then isolate \(z\). A standard form such as \(z=(x-x_0)^2/a^2+(y-y_0)^2/b^2+z_0\) describes an elliptic paraboloid with vertex \((x_0,y_0,z_0)\) opening in the positive \(z\)-direction. Reversing the sign on the right reverses the opening direction.
If a variable appears in neither a square nor a linear term, the equation does not depend on that coordinate. The surface extends along that coordinate direction, as in a cylinder. These observations are useful when the initial equation has missing quadratic terms; the completion method applies only to the terms that are present.
Worked Example: Finding a Paraboloid’s Vertex
Worked Example: Finding a Paraboloid’s Vertex
Rewrite \(2x^2+2y^2-8x+4y-z+10=0\) in standard form, then identify its vertex and opening direction.
Group the quadratic and linear terms in \(x\) and \(y\). Complete their squares:
The constant contributions are \(2(-4)=-8\) and \(2(-1)=-2\), which sum with \(10\) to zero. Thus
Equivalently, \(\frac{(x-2)^2}{1/2}+\frac{(y+1)^2}{1/2}=z\). This is an elliptic paraboloid with vertex \((2,-1,0)\), opening in the positive \(z\)-direction because \(z\) is a sum of nonnegative terms.
Check by expansion: \(2(x-2)^2=2x^2-8x+8\) and \(2(y+1)^2=2y^2+4y+2\). The equation \(z=2(x-2)^2+2(y+1)^2\) becomes \(2x^2+2y^2-8x+4y-z+10=0\), matching the original.
A Reliable Classification Procedure
For an equation with no mixed terms, organize the calculation so the translation and the classification remain distinct. This makes it easier to check both the algebra and the geometric conclusion.
Keep each quadratic term with its corresponding linear term, and retain the original constant.
For each nonzero quadratic coefficient, use half the linear coefficient after factoring out the quadratic coefficient.
Move constants carefully to obtain a translated equation with a single right-hand side.
Compare the signs of the squared terms and the right-hand side with the standard forms.
The shifts give the center or vertex; the squared-term denominators and signs identify the principal directions.
A Common Pitfall: Losing the Constant
When completing a square, the constant created inside the square must be balanced outside it. For example, \(x^2-6x\) is not \((x-3)^2\): expanding that incorrect expression gives \(x^2-6x+9\), which differs by \(9\). The correct identity is
Omitting the \(-9\) changes the equation and can change the classification. A practical check is to expand the completed form and verify that every original quadratic, linear, and constant term reappears.
Why Standard Form Matters
Completing squares turns an algebraic equation into a geometric description. The shifts locate the surface, while the signs distinguish the ways its principal cross-sections behave. The denominators show how far the surface extends in each coordinate direction. This is why the algebra is not merely a rearrangement: it provides a direct route from the coefficients in an equation to a location and a recognizable shape.
Check Your Understanding
Use completing squares and standard forms to answer the following questions.
- In \(x^2+4y^2+z^2-6x+8y-2z+G=0\), what translation centers the three squared terms?
- What type of centered surface has two positive squared terms and one negative squared term equal to a positive constant?
- What geometric location is indicated by the shifts in \(\frac{(x+2)^2}{4}+\frac{(y-1)^2}{9}-\frac{(z+3)^2}{16}=1\)?
- Why is it invalid to complete a square in a variable that appears only linearly?
- What should be done to check that a completed-square equation is algebraically equivalent to the original?