Mathematics guides →

Mathematics · Expressions and relationships

Completing the square: minima, symmetry and real solutions

How can you find the smallest value of x² − 4x + 7? Substituting a few inputs gives a few outputs, but the smallest output you tried need not be the minimum over every real input. Rewriting the expression as (x − 2)² + 3 lets you use the fact that a real square is at least zero.

This rewriting is called completing the square. It preserves the value while exposing a useful property of the expression. We will work with quadratics whose x² coefficient is 1, connecting their minimum, left-right symmetry and ability to equal zero. Check substitution and expansion first, then work through the three high-school-level examples.

Try this topic in a quiz

This opens the setup screen with this subject and topic selected. Check the mode and question count before you start.

Reverse an expansion to make a square

Start with (x − 2)² = (x − 2)(x − 2). Multiplying the terms gives x² − 2x − 2x + 4 = x² − 4x + 4. Keeping only x² and 4 would lose both cross terms. To check a squared bracket, return to the product of its two identical factors.

In x² − 4x + 7, split the constant 7 into 4 + 3. The part x² − 4x + 4 is (x − 2)², so the original expression is (x − 2)² + 3. You have used four of the original seven to form the square and left three outside; you have not increased the expression by four.

In general, x² + bx + c = (x + b/2)² + c − b²/4. Expanding the bracket gives x² + bx + b²/4, and the outside term −b²/4 removes the extra constant. Expanding back to the original three terms checks the sign and constant before you rely on the formula.

Show a lower bound, then show that it is attained

The square of any real number is at least zero. Thus (x − 2)² + 3 is at least 3 for every real x. At x = 2 the square is zero, so the output really is 3. Both facts are needed: no output is below 3, and an allowed input produces 3.

The first exercise asks for the value of the expression, rather than the value of x. Two is the minimizing input; three is the minimum output. The original constant 7 is the output at x = 0, but it is not the minimum. Substituting x = 2 into the original expression also gives 4 − 8 + 7 = 3.

Read the input range as well. Under the different practice condition 3 ≤ x ≤ 4, x = 2 is unavailable. Now x − 2 lies between 1 and 2, so its square is at least 1. This bound is attained at x = 3, making the minimum of the same expression 4 on this interval. The actual exercise permits all real inputs, so it permits the input 2.

Read symmetry from equally distant inputs

For y = (x − 2)² + 1, the inputs x = 1 and x = 3 both give y = 2. They are equally far to the left and right of 2. More generally, x = 2 − t and x = 2 + t put −t and t inside the square, giving equal squared values.

This left-right pairing is symmetry about the vertical line x = 2. The lowest point on this graph is called its vertex, which here is (2, 1). The symmetry axis is neither the horizontal line at the vertex's height, y = 1, nor the horizontal line y = 2. On the axis the horizontal coordinate stays 2, so its equation is x = 2.

The expression x − 2 does not place the axis at −2. It becomes zero when x = 2. In y = (x − h)² + k, the inputs h − t and h + t likewise give equal heights: the axis is x = h and the vertex is (h, k). Distinguish the minimum height k from the horizontal coordinate h where it is attained.

Count real solutions by asking whether zero is reachable

The final exercise, x² + 2x + 5 = 0, becomes (x + 1)² + 4 = 0. Its left side is at least 4 for every real input, so it never reaches zero. There are therefore zero distinct real solutions. Being a quadratic equation does not by itself guarantee two real solutions.

Compare three original practice equations that change the constant. The equation (x + 1)² + 4 = 0 has no real solution. The equation (x + 1)² = 0 has the single solution x = −1. For (x + 1)² − 4 = 0, x + 1 is 2 or −2, giving x = 1 or −3. Ask whether the square is required to be negative, zero or positive.

The Japanese exercise explanation uses the discriminant D, calculating D = 2² − 4 × 1 × 5 = −16. For x² + bx + c, the constant left outside the completed square is c − b²/4 = −D/4, where D = b² − 4c. Here 4 = −(−16)/4. A positive four that prevents the expression from reaching zero and a negative discriminant describe the same condition in two forms.

Return the three exercises to the same form

The exercises below ask for a minimum, a symmetry axis and a real-solution count, in that order. Before opening the answers, write the square-plus-constant form and name the quantity requested. After reading an explanation, hide it and reconstruct the expansion, the minimizing input, the equally distant inputs and the condition for reaching zero.

If the roles of letters or equality are unclear, return to the prerequisite article “Expressions: give the unknown a role.” The related article “Graphs and coordinates: read what each axis means” helps distinguish horizontal and vertical coordinates. The practice preset selects high-school-level, standard questions on expressions and functions. It includes other matching questions, rather than promising only these three examples.

TRY & READ

Check your understanding with examples

Compare the choices before opening the answer and explanation. Reading an example does not save a test answer or score.

Example 1 · Algebra and functions

What is the minimum of x² − 4x + 7 over all real x?

  1. 7
  2. −4
  3. 2
  4. 3
Read the answer and explanation

Answer: 3

Complete the square: x² − 4x + 7 = (x − 2)² + 3. A square is at least zero, so the minimum is 3 at x = 2.

Sources for this example

  • English mathematics: original derivations and adaptation record

    Per-ID original mathematical derivations and faithful English adaptations for 300 existing families, plus original fictional data and diagram conditions. Supports mathematical reasoning, not external facts or independent review approval.

    Source checked: 2026-10-04 · Original authoring and derivation record
  • Original mathematics explanation derivations and option checks (v0.87)

    The exact question ID in the v0.87 original-derivation document; original worked steps and independent-review repairs, all-option calculations and stated assumptions. Does not claim experimental learning effects.

    Source checked: 2026-10-05 · Original authoring and derivation record

Example 2 · Algebra and functions

What is the axis of symmetry of y = (x − 2)² + 1?

  1. y=1
  2. x=−2
  3. y=2
  4. x=2
Read the answer and explanation

Answer: x=2

Inputs equally far to either side of x = 2 give the same squared value, so the vertical symmetry axis is x = 2.

Sources for this example

  • English mathematics: original derivations and adaptation record

    Per-ID original mathematical derivations and faithful English adaptations for 300 existing families, plus original fictional data and diagram conditions. Supports mathematical reasoning, not external facts or independent review approval.

    Source checked: 2026-10-04 · Original authoring and derivation record
  • Original mathematics vocabulary, comparisons and derivations (editorial89)

    Exact question or article ID section in this original authoring record: prerequisite vocabulary, conditions, invented examples, mathematical calculations and rejected-option comparisons. No empirical observations, external quotations or claims of learning effectiveness.

    Source checked: 2026-10-06 · Original authoring and derivation record

Example 3 · Algebra and functions

How many distinct real solutions does x² + 2x + 5 = 0 have?

  1. 2
  2. Infinitely many
  3. 0
  4. 1
Read the answer and explanation

Answer: 0

Complete the square to get (x + 1)² + 4 = 0. The left side is always positive, so there are no real solutions. Equivalently, the discriminant is −16.

Sources for this example

  • English mathematics: original derivations and adaptation record

    Per-ID original mathematical derivations and faithful English adaptations for 300 existing families, plus original fictional data and diagram conditions. Supports mathematical reasoning, not external facts or independent review approval.

    Source checked: 2026-10-04 · Original authoring and derivation record

Sources for this guide

Continue with a quiz

Topics: Algebra and functions. Range: General knowledge. Difficulty: Standard. These are selected initially. You can change these on the setup screen.

Try this topic in a quiz

A test shows explanations after submission. Continuous challenge explains each answer. Review uses unresolved mistakes recorded on this device. Casual mode does not update learning records.

Enjoyed it? Share the link

Only the page address is shared. Your saves and results are not included.

Link to this page