ArticleslgStudy

mathematics

Completing the square

Completing the square is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Completing the square rather than just read about it. In short: In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form ⁠ax2+bx+c⁠ to the form ⁠a(x−h)2+k⁠ for some values of ⁠h⁠ and ⁠k⁠. In terms of a new quantity ⁠x−h⁠, this expression is a quadratic polynomial with no linear term.

Completing the square — main illustration
Completing the square — illustration

Key takeaways

  • Completing the square belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Completing the square to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Completing the square from memory before moving on to harder problems.

Reference excerpt

In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form ⁠ax2+bx+c⁠ to the form ⁠a(x−h)2+k⁠ for some values of ⁠h⁠ and ⁠k⁠. In terms of a new quantity ⁠x−h⁠, this expression is a quadratic polynomial with no linear term. By subsequently isolating ⁠(x−h)2⁠ and taking the square root, a quadratic problem can be reduced to a linear problem. The name completing the square comes from a geometrical picture in which ⁠x⁠ represents an unknown length. Then the quantity ⁠x2⁠ represents the area of a square of side ⁠x⁠ and the quantity ⁠bax⁠ represents the area of a pair of congruent rectangles with sides ⁠x⁠ and ⁠b2a⁠. To this square and pair of rectangles, one more square is added, of side length ⁠b2a⁠. This crucial step completes a larger square of side length ⁠x+b2a⁠. Completing the square is the oldest method of solving general quadratic equations, used in Old Babylonian clay tablets dating from 1800 to 1600 BCE. It was formalised and popularised by mathematician Al-Khwarizmi in his work Al-Jabr, and is still taught in elementary algebra courses today. It is also used for graphing quadratic functions, deriving the quadratic formula, and more generally in computations involving quadratic polynomials, for example in calculus evaluating Gaussian integrals with a linear term in the exponent, and finding Laplace transforms.

History

The technique of completing the square was known in the Old Babylonian Empire. Muhammad ibn Musa Al-Khwarizmi, a famous polymath who wrote the early algebraic treatise Al-Jabr, used the technique of completing the square to solve quadratic equations.

Overview

Background The formula in elementary algebra for computing the square of a binomial is: (x+p)2=x2+2px+p2. For example: (x+3)2=x2+6x+9(p=3)(x−5)2=x2−10x+25(p=−5). In any perfect square, the coefficient of x is twice the number p, and the constant term is equal to p2.

Basic example Consider the following quadratic polynomial: x2+10x+28. This quadratic is not a perfect square, since 28 is not the square of 5: (x+5)2=x2+10x+25. However, it is possible to write the original quadratic as the sum of this square and a constant: x2+10x+28=(x+5)2+3. This is called completing the square.

General description Given any monic quadratic x2+bx+c, it is possible to form a square that has the same first two terms: (x+12b)2=x2+bx+14b2. This square differs from the original quadratic only in the value of the constant term. Therefore, we can write x2+bx+c=(x+12b)2+k, where k=c−b24. This operation is known as completing the square. For example: x2+6x+11=(x+3)2+2x2+14x+30=(x+7)2−19x2−2x+7=(x−1)2+6.

Non-monic case Given a quadratic polynomial of the form ax2+bx+c it is possible to factor out the coefficient a, and then complete the square for the resulting monic polynomial. Example: 3x2+12x+27=3[x2+4x+9]=3[(x+2)2+5]=3(x+2)2+3(5)=3(x+2)2+15 This process of factoring out the coefficient a can further be simplified by only factorising it out of the first 2 terms. The constant term at the end of the polynomial does not have to be included. Example: 3x2+12x+27=3[x2+4x]+27=3[(x+2)2−4]+27=3(x+2)2+3(−4)+27=3(x+2)2−12+27=3(x+2)2+15 This allows the writing of any quadratic polynomial in the form a(x−h)2+k.

Formula

Scalar case The result of completing the square may be written as a formula. In the general case, one has ax2+bx+c=a(x−h)2+k, with h=−b2aandk=c−ah2=c−b24a. In particular, when a = 1, one has x2+bx+c=(x−h)2+k, with h=−b2andk=c−h2=c−b24. By solving the equation a(x−h)2+k=0 in terms of x−h, and reorganizing the resulting expression, one gets the quadratic formula for the roots of the quadratic equation: x=−b±b2−4ac2a.

Matrix case The matrix case looks very similar: xTAx+xTb+c=(x−h)TA(x−h)+k where h=−12A−1b and k=c−14bTA−1b. Note that A has to be symmetric. If A is not symmetric the formulae for h and k have to be generalized to: h=−(A+AT)−1bandk=c−hTAh=c−bT(A+AT)−1A(A+AT)−1b

Relation to the graph

In analytic geometry, the graph of any quadratic function is a parabola in the xy-plane. Given a quadratic polynomial of the form a(x−h)2+k the numbers h and k may be interpreted as the Cartesian coordinates of the vertex (or stationary point) of the parabola. That is, h is the x-coordinate of the axis of symmetry (i.e. the axis of symmetry has equation x = h), and k is the minimum value (or maximum value, if a < 0) of the quadratic function. One way to see this is to note that the graph of the function f(x) = x2 is a parabola whose vertex is at the origin (0, 0). Therefore, the graph of the function f(x − h) = (x − h)2 is a parabola shifted to the right by h whose vertex is at (h, 0), as shown in the top figure. In contrast, the graph of the function f(x) + k = x2 + k is a parabola shifted upward by k whose vertex is at (0, k), as shown in the center figure. Combining both horizontal and vertical shifts yields f(x − h) + k = (x − h)2 + k is a parabola shifted to the right by h and upward by k whose vertex is at (h, k), as shown in the bottom figure.

Solving quadratic equations Completing the square may be used to solve any quadratic equation. For example: x2+6x+5=0. The first step is to complete the square: (x+3)2−4=0. Next we solve for the squared term: (x+3)2=4. Then either x+3=−2orx+3=2, and therefore x=−5orx=−1.This can be applied to any quadratic equation. When the x2 has a coefficient other than 1, the first step is to divide out the equation by this coefficient: for an example see the non-monic case below. [In non-monic quadratics, where a does not equal 1 for the expression ax2+bx+c, the following can be applied.] Solve for x: 5x2+x−3=0 The first step is to make a equal to 1, considering the form ax2+bx+c. We do this by dividing both sides of the equation by 5, the coefficient of x2: x2+x5−35=0 Then we complete the square. Notice that x5 is a fraction. Using the fact that (x+a)2=x2+2xa+a2, in the scenario where we do not want to change the second term 2xa, we will divide the term 2xa by two. This gives xa, which means that a=result[xa]x. Applying the same logic to this question, we can determine that the value of y within the expression (x+y)2 is equal to the second term, x5 , divided by 2x. This gives x52x=110. This also implies y2=(110)2=12102=1100. Now we can complete the square: (x+110)2−1100−35=0 (x+110)2−61100=0 Now we solve for the squared term: (x+110)2=61100 This means x+110=±61100, so: x=−1±6110 And therefore x=−1+6110 or x=−1−6110

… excerpt ends here. Continue reading the full article.

Illustrations

Completing the square illustration
Completing the square illustration
Completing the square illustration
Completing the square illustration

Worked examples

Example 1 — a first encounter with Completing the square

Start with the simplest possible case. Write down what Completing the square claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Completing the square before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Completing the square ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Completing the square

In research
Completing the square appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Completing the square in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Completing the square is common in secondary-school and first-year university syllabi. It links to neighbouring topics Elementary algebra, Polynomials, so understanding it makes those chapters shorter.
In everyday life
Look for Completing the square outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Completing the square” →

How to study Completing the square in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Completing the square means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Completing the square out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Completing the square in simple terms?

In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form ⁠ax2+bx+c⁠ to the form ⁠a(x−h)2+k⁠ for some values of ⁠h⁠ and ⁠k⁠. In terms of a new quantity ⁠x−h⁠, this expression is a quadratic polynomial with no linear term.

Why does Completing the square matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Completing the square?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Completing the square.

Tags

  • Elementary algebra
  • Polynomials

Keep exploring