Calculator Work with quadratic functions
Completing the square calculator
In one sentence
Writes ax² + bx + c as a(x + p)² + q and gives the turning point.
Last checked Source: uk-dfe-alevel-maths-subject-content Source: Department for Education, GCE AS and A level subject content for mathematics (topics derived; every example and value computed here), uk-dfe-alevel-maths-subject-content www.gov.uk (opens in a new tab)
Key facts
Completing the square calculator
- Formula ref
- ax² + bx + c = a(x + b/2a)² + c − b²/4a
- Topic
- Work with quadratic functions
Inputs
- a, b, c: coefficients
Worked input
- Input a = 3, b = 12, c = 5.
- p = 12/6 = 2 and q = 5 − 144/12 = −7.
- 3x² + 12x + 5 = 3(x + 2)² − 7, minimum value −7 at x = −2.
- Take x² + 6x + 2, a monic quadratic with an even middle coefficient, which is the easiest kind to complete. Half of 6 gives p = 3, and the leftover constant is 2 − 9 = −7, so the form is (x + 3)² − 7. When the coefficient of x² is one, halve the coefficient of x, put it in a bracket with the opposite sign pattern, and correct the constant afterwards, which is the quickest and least error-prone way to complete the square. Check: expanding (x + 3)² − 7 returns x² + 6x + 2, and the minimum value −7 occurs at x = −3.
- Take −2x² + 8x − 3, where a negative leading coefficient turns the curve upside down so the turning point is a maximum. Here p = 8/(−4) = −2 and q = −3 − 64/(−8) = 5, so the form is −2(x − 2)² + 5. A negative leading coefficient flips the shape, so the turning point is a maximum, and the number outside the bracket is then the greatest value the function takes, not the least, which is a standard exam trap. Check: since a is negative the squared bracket can only lower the value, so the greatest value of the function is 5, reached at x = 2.
- Take 2x² + 3x + 1, a quadratic whose shift is not a whole number, so fractions appear in the completed form. Here p = 3/4 = 3/4 and q = 1 − 9/8 = −1/8, giving 2(x + 3/4)² − 1/8. Fractions in the completed form are not a sign of a mistake, since halving an odd coefficient always produces one, and keeping them exact is safer than converting to decimals part-way through the working. Check: the roots of the original are x = −1 and x = −1/2, which sit symmetrically about the axis x = −3/4, and the minimum −1/8 is negative as it must be for a curve that crosses the axis.
How to use it
- Enter the coefficients.
- p = b/2a is the horizontal shift (opposite sign).
- q is the minimum value if a > 0, maximum if a < 0.
Completing the square calculator for your study of A-level maths: where it comes from and what it covers.
See also Quadratic equation solver, Sum and product of roots calculator, Quadratic from its roots and Discriminant calculator.
Study brief
- Students preparing for the Pearson Edexcel Level 3 Advanced GCE in Mathematics (9MA0) should be aware of guidance regarding quadratic equations. For Paper 1 and Paper 2 Pure Mathematics, the wording in Section 2.3 was updated to clarify that learners may use a calculator or complete the square when solving quadratic equations. This section covers the solution of quadratic equations through factorisation, the use of a formula, or these alternative methods. The mathematical process for completing the square is defined by the expression ax2 + bx + c = a(x + b/2a)(x + b/2a) + c - b2/4a. These quadratic functions can involve powers of 2 and may be used to solve simultaneous equations in two variables, such as y = 2x + 3 and y = x2 – 4x. When working with these functions and their graphs, learners must understand the discriminant, b2 – 4ac, to determine conditions for real and repeated roots, specifically where b2 – 4ac > 0, b2 – 4ac = 0, or b2 – 4ac < 0. This specification has been in place with first teaching from September 2017 and first certification from 2018.
Practise for free
Test yourself with exam-style questions and see why each answer is right or wrong.
More from Work with quadratic functions
-
Discriminant calculator
Evaluates b² − 4ac and classifies the quadratic as having two real roots, one repeated root or none.
-
Quadratic equation solver
Solves ax² + bx + c = 0 and reports the discriminant, the nature of the roots and both solutions in exact and decimal form.
-
Quadratic from its roots
Builds the quadratic with given roots α and β and expands it.
-
Quadratic turning point calculator
Finds the vertex of y = ax² + bx + c and says whether it is a maximum or a minimum.
-
Sum and product of roots calculator
Gives α + β and αβ from the coefficients without solving.