Completing the Square - Multiple Variables
Completing the square of an expression with multiple variables is a technique which manipulates the expression into a perfect square plus some constant. As an example, can be written in the complete square form as
This technique is useful in factorizing an expression, dealing with the conic sections, and finding the maxima and minima of an expression.
Contents
Introduction
Let us look at how can be split into squares.
Firstly, notice that the expression does not have any product terms such as or . This means that we could split this into squares of single variable polynomials, i.e. something like
The key in such cases is to complete the square for each variable separately and combine them.
Let us deal with and separately as follows:
Then, the original polynomial could be written as
What if there are product terms? In that case, we guess which variables need to be together in order to make the product term and manipulate accordingly.
Express as a sum of squares.
Here the product terms contain and . We could hope to possibly rewrite the polynomial as something like
As for the terms with and , we have
For the terms with and , we have
Now, we add them up, and then subtract as we are double counting it, to write the original polynomial as
As ranges over all possible real numbers, what is the minimum value of
This problem has been proposed by Hui.
Application - Factorization
Solve for in , where .
We can use completing the square method:
What must we add so that we have a perfect square? and a perfect square would be in the form so we need to find and square it: and . We add to both sides:
Factor .
This seems unfactorable, but we can make it factorable by adding and subtracting
Factor .
Again, we can complete the square by adding and subtracting the middle term :
which can be factored into
which is best known as Sophie-Germain Identity.
Application - Conic Sections
For a general conic we can complete the square to find all of its elements. Let's begin identifying the conics:
- When we have an ellipse ( and have the same sign but ).
- When and we have a circle.
- When we have an hyperbola ( and have different signs).
- When we have a parabola (only one of and is zero).
For each one, we have different forms and elements:
A circle with center at and radius has the equation
Strategies for completing the square - Circles:
- Move all terms containing and to one side, and the constant term (if there is) to the other side.
- Divide the equation by the coefficient of and if it's different from one.
- Complete the square in and .
- Rearrange and identify its elements.
Identify all the elements of the conic .
Since the coefficients of and are both we have a circle, so we are looking for its center and radius. We move the constant term to the other side:
Now, we complete the square in and :
Finally, we rearrange:
Comparing with the equation of the circle, we find and .
An ellipse with center at , semi-major axis and semi-minor axis has the equations below.
- Horizontal ellipse:
- Vertical ellipse:
Strategies for completing the square - Ellipses:
- Move all terms containing and to one side, and the constant term (if there is) to the other side.
- Factorize the and the term by common factor, using such factor as the coefficient of .
- Do the same with and .
- Complete the square in and .
- Simplify both sides.
- Divide both sides by the term in the right side.
- Simplify the fractions.
- Identify all the elements.
Identify all the elements of the conic .
Since the coefficients of and are different but have the same sign, we have an ellipse. First we move the constant term to the right side:
Next, we factorize the and the terms. We see that the coefficient of is , so it will be the common factor. We will have to divide the coefficient of , which is by . We also do the same with and :
Now we complete the square, without forgetting to multiply the terms that we will add on the right side by and :
Simplify:
Divide both sides by :
Finally simplify the fractions to obtain the form of the equation of the ellipse:
Since we have an horizontal ellipse with , and center in .
A hyperbola with center at , semi-major axis and semi-minor axis has the equations below.
- Horizontal hyperbola:
- Vertical hyperbola:
Strategies for completing the square - Hyperbola:
The steps are almost the same as those for the ellipse, but we have to be more careful with the signs.
Identify all elements of the conic .
Since the coefficients of and have different signs, we have an hyperbola. First we move the constant term to the right side:
Next, we factorize the and the terms. We see that the coefficient of is , so it will be the common factor. We will have to divide the coefficient of , which is by
Do the same with and . We see that the coefficient of is , so that will be the common factor. We will have to divide the coefficient of , which is by
Now we complete the square, without forgetting to multiply the terms that we will add on the right side by and :
Simplify:
Divide both sides by :
Finally simplify the fractions to obtain the form of the equation of the hyperbola:
We have an horizontal hyperbola with , and center at .
A parabola with vertex at and focal distance has equations as follows:
Horizontal parabola:
If the parabola is directed to the right; if it's directed to the left.Vertical parabola:
If the parabola is directed upwards; if it's directed downwards.
Strategies for completing the square - Parabola:
- Identify the variable that is squared. Factorize it with the linear one by common factor, using such factor as the coefficient of the squared variable.
- Complete the square in the squared variable.
- Move the constant terms and the terms with the variable that is not squared, to the right side.
- Factorize the right side again using common factor, using such factor as the coefficient of the linear variable.
- Divide both sides by the coefficient of the squared binom on the left side.
- Identify all the elements.
Identify all elements of the conic .
Since we have an term but no term, we have a parabola. First we will factorize the and terms. We see that the coefficient of is , so it will be the common factor:
Next, we will complete the square in , without forgetting to multiply the term that we will add on the right side by :
Next, we will move the and the constant term to the other side, and simplify:
Factorize the right side. We see that the coefficient of is , so it will be the common factor:
Divide both sides by :
We have a vertical parabola which opens upwards. It has vertex at and its focal distance is .
Application - Quadric Surfaces
We can also have 3-dimensional conic sections, referred to as quadric surfaces. Given an equation in terms of and we can use multi-variable completing the square to identify certain characteristics of these quadric surfaces.
An ellipsoid has the equation .
- All traces are ellipses. (A trace is the equation of intersection between a plane and the given surface.)
- Its center is at .
- If , then the ellipsoid is a sphere.
- Ellipsoids have 3 axes of symmetry: and
An elliptic paraboloid has the equation .
- The vertex of the elliptic paraboloid is at . Conceptually, this is similar to the vertex-form of a parabola in 2D.
- Horizontal traces are ellipses, and vertical traces are parabolas.
- The axis of symmetry is
A hyperbolic paraboloid, or commonly known as Pringles chip, has the equation .
The center of the hyperbolic paraboloid (in this case, the saddle point, where the partial derivatives in all directions equal zero, but this point is neither a maximum nor a minimum) is .
The axis of symmetry is
An elliptical cone has the equation .
- The "center" is located at .
- Horizontal traces are ellipses, and vertical traces are hyperbolas or lines, depending on the equation of the plane.
- The axis of symmetry is
A hyperboloid of one sheet looks like a nuclear cooling tower and has the equation .
- The "center" is located at .
- Horizontal traces are ellipses, and vertical traces are hyperbolas.
- The axis of symmetry is
A hyperboloid of two sheets looks like two mirrored elliptic paraboloids and has the equation .
- The two sheets are "mirrored" around .
- Horizontal traces when the plane is parallel to the -axis are ellipses when the plane intersects one of the two sheets. Vertical traces are hyperbolas.
- The axis of symmetry is
Identify the quadric surface and its elements:
We have
We can see that the equation is a . Its center is at . Its axis of symmetry is
Applications - Extrema Values
When relating squares and inequality, one should be reminded of the trivial inequality:
For any real number , we have
and equality holds if and only if .
Let's look at a simple example.
For real numbers and , what is the minimum value of
In this expression we have to deal with two variables. It is hard at first how to approach or even predict the minimum value. Let's try reducing the number of terms by completing the square:
The minimum value of a square is , and hence the minimum value of is and the equality holds when and .
Now, let's try a slightly more difficult question when there are more terms.
The function above has a minimum value for real numbers . Find the minimum value, and state the ordered triplet where the minimum occurs.
Notice that there are product terms and . We can try to factorize these first. Notice that appears in both products and that has a term by itself. Therefore, we can start by attempting to factorize . Notice that
From here, we can see that we already have most of the required terms to complete the square. What we're missing is , and we try to obtain the term:
Next, we try to do the same thing for . Notice that
What we need is an :
All the variables have been placed in squares. Now, the function will be minimized if all 3 squares equal to . Therefore, we need to find out if we can get all 3 squares to be :
We see that it is indeed achievable. Therefore, we get our answer: when
Minimize the expression above for reals .
Problem Solving
We will work through several problems to gain a stronger understanding on the usefulness of completing the square.
Prove that there are no integer solution for the equation
Factorize the expression we get
is not a square, and hence there are no integer solutions.
Factor .
This isn't really completing the square, but rather completing the cube:
If
find
We have
Adding column 2 and column 3 to column 1, we have
Subtracting row 3 from row 1 and row 2 gives
Multiplying out gives
This is where completing the square comes in:
Now, cannot be 0. If it were, that would imply .
Hence,