7.4 Completing the Square, Vertex Form & Optimization

Key Takeaways

  • Completing the square rewrites $ax^2 + bx + c$ as $a(x - h)^2 + k$, exposing the vertex $(h, k)$ and therefore the maximum or minimum value directly.
  • For a monic quadratic $x^2 + bx$, the number that completes the square is $(b/2)^2$, added and subtracted so the expression's value is unchanged.
  • When $a \neq 1$, factor $a$ out of the $x^2$ and $x$ terms first; forgetting to multiply the added constant back by $a$ is the dominant error.
  • A downward-opening parabola ($a < 0$) has a maximum at its vertex, and an upward-opening parabola ($a > 0$) has a minimum — the $k$ value is the optimum, and $h$ is where it occurs.
  • The quadratic formula is derived by completing the square on the general form $ax^2 + bx + c = 0$, so the two methods always agree.
Last updated: September 2026

Completing the Square, Vertex Form & Optimization

Quick Summary: The official blueprint names three ways to solve a quadratic — square roots, the quadratic formula, and completing the square — and separately requires "completing the square to determine the minimum or maximum value of a function." This section covers that third method. It converts $ax^2 + bx + c$ into vertex form $a(x - h)^2 + k$, where the vertex $(h, k)$ can be read off directly and $k$ is the maximum or minimum value.

Why a Third Method Exists

Factoring is fast but only works on nice integers. The quadratic formula always works but tells you nothing about the graph. Completing the square does something neither can: it rewrites the function so its optimum is visible without any further calculation.

MethodBest whenGives you
FactoringInteger roots existThe roots
Square root propertyNo $x$ term, or already a perfect squareThe roots
Completing the squareYou need the vertex, max, or minRoots and the vertex
Quadratic formulaNothing factors; you only need rootsThe roots

The Core Rule: Add $(b/2)^2$

A perfect square trinomial has the pattern $x^2 + bx + \left(\dfrac{b}{2}\right)^2 = \left(x + \dfrac{b}{2}\right)^2$.

So to complete the square on $x^2 + bx$: take half of $b$, square it, and add it.

Expression$b$$b/2$$(b/2)^2$Completed square
$x^2 + 8x$8416$(x + 4)^2$
$x^2 - 6x$$-6$$-3$9$(x - 3)^2$
$x^2 + 5x$5$2.5$$6.25$$(x + 2.5)^2$
$x^2 - 3x$$-3$$-1.5$$2.25$$(x - 1.5)^2$

Notice the sign inside the binomial always matches the sign of $b$, and the constant added is always positive.

Solving an Equation by Completing the Square

Worked Example 1: Leading Coefficient of 1

Solve $x^2 + 6x - 7 = 0$.

  1. Move the constant across: $x^2 + 6x = 7$.
  2. Half of 6 is 3; $3^2 = 9$. Add 9 to both sides: $x^2 + 6x + 9 = 16$.
  3. Factor the left side: $(x + 3)^2 = 16$.
  4. Square root both sides: $x + 3 = \pm 4$.
  5. Solve: $x = -3 + 4 = 1$ and $x = -3 - 4 = -7$.

Check by factoring the original: $(x + 7)(x - 1) = 0$ gives the same roots.

Worked Example 2: Leading Coefficient Other Than 1

Solve $2x^2 - 12x + 10 = 0$.

  1. Divide every term by 2: $x^2 - 6x + 5 = 0$.
  2. Move the constant: $x^2 - 6x = -5$.
  3. Half of $-6$ is $-3$; $(-3)^2 = 9$. Add 9 to both sides: $x^2 - 6x + 9 = 4$.
  4. Factor: $(x - 3)^2 = 4$, so $x - 3 = \pm 2$.
  5. Solve: $x = 5$ and $x = 1$.

The dominant error: adding 9 to the left side but forgetting the right, or — when you factor out $a$ instead of dividing — forgetting that the added constant gets multiplied by $a$ as it leaves the parentheses. Dividing through by $a$ first, as above, avoids the trap entirely when the equation equals zero.

Converting to Vertex Form

For a function (not an equation) you cannot divide both sides, so factor $a$ out of the first two terms and add-and-subtract inside.

Worked Example 3: $f(x) = x^2 - 8x + 11$

Half of $-8$ is $-4$; $(-4)^2 = 16$. Add and subtract 16:

f(x)=(x28x+16)16+11=(x4)25f(x) = (x^2 - 8x + 16) - 16 + 11 = (x - 4)^2 - 5

Vertex form is $f(x) = (x - 4)^2 - 5$, so the vertex is $(4, -5)$. Because $a = 1 > 0$, the parabola opens upward and $-5$ is the minimum value, occurring at $x = 4$.

Worked Example 4: $g(x) = -3x^2 + 12x - 5$

Factor $-3$ from the first two terms: $g(x) = -3(x^2 - 4x) - 5$.

Half of $-4$ is $-2$; $(-2)^2 = 4$. Add 4 inside the parentheses — but because the parentheses are multiplied by $-3$, you have really added $-3(4) = -12$, so add 12 back outside:

g(x)=3(x24x+4)5+12=3(x2)2+7g(x) = -3(x^2 - 4x + 4) - 5 + 12 = -3(x - 2)^2 + 7

Vertex $(2, 7)$. Since $a = -3 < 0$, the parabola opens downward and 7 is the maximum value, reached at $x = 2$.

Reading Optimization Answers Straight Off Vertex Form

Vertex formOpensVertexOptimum
$f(x) = 2(x - 3)^2 + 4$Up ($a > 0$)$(3, 4)$Minimum of 4 at $x = 3$
$f(x) = -(x + 1)^2 + 9$Down ($a < 0$)$(-1, 9)$Maximum of 9 at $x = -1$
$f(x) = 5(x - 2)^2$Up$(2, 0)$Minimum of 0 at $x = 2$

Watch the sign of $h$. In $a(x - h)^2 + k$ the vertex $x$-coordinate is $h$, so $(x + 1)^2$ means $h = -1$, not $+1$. Rewriting $(x+1)$ as $(x - (-1))$ removes all doubt.

Application: Revenue Optimization

A vendor's daily profit is $P(x) = -2x^2 + 40x - 120$ dollars when the price is $x$ dollars. Factor out $-2$: $P(x) = -2(x^2 - 20x) - 120$. Half of $-20$ is $-10$; $(-10)^2 = 100$. Adding 100 inside adds $-200$ overall, so add 200 back:

P(x)=2(x10)2120+200=2(x10)2+80P(x) = -2(x - 10)^2 - 120 + 200 = -2(x - 10)^2 + 80

Maximum profit is $80, achieved at a price of $10.

The Link to the Quadratic Formula

Completing the square on the general equation $ax^2 + bx + c = 0$ produces the quadratic formula itself:

(x+b2a)2=b24ac4a2x=b±b24ac2a\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2} \quad \Longrightarrow \quad x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

This is why the two methods can never disagree, and it also explains the vertex shortcut $x = -\dfrac{b}{2a}$ from Section 7.3: it is exactly the $-\dfrac{b}{2a}$ that appears when the square is completed.

Test Your Knowledge

What number must be added to x^2 - 14x to create a perfect square trinomial?

A
B
C
D
Test Your Knowledge

Rewriting f(x) = x^2 + 10x + 21 in vertex form gives which of the following, and what is the minimum value of the function?

A
B
C
D
Test Your Knowledge

A ball's height in feet is modeled by h(t) = -16t^2 + 96t + 4. Completing the square gives which vertex form, and what is the maximum height?

A
B
C
D
Test Your Knowledge

Solving 2x^2 + 8x - 24 = 0 by completing the square, what are the solutions?

A
B
C
D