Maths4UBETA

Completing the square, graphs and range

Use the square form to find exact roots, the vertex and values on a restricted domain.

Try the quick check →
Lesson 2 of 5

Section 1 of 7 · Core · about 6 min

How do I make a perfect square?

Rewrite the expression as a(x−h)2+ka(x-h)^2+k. Its value stays the same for every xx.

Two strips of area 3x surround a square of area x squared. The hatched three-by-three corner completes a square of side x + 3.
For x>0x>0, the two strips contribute 6x6x. The hatched corner adds 99, so x2+6x=(x+3)2−9x^2+6x=(x+3)^2-9. The identity holds for every real xx.

Worked example

A positive linear coefficient

Write x2+6x+2x^{2}+6x+2 in completed form.

  1. 62=3\frac{6}{2}=3

    Halve the coefficient of xx. This gives the number inside the bracket.

  2. (x+3)2=x2+6x+9(x+3)^{2}=x^{2}+6x+9

    Expanding the square shows the extra constant: 9.

  3. x2+6x=(x+3)2−9x^{2}+6x=(x+3)^{2}-9

    Subtract 9 to compensate. The two expressions are equal for every xx.

  4. x2+6x+2=(x+3)2−7x^{2}+6x+2=(x+3)^{2}-7

    Include the original constant: −9+2=−7-9+2=-7.

Your turn

Complete the step x2+8x=(x+4)2−□x^2+8x=(x+4)^2-\Box. What belongs in the box?

Enter an exact number, for example 3/2 or 2-sqrt(3).

Worked example

A negative coefficient and a fraction

Write x2−5x+1x^{2}-5x+1 in completed form.

Try it on paper first.

  1. −52=−52\frac{-5}{2}=-\frac{5}{2}

    Halve the signed coefficient. The bracket must contain a minus sign.

  2. (x−52)2=x2−5x+254(x-\frac{5}{2})^{2}=x^{2}-5x+\frac{25}{4}

    The constant created by squaring is positive, even though the number inside the bracket is negative.

  3. x2−5x+1=(x−52)2−254+1x^{2}-5x+1=(x-\frac{5}{2})^{2}-\frac{25}{4}+1

    Subtract the added square, then restore the original constant.

  4. x2−5x+1=(x−52)2−214x^{2}-5x+1=(x-\frac{5}{2})^{2}-\frac{21}{4}

    Use 1=441=\frac{4}{4} to combine the constants exactly.

Further example with a fractional coefficient

The same method applies. For x2+32x−1x^{2}+\frac{3}{2}x-1, halve 32\frac{3}{2} to get 34\frac{3}{4}. Square this number exactly; do not round it.

(34)2=916(\frac{3}{4})^{2}=\frac{9}{16}

Square both the numerator and denominator.

x2+32x−1=(x+34)2−916−1x^{2}+\frac{3}{2}x-1=(x+\frac{3}{4})^{2}-\frac{9}{16}-1

Subtract the added square and include the original constant.

x2+32x−1=(x+34)2−2516x^{2}+\frac{3}{2}x-1=(x+\frac{3}{4})^{2}-\frac{25}{16}

Write 1=16161=\frac{16}{16} before combining the constants.

A fractional answer is perfectly acceptable. Completed form does not require whole numbers inside or outside the bracket.

Section 2 of 7 · Core · about 6 min

What if the leading coefficient is different from 1?

For an equation, you may divide both sides by a≠0a\ne0. For an expression, factor aa out of the quadratic and linear terms so the value stays the same.

Worked example

Keep the outside multiplier

Write 3x2−12x+53x^{2}-12x+5 in completed form.

  1. 3x2−12x+5=3(x2−4x)+53x^{2}-12x+5=3(x^{2}-4x)+5

    Factor 3 from the first two terms. Leave the constant 5 outside.

  2. x2−4x=(x−2)2−4x^{2}-4x=(x-2)^{2}-4

    Inside the bracket, halve −4 to get −2, then subtract its square.

  3. 3((x−2)2−4)+53((x-2)^{2}-4)+5

    The outside 3 multiplies both the square and the constant you subtracted.

  4. 3(x−2)2−12+53(x-2)^{2}-12+5

    Multiply the constant you subtracted: 3×(−4)=−123\times(-4)=-12.

  5. 3x2−12x+5=3(x−2)2−73x^{2}-12x+5=3(x-2)^{2}-7

    Collect the constants and state the completed form.

Your turn

The expression 2x2+12x+52x^2+12x+5 equals 2(x+3)2+k2(x+3)^2+k. Find kk.

Enter the value on its own or write k = … . Fractions and exact square roots are accepted.

Worked example

A negative leading coefficient

Write −2x2−8x+1-2x^{2}-8x+1 in completed form.

Try it on paper first.

  1. −2x2−8x+1=−2(x2+4x)+1.\begin{aligned}-2x^2-8x+1\\ ={}-2(x^2+4x)+1.\end{aligned}

    Factor out −2. The linear term inside becomes positive.

  2. −2((x+2)2−4)+1-2((x+2)^{2}-4)+1

    Complete the square inside: x2+4x=(x+2)2−4x^{2}+4x=(x+2)^{2}-4.

  3. −2(x+2)2+8+1-2(x+2)^{2}+8+1

    The constant you subtracted becomes positive because (−2)(−4)=8(-2)(-4)=8.

  4. −2x2−8x+1=−2(x+2)2+9-2x^{2}-8x+1=-2(x+2)^{2}+9

    Collect the constants. Expanding again checks both signs.

Why the general identity works

For a≠0a\ne0, the same process gives

ax2+bx+c=a(x+b2a)2+c−b24a.ax^{2}+bx+c=a(x+\frac{b}{2a})^{2}+c-\frac{b^{2}}{4a}.

After factoring out aa, the linear coefficient inside is ba\frac{b}{a}. Halving it gives b2a\frac{b}{2a}. Its square is b24a2\frac{b^{2}}{4a^{2}}, so the outside multiplier makes the constant correction −b24a-\frac{b^{2}}{4a}.

The identity is a useful check. Applying the steps also helps you keep track of negative signs and fractions.

Section 3 of 7 · Core · about 5 min

Where is the vertex?

Find the input that makes the squared bracket zero. Then read its output.

The graph y=3(x−2)²−7 has vertex (2,−7) and a vertical symmetry axis x=2.
At x=hx=h, the square is zero. Here h=2h=2 and k=−7k=-7.

The square becomes zero at x=hx=h. Equal distances to either side of this value give the same square, so they give the same height on the graph.

For example, substituting x=h+1x=h+1 or x=h−1x=h-1 gives y=a+ky=a+k in both cases. This explains why the vertical line through the vertex divides a parabola into two matching halves.

  • If a>0a>0, the parabola opens upwards. For all real xx, y≥ky\ge k, so the minimum value is kk, reached at x=hx=h.
  • If a<0a<0, the parabola opens downwards. For all real xx, y≤ky\le k, so the maximum value is kk, reached at x=hx=h.

Worked example

Read the vertex and axis

For y=3(x−2)2−7y=3(x-2)^2-7, give the vertex, axis and least value.

  1. Set the bracket equal to zero. x−2=0x-2=0 gives x=2x=2.

  2. At x=2x=2, the squared term vanishes and y=−7y=-7. The vertex is (2,−7)(2,-7) and the axis is x=2x=2.

  3. The coefficient 33 is positive, so all other outputs exceed −7-7. The least value is −7-7, reached at x=2x=2.

Your turn

Find the vertex of y=−2(x+1)2+6y=-2(x+1)^2+6.

Enter a point as (1, 2) or x = 1, y = 2. Separate complete pairs with commas or semicolons.

In the original form ax2+bx+cax^{2}+bx+c, the same result gives h=−b2ah=-\frac{b}{2a}. Substitute this value into the expression to find kk. Completing the square explains this formula: the squared bracket is zero when x+b2a=0x+\frac{b}{2a}=0.

Worked example

Build an equation from the graph

A parabola has vertex (2,−3)(2,-3) and passes through (0,5)(0,5). Find its equation.

Try it on paper first.

  1. y=a(x−2)2−3y=a(x-2)^{2}-3

    The vertex supplies the bracket shift and the final constant. The coefficient aa is still unknown.

  2. 5=a(0−2)2−35=a(0-2)^{2}-3

    Substitute both coordinates of the other point.

  3. 5=4a−3⇒a=25=4a-3\Rightarrow a=2

    Solve for the missing coefficient.

  4. y=2(x−2)2−3y=2(x-2)^{2}-3

    The equation has the required vertex and gives y=5y=5 when x=0x=0.

Section 4 of 7 · Core · about 6 min

How can I sketch the parabola?

For f(x)=x2−4x−5f(x)=x^2-4x-5, the vertex, symmetry line and intercepts fix the shape of the sketch.

Parabola with vertex (2, −9), axis x = 2, x-intercepts −1 and 5, and y-intercept −5.

A reliable sketching sequence

  1. Use the sign of aa to decide the opening direction.
  2. Mark the vertex and draw the vertical axis of symmetry.
  3. Set x=0x=0 to find the y-intercept.
  4. Set y=0y=0 to find any real x-intercepts.
  5. Draw a smooth, symmetric curve through the points. Label coordinates and show its continuing direction.

A sketch needs the correct shape and key coordinates; it does not need an exact scale. Factorising may be the quickest way to find the x-intercepts, even when completing the square was best for finding the vertex.

Worked example

Combine the useful forms

Find the vertex and intercepts of f(x)=x2−4x−5f(x)=x^2-4x-5 to explain the sketch above.

  1. f(x)=(x−2)2−9f(x)=(x-2)^{2}-9

    Complete the square to reveal the vertex (2,−9)(2,-9) and axis x=2x=2. The positive leading coefficient means the curve opens upwards.

  2. f(0)=−5f(0)=-5

    The y-intercept is (0,−5)(0,-5).

  3. x2−4x−5=(x−5)(x+1)=0x^{2}-4x-5=(x-5)(x+1)=0

    The x-intercepts are (5,0)(5,0) and (−1,0)(-1,0).

  4. −1+52=2\frac{-1+5}{2}=2

    The roots lie equally far from the axis, which checks the symmetry.

  5. Draw the vertex below both intercepts and let both ends rise. The symmetry also gives the point (4,−5)(4,-5) from (0,−5)(0,-5).

Your turn

Read the two x-intercepts from the sketch of y=(x−2)2−9y=(x-2)^2-9. Check them by setting y=0y=0.

Give every root, for example x = 1 or x = 4, or 1, 4. Use sqrt(...) for exact roots, or empty if there are none.

Your turn

Now sketch y=(x+1)2−4y=(x+1)^2-4 on paper. Give the x-values of both intercepts.

Give every root, for example x = 1 or x = 4, or 1, 4. Use sqrt(...) for exact roots, or empty if there are none.

What if there are no two x-intercepts?

The equation a(x−h)2+k=0a(x-h)^{2}+k=0 becomes (x−h)2=−ka(x-h)^{2}=-\frac{k}{a}. A positive right-hand side gives two intercepts; zero gives one repeated root at the vertex; a negative right-hand side gives no real intercepts. For example, y=(x−2)2+3y=(x-2)^{2}+3 stays above the x-axis.

Use the completed form to solve

To solve x2+6x+2=0x^2+6x+2=0, rewrite the left side as (x+3)2−7(x+3)^2-7.

(x+3)2=7,x=−3±7.(x+3)^2=7,\qquad x=-3\pm\sqrt7.

The roots are the same distance from x=−3x=-3. A square equal to zero gives one real root; a square equal to a negative number gives none.

How translations and stretches affect the sketch

Build y=a(x−h)2+ky=a(x-h)^{2}+k from y=x2y=x^{2}: multiply the outputs by aa, then translate horizontally by hh and vertically by kk.

  • h>0h>0 moves the vertex right; h<0h<0 moves it left. Thus (x+2)2(x+2)^{2} has its vertex at x=−2x=-2.
  • k>0k>0 moves the graph up; k<0k<0 moves it down.
  • ∣a∣>1|a|>1 produces a vertical stretch and a narrower parabola. For 0<∣a∣<10<|a|<1, the parabola is wider.
  • A negative aa also reflects the scaled graph in the x-axis before the translations, so the final parabola opens downwards.
Read the bracket carefully. The vertex occurs where the squared bracket is zero. The coefficient aa controls the shape; it is not a constant gradient. A parabola's gradient changes along the curve.

Section 5 of 7 · Core · about 5 min

What outputs can the parabola take?

The domain gives the allowed inputs. The range gives every output reached by those inputs.

Worked example

A minimum value

Find the range of f(x)=3(x−2)2−7f(x)=3(x-2)^2-7 for all real xx.

  1. f(x)=3(x−2)2−7f(x)=3(x-2)^{2}-7

    The domain is all real numbers. The squared term is smallest at x=2x=2.

  2. 3(x−2)2≥0⇒f(x)≥−73(x-2)^{2}\ge0\Rightarrow f(x)\ge-7

    The minimum output is −7, and it is attained.

  3. Range: [−7,∞)[-7,\infty), equivalently f(x)≥−7f(x)\ge-7. The minimum value is −7; the input where it occurs is 2; the vertex is (2,−7)(2,-7).

Your turn

Find the range of f(x)=−3(x−1)2+8f(x)=-3(x-1)^2+8 for all real xx.

Give the output range as an inequality or an interval. For example, y ≤ 4 is (−∞, 4]. You can type <= for ≤.

Worked example

A maximum value

Find the range of g(x)=−2(x+2)2+9g(x)=-2(x+2)^2+9 for all real xx.

Try it on paper first.

  1. g(x)=−2(x+2)2+9g(x)=-2(x+2)^{2}+9

    The domain is all real numbers. A nonnegative square multiplied by −2 is nonpositive.

  2. −2(x+2)2≤0⇒g(x)≤9-2(x+2)^{2}\le0\Rightarrow g(x)\le9

    The maximum is 9, attained when x=−2x=-2.

  3. The range is g(x)≤9g(x)\le9, equivalently (−∞,9](-\infty,9]. The outputs decrease without bound.

Why these are complete ranges

As xx varies over all real numbers, (x−h)2(x-h)^{2} takes every nonnegative value. Therefore an upward-opening quadratic takes every output from its minimum upwards; a downward-opening quadratic takes every output from its maximum downwards. There are no gaps.

Consequently, y=a(x−h)2+ky=a(x-h)^{2}+k has range [k,∞)[k,\infty) when a>0a>0, and (−∞,k](-\infty,k] when a<0a<0, provided the domain is all real numbers.

Section 6 of 7 · Core · about 5 min

How does a restricted domain change the range?

On a closed interval, compare the two endpoint outputs and the vertex output if its input belongs to the interval.

Worked example

A closed interval containing the vertex

Find the range of f(x)=(x−2)2−3f(x)=(x-2)^{2}-3 for −1≤x≤4-1\le x\le4.

  1. f(2)=−3f(2)=-3

    The vertex input 2 is included, so −3 is the minimum.

  2. f(−1)=6,f(4)=1f(-1)=6,\quad f(4)=1

    The greatest distance from 2 occurs at −1, giving the maximum 6.

  3. The range is −3≤f(x)≤6-3\le f(x)\le6, or [−3,6][-3,6]. Both extrema are attained. Checking only the endpoints would miss the minimum.

Your turn

Find the range of g(x)=(x−1)2g(x)=(x-1)^2 for −2≤x≤3-2\le x\le3.

Give the output range as an inequality or an interval. For example, y ≤ 4 is (−∞, 4]. You can type <= for ≤.

A maximum inside a closed interval

For g(x)=−2(x−1)2+8g(x)=-2(x-1)^{2}+8 on [−1,4][-1,4], the included vertex gives g(1)=8g(1)=8, the maximum. The endpoints give g(−1)=0g(-1)=0 and g(4)=−10g(4)=-10. Therefore the range is [−10,8][-10,8].

Section 7 of 7 · Extension · about 4 min

What changes at an open boundary?

Follow the allowed part of the curve. A boundary output can be approached, attained at another input, or both.

Worked example

The vertex is outside the domain

Find the range of f(x)=(x−2)2−3f(x)=(x-2)^2-3 for x≥4x\ge4.

  1. f(4)=1f(4)=1

    The closest permitted input to 2 is 4. Beyond 4, the square increases without bound.

  2. Range: [1,∞)[1,\infty). The unrestricted minimum −3 is unavailable.

Your turn

Find the range of h(x)=(x+2)2h(x)=(x+2)^2 for x>−1x>-1.

Give the output range as an inequality or an interval. For example, y ≤ 4 is (−∞, 4]. You can type <= for ≤.

For an open boundary, calculate the output the curve approaches there, then ask whether another permitted input gives that same output. For an unbounded domain, also inspect what happens as the input continues indefinitely in the allowed direction. Do not assume a function has both an attained minimum and an attained maximum.

Open endpoints: check whether the output is attained elsewhere

Consider q(x)=(x−1)2q(x)=(x-1)^{2}.

  • For 0<x≤20<x\le2, the range is [0,1][0,1]. The vertex gives 0, and the included input 2 gives 1. Excluding input 0 does not exclude output 1.
  • For 0<x<20<x<2, the range is [0,1)[0,1). The output approaches 1 at both ends, but neither input producing 1 is permitted.
  • For x>1x>1, the range is (0,∞)(0,\infty). Outputs can be arbitrarily close to zero, but zero is never attained.

For q(x) = (x − 1) squared on 0 < x ≤ 2, the left endpoint is hollow and the right endpoint is filled. Both boundary points have output 1, which is included in the range.

Show the restriction on your sketch

Draw only the permitted part of the parabola. Use a filled endpoint for an included input and a hollow endpoint for an excluded input. Keep an arrow where the allowed curve continues indefinitely. An endpoint marker describes that particular point; a different included point may still produce the same output.

Modelling the area of a rectangle

A rectangle has perimeter 20 cm. If one side is xx cm, the other is 10−x10-x cm. Both lengths must be positive, so 0<x<100<x<10.

A=x(10−x)=25−(x−5)2A=x(10-x)=25-(x-5)^{2}

The maximum area is 25 cm², attained at x=5x=5.

The rectangle is then a 5 cm by 5 cm square. Its area approaches zero as a side approaches zero, but zero area is excluded by the positive-length domain. Thus 0<A≤250<A\le25. Whether a boundary is included comes from the stated model.

Before you move on

  • Have you read the horizontal shift with the correct sign?
  • Have you distinguished the extreme value, its input, and the vertex coordinates?
  • Have you used the stated domain and checked the vertex and relevant boundaries?
  • Have you included a range endpoint only when some allowed input attains it?
  • Does your sketch agree with the opening direction, intercepts and range?

Worked examples

Practise the method

Core practice

Question 1 of 4

0 / 4 checked in this collection

Question list

Core practice

Fresh variants

Exam-style

Square form and graph 1

3 marks

Write 3x2−12x+73 x^{2} - 12 x + 7 as A(x−H)2+KA(x-H)^2+K. Give all three constants.

Enter the complete form using all three fields: A(x − H)² + C.

Enter the value on its own or write a = … . Fractions and exact square roots are accepted.

Enter the value on its own or write h = … . Fractions and exact square roots are accepted.

Enter the value on its own or write k = … . Fractions and exact square roots are accepted.

Full answer-format guide

Exact numbers: 3/2, sqrt(5), 2-sqrt(3), pi/6, 3*pi/2. Sets: {1,4}. Intervals: (3,5]; a round bracket excludes the endpoint. Infinity: inf; union: U; no solutions: empty. Separate coordinate pairs or triples with semicolons. Expressions: 2x^2+3x-1; equations: x^2=3x+1 or the polynomial equal to zero. Factors: x-1 ; x+2. Parameter fraction: numerator ; denominator. List integer answers individually.

Review the method

Progress stays in this browser. Create an account to save it or sign in.

Apply it · original exam-style problems

Show your working on paper and compare it with the worked solution and marking guidance.

Come back to what needs practice

Quick revision sheet (A4)

Your review plan starts after your first check.

Earlier practice and saved answers