DoingMaths - Free maths worksheets
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to draw pie charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy

How to Complete the Square With Algebraic Expressions

Completing the square with an algebraic equation
Completing the Square

What does it mean to complete the square?​

In algebra, completing the square is the process of converting a quadratic expression of the form ax^2 + bx +c into the form r(x + p)^2 + q where a, b, c, r, p and q are real numbers.
It can be useful when trying to solve equations of the form ax^2 + bx + c = 0, when looking at properties of quadratic graphs and even in some algebraic proofs.
In this article we are going to look at how to complete the square and how we can then apply this to a number of problems.

How to complete the square for x^2 + bx + c​

Let's start by looking at how to complete the square for a quadratic where the coefficient of x^2 is 1. We will write this as x^2 + bx + c, where b and c are real numbers.
We want to convert this into an expression of the form (x + p)^2 + q. If we look at what happens when this form is expanded we get:
​(x + p)^2 + q = x^2 + px + px + p^2 + q
= x^2 + 2px + p^2 + q
By comparing this to our initial expression, we can see that 2p = b (hence p = b/2) and p^2 + q = c.
In practice, this makes p very easy to find and q follows on from this. Let's try this with an example.

Example 1: Complete the square for x^2 + 4x + 7

Remember we are converting into (x + p)^2 + q.

The first step is the easy one; to get the correct coefficient of x from our new expression, we must halve our original coefficient. In this case 4 ÷ 2 = 2 and so we get x^2 + 4x + 7 = (x + 2)^2 + q
We must now find q. The simple way in practice is to consider what happens when the (x + 2)^2 is expanded.
(x + 2)^2 = x^2 + 4x + 4
To make (x + 2)^2 equal to x^2 + 4x we would need to subtract this spare 4 at the end before adding on the existing 7 and simplifying. Therefore we get;

x^2 + 4x + 7 = (x + 2)^2 − 4 + 7
= (x + 2)^2 + 3

Example 2: x^2 - 8x + 1

Consider the coefficient of x. Half of −8 is −4, giving us:
x^2 − 8x + 1 = (x − 4)^2 + q
When expanded, (x − 4)^2 gives us a +16 on the end which we therefore need to subtract again, before adding on the 1 from the original expression.
Therefore x^2 − 8x + 1 = (x − 4)^2 − 16 + 1
= (x − 4)^2 − 15

Completing the square for expressions of the form ax^2 + bx + c

So far we have seen two examples with quadratics where the coefficient of the x^2 is 1. But what do we do if this first coefficient is not equal to 1?
The answer to this is simple; we must first factorise the quadratic, taking out the coefficient a and leaving us with a new expression with just x^2 at the beginning. We can then multiply the factor back in at the end.
​Algebraically this looks like this:
ax^2 + bx + c = a (x^2 + b/a x + c/a)
The expression in the bracket can then be dealt with as in our earlier examples.

Example 3: 2x^2 + 12x + 5

First factor out the 2 from the x^2:
2x^2 + 12x + 5 = 2[x^2 + 6x + 5/2]
Now complete the square for the quadratic in the brackets.
2[x^2 + 6x + 5/2] = 2[(x + 3)^2 − 9 + 5/2]
= 2[(x + 3)^2 − 13/2]
We can now multiply the 2 back in to get:
2x^2 + 12x + 5 = 2(x + 3)^2 − 13
Note: If preferred, it is also perfectly acceptable to just factorise the 2 out of the first two terms and leave the +5 on the end to get 2x^2 + 12x + 5 = 2[x^2 + 6x] + 5 before completing the square on the x^2 + 6x. It is a matter of choice; both will get the same answer.

Example 4: 2x^2 + 6x - 8

First factor out the coefficient of x^2:
2x^2 + 6x − 8 = 2(x2 + 3x − 4)
Now we deal with the quadratic as before:
2(x^2 + 3x − 4) = 2 [(x + 3/2)^2 − (3/2)2 − 4]
= 2 [(x + 3/2)^2 − 25/4]
= 2(x + 3/2)^2 − 25/2

Solving a quadratic by completing the square

One of the main uses for completing the square is when solving a quadratic equation. If the equation has irrational solutions, then factorising into two brackets is not practical and so completing the square becomes the best alternative to using the quadratic formula. Completing the square can also be used for rational number solutions; again it depends on personal preference.
Solve the equation x^2 − 11x + 4 = 0
First complete the square on the left-hand side.
x^2 − 11x + 4 = (x − 11/2)^2 − (11/2)^2 + 4

= (x − 11/2)^2 − 105/4
We can now set this equal to 0 as in the original equation and rearrange to find x.
(x − 11/2)^2 − 105/4 = 0
(x − 11/2)^2 = 105/4
x − 11/2 = ±(√105)/2
x = 11/2 ±(√105)/2
= 0.377 and 10.623 (both to 3 d.p.)
Remember: When square rooting, we get two answers; the positive root and the negative root. It is important to take this into account in our answer.

Solving a quadratic of the form ax^2 + bx + c = 0 by completing the square

When solving a quadratic that equals zero we can simply divide each term by the coefficient of x^2 in order to get a quadratic with a coefficient of 1 at the beginning. There is no need to factorise, as dividing the zero on the right-hand side will still give you zero.
3x^2 + 6x − 2 = 0
x^2 + 2x − 2/3 = 0
(x + 1)^2 − 1 − 2/3 = 0
(x + 1)^2 − 5/3 = 0
(x + 1)^2 = 5/3
x + 1 = ±√(5/3)
x = −1 ±√(5/3)
x = −2.291 and 0.291

Further examples of solving quadratic equations by completing the square

Sketching a graph by completing the square

By completing the square on a quadratic we can make the quadratic easier to sketch.
Consider our example from earlier: x^2 + 4x + 7 = (x + 2)^2 + 3.
As a square number must be larger or equal to zero, we can quickly see that (x + 2)^2 + 3 ≥ 0 + 3 = 3. The graph y = x^2 + 4x + 7 must therefore have a minimum at y = 3. We get y = 3 by making the bracket (x + 2) equal 0, therefore x = −2 and the minimum is at (−2, 3).
We can also calculate any intersections with the axes by solving for y = 0 or by substituting x = 0 in. This graph does not cross the x-axis as we have already seen that it is always larger than 3, but at x = 0, y = (0 + 2)^2 + 3 = 7, so it must cross the y-axis at 7. Using the minimum and this intersect, along with our knowledge of the shape of quadratic graphs, we can quickly sketch y = x^2 + 4x + 7.

Completing the square in algebraic proof

Being able to complete the square can also come in very useful for algebraic proof. Consider the following example:
Show that 2x^2 + 6x + k > 0 for all k > 9/2.
If we complete the square first we get:
2x^2 + 6x + k = 2[x^2 + 3x + k/2]
= 2[(x + 3/2)^2 − 9/4 + k/2]
= 2[(x + 3/2)^2 + (2k − 9)/2]
= 2(x + 3/2)^2 + (2k − 9)
(x + 3/2)^2 ≥ 0 as it is a square.
If k > 9/2, then 2k − 9 > 0.
Therefore 2(x + 3/2)2 + (2k − 9) > 0 as required.

Comments

​Don't forget to leave your comments below.
Home      Algebra      Shapes, space and measures      Number      Data handling      Starters      Internet articles      DoingMaths Youtube channel
© Copyright DoingMaths free worksheets 2026 - All Rights Reserved
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to draw pie charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy