Skip to main content
Mathematics LibreTexts

9.2: Completing the Square

  • Page ID
    18383
    • Anonymous
    • LibreTexts

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Solve quadratic equations by completing the square.

    Completing the Square

    In this section, we will devise a method for rewriting any quadratic equation of the form

    \[a x^{2}+b x+c=0\]

    in the form

    \[(x-p)^{2}=q\]

    This process is called completing the square. As we have seen, quadratic equations in this form can easily be solved by extracting roots. We begin by examining perfect square trinomials:

    \(\begin{aligned}(x+3)^{2}=\:\:\:x^{2}\:\:\:+\:\:\:& 6 x\:\:\:+&9 \\ & \color{Cerulean}{\downarrow} &\color{Cerulean}{\uparrow} \\ & \left(\frac{6}{2}\right)^{2}=(3)^{2}=&9 \end{aligned}\)

    The last term, 9, is the square of one-half of the coefficient of x. In general, this is true for any perfect square trinomial of the form \(x^{2}+bx+c\).

    \(\begin{aligned}\left(x+\frac{b}{2}\right)^{2} &=x^{2}+2 \cdot \frac{b}{2} x+\left(\frac{b}{2}\right)^{2} \\ &=x^{2}+b x+\left(\frac{b}{2}\right)^{2} \end{aligned}\)

    In other words, any trinomial of the form \(x^{2}+bx+c\) will be a perfect square trinomial if

    \[c=\left(\frac{b}{2}\right)^{2}\]

    Note

    It is important to point out that the leading coefficient must be equal to 1 for this to be true.

    Example \(\PageIndex{1}\)

    Complete the square \(x^{2}+8x+   ?  =(x+  ? )^{2}\)

    Solution:

    In this example, the coefficient of the middle term b = 8, so find the value that completes the square as follows:

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{8}{2}\right)^{2}=(4)^{2}=\color{Cerulean}{16}\)

    The value that completes the square is 16.

    \(\begin{aligned} x^{2}+8 x+16 &=(x+4)(x+4) \\ &=(x+4)^{2} \end{aligned}\)

    Answer:

    \(x^{2}+8x+16=(x+4)^{2}\)

    Example \(\PageIndex{2}\)

    Complete the square \(x^{2}+3x+   ?  =(x+  ? )^{2}\)

    Solution

    Here b = 3, so find the value that will complete the square as follows:

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{3}{2}\right)^{2}=\color{Cerulean}{\frac{9}{4}}\)

    The value 9/4 completes the square:

    \(\begin{aligned} x^{2}+3 x+\color{Cerulean}{\frac{9}{4}} &\color{black}{=}\left(x+\frac{3}{2}\right)\left(x+\frac{3}{2}\right) \\ &=\left(x+\frac{3}{2}\right)^{2} \end{aligned}\)

    Answer:

    \(x^{2}+3x+94=(x+\frac{3}{2})^{2}\)

    We can use this technique to solve quadratic equations. The idea is to take any quadratic equation in standard form and complete the square so that we can solve it by extracting roots. The following are general steps for solving a quadratic equation with a leading coefficient of 1 in standard form by completing the square.

    Example \(\PageIndex{3}\)

    Solve by completing the square: \(x^{2}+14x+46=0\).

    Solution:

    Step 1: Add or subtract the constant term to obtain the equation in the form \(x^{2}+bx   =c\). In this example, subtract 46 to move it to the right side of the equation.

    Step 2: Use \(\left(\frac{b}{2}\right)^{2}\) to determine the value that completes the square. Here b = 14:

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{14}{2}\right)^{2}=(7)^{2}=\color{Cerulean}{49}\)

    Step 3: Add \(\left(\frac{b}{2}\right)^{2}\) to both sides of the equation and complete the square.

    Step 4: Solve by extracting roots.

    Answer:

    The solutions are \(−7−\sqrt{3}\) or \(−7+\sqrt{3}\). The check is optional.

    Example \(\PageIndex{4}\)

    Solve by completing the square: \(x^{2}-18x+72=0\)

    Solution:

    Begin by subtracting 72 from both sides.

    Next, find the value that completes the square using b = −18.

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{-18}{2}\right)^{2}=(-9)^{2}=\color{Cerulean}{81}\)

    To complete the square, add 81 to both sides, complete the square, and then solve by extracting the roots.

    At this point, separate the “plus or minus” into two equations and solve each.

    \(\begin{array}{ll}{x=9-3} & {\text { or } \quad x=9+3} \\ {x=6} & \quad\quad\:\:{x=12}\end{array}\)

    Answer:

    The solutions are 6 and 12.

    Note that in the previous example the solutions are integers. If this is the case, then the original equation will factor.

    If it factors, we can solve it by factoring. However, not all quadratic equations will factor.

    Example \(\PageIndex{5}\)

    Solve by completing the square: \(x^{2}+10x+1=0\).

    Solution:

    Begin by subtracting 1 from both sides of the equation.

    Here b = 10, and we determine the value that completes the square as follows:

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{10}{2}\right)^{2}=(5)^{2}=\color{Cerulean}{25}\)

    To complete the square, add 25 to both sides of the equation.

    \(\begin{array}{l}{x^{2}+10 x=-1} \\ {x^{2}+10 x\color{Cerulean}{+25}\color{black}{=}-1\color{Cerulean}{+25}} \\ {x^{2}+10 x\color{Cerulean}{+25}\color{black}{=}24}\end{array}\)

    Factor and then solve by extracting roots.

    Answer:

    The solutions are \(-5 - 2 \sqrt{6}\) and \(-5 + 2 \sqrt{6}\)

    Sometimes quadratic equations do not have real solutions.

    Example \(\PageIndex{6}\)

    Solve by completing the square: \(x^{2}−2x+3=0\).

    Solution:

    Begin by subtracting 3 from both sides of the equation.

    Here b = −2, and we have

    \(\left(\frac{b}{2}\right)^{2}=\left(\frac{-2}{2}\right)^{2}=(-1)^{2}=\color{Cerulean}{1}\)

    Therefore,

    At this point we see that extracting the root leads to the square root of a negative number.

    Answer:

    No real solution

    Exercise \(\PageIndex{1}\)

    Solve by completing the square: \(x^{2}−2x−27=0\).

    Answer

    \(x=1\)±\(2\sqrt{7}\)

    The coefficient of x is not always divisible by 2.

    Example \(\PageIndex{7}\)

    Solve by completing the square: \(x^{2}+3x−2=0\)

    Solution:

    Begin by adding 2 to both sides.

    \(\begin{array}{l}{x^{2}+3 x-2=0} \\ {x^{2}+3 x=2}\end{array}\)

    Use b = 3 to find the value that completes the square:

    \(\left(\frac{3}{2}\right)^{2}=\color{Cerulean}{\frac{9}{4}}\)

    To complete the square, add 9/4 to both sides of the equation.

    \(\begin{array}{c}{x^{2}+3 x=2} \\ {x^{2}+3 x\color{Cerulean}{+\frac{9}{4}}\color{black}{=}2\color{Cerulean}{+\frac{9}{4}}} \\ {\left(x+\frac{3}{2}\right)\left(x+\frac{3}{2}\right)=\frac{8}{4}+\frac{9}{4}} \\ {\left(x+\frac{3}{2}\right)^{2}=\frac{17}{4}}\end{array}\)

    Solve by extracting roots.

    Answer:

    The solutions are \(\frac{-3 \pm \sqrt{17}}{2}\)

    So far, all of the examples have had a leading coefficient of 1. The formula \((\frac{b}{2})^{2}\) determines the value that completes the square only if the leading coefficient is 1. If this is not the case, then simply divide both sides by the leading coefficient.

    Example \(\PageIndex{8}\)

    Solve by completing the square: \(2x^{2}+5x-1=0\).

    Solution:

    Notice that the leading coefficient is 2. Therefore, divide both sides by 2 before beginning the steps required to solve by completing the square.

    \(\begin{array}{l}{\frac{2 x^{2}+5 x-1}{\color{Cerulean}{2}}\color{black}{=}\frac{0}{\color{Cerulean}{2}}} \\ {\frac{2 x^{2}}{2}+\frac{5 x}{2}-\frac{1}{2}=0} \\ {x^{2}+\frac{5}{2} x-\frac{1}{2}=0}\end{array}\)

    Begin by adding 1/2 to both sides of the equation.

    \(\begin{array}{l}{x^{2}+\frac{5}{2} x-\frac{1}{2}=0} \\ {x^{2}+\frac{5}{2} x=\frac{1}{2}}\end{array}\)

    Here b = 5/2, and we can find the value that completes the square as follows:

    \(\left(\frac{b}{2}\right)^{2}=\color{black}{\left(\frac{\color{Cerulean}{\frac{5}{2}}}{2}\right)}^{2}=\left(\frac{5}{2} \cdot \frac{1}{2}\right)^{2}=\left(\frac{5}{4}\right)^{2}=\color{Cerulean}{\frac{25}{16}}\)

    To complete the square, add 25/16 to both sides of the equation.

    \(\begin{aligned} x^{2}+\frac{5}{2} x &=\frac{1}{2} \\ x^{2}+\frac{5}{2} x\color{Cerulean}{+\frac{25}{16}} &\color{black}{=}\frac{1}{2}\color{Cerulean}{+\frac{25}{16}} \\\left(x+\frac{5}{4}\right)\left(x+\frac{5}{4}\right) &=\frac{8}{16}+\frac{25}{16} \\\left(x+\frac{5}{4}\right)^{2} &=\frac{33}{16} \end{aligned}\)

    Next, solve by extracting roots.

    Answer:

    The solutions are \(\frac{-5 \pm \sqrt{33}}{4}\)

    Exercise \(\PageIndex{2}\)

    Solve \(2x^{2}-2x-3=0\).

    Answer

    \(\frac{1\pm\sqrt{13}}{4}\)

    Key Takeaways

    • Solve any quadratic equation by completing the square.
    • You can apply the square root property to solve an equation if you can first convert the equation to the form \((x−p)^{2}=q\).
    • To complete the square, first make sure the equation is in the form \(x^{2}+bx   =c\). Then add the value \((\frac{b}{2})^{2}\) to both sides and factor.
    • The process for completing the square always works, but it may lead to some tedious calculations with fractions. This is the case when the middle term, b, is not divisible by 2.
    Exercise \(\PageIndex{3}\) completing the square

    Complete the square.

    1. \(x^{2}+6x+   ?  =(x+  ? )^{2}\)
    2. \(x^{2}+8x+   ?  =(x+  ? )^{2}\)
    3. \(x^{2}−2x+   ?  =(x−  ? )^{2}\)
    4. \(x^{2}−4x+   ?  =(x−  ? )^{2}\)
    5. \(x^{2}+7x+   ?  =(x+  ? )^{2}\)
    6. \(x^{2}+3x+   ?  =(x+  ? )^{2}\)
    7. \(x^{2}+23x+   ?  =(x+  ? )^{2}\)
    8. \(x^{2}+45x+   ?  =(x+  ? )^{2}\)
    9. \(x^{2}+34x+   ?  =(x+  ? )^{2}\)
    10. \(x^{2}+53x+   ?  =(x+  ? )^{2}\)
    Answer

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

    3. \(x^{2}−2x+1=(x− 1)^{2}\)

    5. \(x^{2}+7x+494=(x+ 72)^{2}\)

    7. \(x^{2}+23x+19=(x+ 13)^{2}\)

    9. \(x^{2}+34x+964=(x+ 38)^{2}\)

    Exercise \(\PageIndex{4}\)

    Solve by factoring and then solve by completing the square. Check answers.

    1. \(x^{2}+2x−8=0\)
    2. \(x^{2}−8x+15=0\)
    3. \(y^{2}+2y−24=0\)
    4. \(y^{2}−12y+11=0\)
    5. \(t^{2}+3t−28=0\)
    6. \(t^{2}−7t+10=0\)
    7. \(2x^{2}+3x−2=0\)
    8. \(3x^{2}−x−2=0\)
    9. \(2y^{2}−y−1=0\)
    10. \(2y^{2}+7y−4=0\)
    Answer

    1. −4, 2

    3. −6, 4

    5. −7, 4

    7. 1/2, −2

    9. −1/2, 1

    Exercise \(\PageIndex{5}\)

    Solve by completing the square.

    1. \(x^{2}+6x−1=0\)
    2. \(x^{2}+8x+10=0\)
    3. \(x^{2}−2x−7=0\)
    4. \(x^{2}−6x−3=0\)
    5. \(x^{2}−2x+4=0\)
    6. \(x^{2}−4x+9=0\)
    7. \(t^{2}+10t−75=0\)
    8. \(t^{2}+12t−108=0\)
    9. \(x^{2}−4x−1=15\)
    10. \(x^{2}−12x+8=−10\)
    11. \(y^{2}−20y=−25\)
    12. \(y^{2}+18y=−53\)
    13. \(x^{2}−0.6x−0.27=0\)
    14. \(x^{2}−1.6x−0.8=0\)
    15. \(x^{2}−23x−13=0\)
    16. \(x^{2}−45x−15=0\)
    17. \(x^{2}+x−1=0\)
    18. \(x^{2}+x−3=0\)
    19. \(y^{2}+3y−2=0\)
    20. \(y^{2}+5y−3=0\)
    21. \(x^{2}+3x+5=0\)
    22. \(x^{2}+x+1=0\)
    23. \(x^{2}−7x+112=0\)
    24. \(x^{2}−9x+32=0\)
    25. \(t^{2}−12t−1=0\)
    26. \(t^{2}−13t−2=0\)
    27. \(x^{2}−1.7x−0.0875=0\)
    28. \(x^{2}+3.3x−1.2775=0\)
    29. \(4x^{2}−8x−1=0\)
    30. \(2x^{2}−4x−3=0\)
    31. \(3x^{2}+6x+1=0\)
    32. \(5x^{2}+10x+2=0\)
    33. \(3x^{2}+2x−3=0\)
    34. \(5x^{2}+2x−5=0\)
    35. \(4x^{2}−12x−15=0\)
    36. \(2x^{2}+4x−43=0\)
    37. \(2x^{2}−4x+10=0\)
    38. \(6x^{2}−24x+42=0\)
    39. \(2x^{2}−x−2=0\)
    40. \(2x^{2}+3x−1=0\)
    41. \(3x^{2}+2x−2=0\)
    42. \(3x^{2}−x−1=0\)
    43. \(x(x+1)−11(x−2)=0\)
    44. \((x+1)(x+7)−4(3x+2)=0\)
    45. \(y^{2}=(2y+3)(y−1)−2(y−1)\)
    46. \((2y+5)(y−5)−y(y−8)=−24\)
    47. \((t+2)^{2}=3(3t+1)\)
    48. \((3t+2)(t−4)−(t−8)=1−10t\)
    Answer

    1. \(−3\pm\sqrt{10}\)

    3. \(1\pm 2\sqrt{2}\)

    5. No real solution

    7. −15, 5

    9. \(2(1\pm\sqrt{5})\)

    11. \(5(2\pm \sqrt{3})\)

    13. −0.3, 0.9

    15. −1/3, 1

    17. \(\frac{-1\pm \sqrt{5}}{2}\)

    19. \(\frac{-3\pm \sqrt{17}}{2}\)

    21. No real solution

    23. \(=\frac{7}{2}\pm i \frac{\sqrt{399}}{2}\)

    25. \(6\pm\sqrt{37}\)

    27. −0.05, 1.75

    29. \(\frac{2\pm \sqrt{5}}{2}\)

    31. \(\frac{-3\pm \sqrt{6}}{3}\)

    33. \(\frac{-1\pm \sqrt{10}}{3}\)

    35. \(\frac{3\pm 2 \sqrt{6}}{2}\)

    37. No real solution

    39. \(\frac{1\pm \sqrt{17}}{4}\)

    41. \(\frac{-1\pm \sqrt{7}}{3}\)

    43. \(5\pm\sqrt{3}\)

    45. \(1\pm 5\sqrt{2}\)

    47. \(\frac{5\pm \sqrt{21}}{2}\)

    Exercise \(\PageIndex{6}\)

    Solve by completing the square and round off the solutions to the nearest hundredth

    1. \((2x−1)^{2}=2x\)
    2. \((3x−2)^{2}=5−15x\)
    3. \((2x+1)(3x+1)=9x+4\)
    4. \((3x+1)(4x−1)=17x−4\)
    5. \(9x(x−1)−2(2x−1)=−4x\)
    6. \((6x+1)2−6(6x+1)=0\)
    Answer

    1. 0.19, 1.31

    3. −0.45, 1.12

    5. 0.33, 0.67

    Exercise \(\PageIndex{7}\) discussion board
    1. Research and discuss the Hindu method for completing the square.
    2. Explain why the technique for completing the square described in this section requires that the leading coefficient be equal to 1.
    Answer

    1. Answers may vary


    This page titled 9.2: Completing the Square is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Anonymous via source content that was edited to the style and standards of the LibreTexts platform.