completing the square

Algebra ->  Algebra  -> Quadratic Equations and Parabolas  -> Quadratic Equations Lessons  -> Quadratic Equation Lesson -> completing the square      Log On

Ad: You enter your algebra equation or inequality - Algebrator solves it step-by-step while providing clear explanations. Free on-line demo .
Ad: Algebrator™ solves your algebra problems and provides step-by-step explanations!
Ad: Algebra Solved!™: algebra software solves algebra homework problems with step-by-step help!

   

Completing the square

/div>
Jump to: navigation, search

In elementary algebra, completing the square is a technique for converting a quadratic polynomial of the form

ax^2 + bx + c\,\!

to the form

 a(\cdots\cdots)^2 + \mbox{constant}.\,

In this context, "constant" means not depending on x. The expression inside the parenthesis is of the form (x − constant). Thus one converts ax2 + bx + c to

 a(x - h)^2 + k\,

and one must find h and k.

Completing the square is used in

In mathematics, completing the square is considered a basic algebraic operation, and is often applied without remark in any computation involving quadratic polynomials.

Contents

[ Overview

[ Background

There is a simple formula in elementary algebra for computing the square of a binomial:

(x + p)^2 \,=\, x^2 + 2px + p^2.\,\!

For example:

\begin{alignat}{2}
(x+3)^2 \,&=\, x^2 + 6x + 9 && (p=3)\\[3pt]
(x-5)^2 \,&=\, x^2 - 10x + 25\qquad && (p=-5).
\end{alignat}

In any perfect square, the number p is always half the coefficient of x, and the constant term is equal to p2.

[ Basic example

Consider the following quadratic polynomial:

x^2 + 10x + 28.\,\!

This quadratic is not a perfect square, since 28 is not the square of 5:

(x+5)^2 \,=\, x^2 + 10x + 25.\,\!

However, it is possible to write the original quadratic as the sum of this square and a constant:

x^2 + 10x + 28 \,=\, (x+5)^2 + 3.

This is called completing the square.


[ General description

Given any monic quadratic

x^2 + bx + c,\,\!

it is possible to form a square that has the same first two terms:

\left(x+\tfrac{1}{2} b\right)^2 \,=\, x^2 + bx + \tfrac{1}{4}b^2.

This square differs from the original quadratic only in the value of the constant term. Therefore, we can write

x^2 + bx + c \,=\, \left(x + \tfrac{1}{2}b\right)^2 + k,

where k is a constant. This operation is known as completing the square. For example:


\begin{alignat}{1}
x^2 + 6x + 11 \,&=\, (x+3)^2 + 2 \\[3pt]
x^2 + 14x + 30 \,&=\, (x+7)^2 - 19 \\[3pt]
x^2 - 2x + 7 \,&=\, (x-1)^2 + 6.
\end{alignat}

[ Non-monic case

Given a quadratic polynomial of the form

ax^2 + bx + c\,\!

it is possible to factor out the coefficient a, and then complete the square for the resulting monic polynomial.

Example:


\begin{align}
  3x^2 + 12x + 27 &= 3(x^2+4x+9)\\
          &{}= 3\left((x+2)^2 + 5\right)\\
          &{}= 3(x+2)^2 + 15
\end{align}

This allows us to write any quadratic polynomial in the form

a(x-h)^2 + k.\,\!

[ Formula

The result of completing the square may be written as a formula. For the general case:[1]

ax^2 + bx + c \;=\; a(x-h)^2 + k,\quad\text{where}\quad h = -\frac{b}{2a} \quad\text{and}\quad k = c - \frac{b^2}{4a}.

Specifically, when a=1:

x^2 + bx + c \;=\; (x-h)^2 + k,\quad\text{where}\quad h = -\frac{b}{2} \quad\text{and}\quad k = c - \frac{b^2}{4}.

[ Relation to the graph

Graphs of quadratic functions shifted to the right by h = 0, 5, 10, and 15.
Graphs of quadratic functions shifted upward by k = 0, 5, 10, and 15.
Graphs of quadratic functions shifted upward and to the right by 0, 5, 10, and 15.

In analytic geometry, the graph of any quadratic function is a parabola in the xy-plane. Given a quadratic polynomial of the form

(x-h)^2 + k \quad\text{or}\quad a(x-h)^2 + k

the numbers h and k may be interpreted as the Cartesian coordinates of the vertex of the parabola. That is, h is the x-coordinate of the axis of symmetry, and k is the minimum value (or maximum value, if a < 0) of the quadratic function.

In other words, the graph of the function ƒ(x) = x2 is a parabola whose vertex is at the origin (0, 0). Therefore, the graph of the function ƒ(x − h) = (x − h)2 is a parabola shifted to the right by h whose vertex is at (h, 0), as shown in the top figure. In contrast, the graph of the function ƒ(x) + kx2 + k is a parabola shifted upward by k whose vertex is at (0, k), as shown in the center figure. Combining both horizontal and vertical shifts yields ƒ(x − h) + k = (x − h)2 + k is a parabola shifted to the right by h and upward by k whose vertex is at (hk), as shown in the bottom figure.

[ Solving quadratic equations

Completing the square may be used to solve any quadratic equation. For example:

x^2 + 6x + 5 = 0,\,\!

The first step is to complete the square:

(x+3)^2 - 4 = 0.\,\!

Next we solve for the squared term:

(x+3)^2 = 4.\,\!

Then either

x+3 = -2 \quad\text{or}\quad x+3 = 2,

and therefore

x = -5 \quad\text{or}\quad x = -1.

This can be applied to any quadratic equation. When the x2 has a coefficient other than 1, the first step is to divide out the equation by this coefficient: for an example see the non-monic case below.

[ Irrational and complex roots

Unlike methods involving factoring the equation, which is only reliable if the roots are rational, completing the square will find the roots of a quadratic equation even when those roots are irrational or complex. For example, consider the equation

x^2 - 10x + 18 = 0.\,\!

Completing the square gives

(x-5)^2 - 7 = 0,\,\!

so

(x-5)^2 = 7.\,\!

Then either

x-5 = -\sqrt{7} \quad\text{or}\quad x-5 = \sqrt{7},\,

so

 x = 5 - \sqrt{7}\quad\text{or}\quad x = 5 + \sqrt{7}. \,

In terser language:

x = 5 \pm \sqrt{7}.\,

Equations with complex roots can be handled in the same way. For example:

\begin{array}{c}
x^2 + 4x + 5 \,=\, 0 \\[6pt]
(x+2)^2 + 1 \,=\, 0 \\[6pt]
(x+2)^2 \,=\, -1 \\[6pt]
x+2 \,=\, \pm i \\[6pt]
x \,=\, -2 \pm i.
\end{array}

[ Non-monic case

For an equation involving a non-monic quadratic, the first step to solving them is to divide through by the coefficient of x2. For example:

\begin{array}{c}
2x^2 + 7x + 6 \,=\, 0 \\[6pt]
x^2 + \tfrac{7}{2}x + 3 \,=\, 0 \\[6pt]
\left(x+\tfrac{7}{4}\right)^2 - \tfrac{1}{16} \,=\, 0 \\[6pt]
\left(x+\tfrac{7}{4}\right)^2 \,=\, \tfrac{1}{16} \\[6pt]
x+\tfrac{7}{4} = \tfrac{1}{4} \quad\text{or}\quad x+\tfrac{7}{4} = -\tfrac{1}{4} \\[6pt]
x = -\tfrac{3}{2} \quad\text{or}\quad x = -2.
\end{array}

[ Other applications

[ Integration

Completing the square may be used to evaluate any integral of the form

\int\frac{dx}{ax^2+bx+c}

using the basic integrals

\int\frac{dx}{x^2 - a^2} = \frac{1}{2a}\ln\left|\frac{x-a}{x+a}\right| +C \quad\text{and}\quad
\int\frac{dx}{x^2 + a^2} = \frac{1}{a}\arctan\left(\frac{x}{a}\right) +C.

For example, consider the integral

\int\frac{dx}{x^2 + 6x + 13}.

Completing the square in the denominator gives:

\int\frac{dx}{(x+3)^2 + 4} \,=\, \int\frac{dx}{(x+3)^2 + 2^2}.

This can now be evaluated by using the substitution u = x + 3, which yields

\int\frac{dx}{(x+3)^2 + 4} \,=\, \frac{1}{2}\arctan\left(\frac{x+3}{2}\right)+C.

[ Complex numbers

Consider the expression

 |z|^2 - b^*z - bz^* + c,\,

where z and b are complex numbers, z* and b* are the complex conjugates of z and b, respectively, and c is a real number. Using the identity |u|2 = uu* we can rewrite this as

 |z-b|^2 - |b|^2 + c , \,\!

which is clearly a real quantity. This is because


\begin{align}
  |z-b|^2 &{}=  (z-b)(z-b)^*\\
          &{}=  (z-b)(z^*-b^*)\\
          &{}= zz^* - zb^* - bz^* + bb^*\\
          &{}=  |z|^2 - zb^* - bz^* + |b|^2 .
\end{align}

As another example, the expression

 ax^2 + by^2 + c , \,\!

where a, b, c, x, and y are real numbers, with a > 0 and b > 0, may be expressed in terms of the square of the absolute value of a complex number. Define

 z = \sqrt{a}\,x + i \sqrt{b} \,y .

Then


\begin{align}
  |z|^2 &{}= z z^*\\
        &{}= (\sqrt{a}\,x + i \sqrt{b}\,y)(\sqrt{a}\,x - i \sqrt{b}\,y) \\
        &{}= ax^2 - i\sqrt{ab}\,xy + i\sqrt{ba}\,yx - i^2by^2 \\
        &{}= ax^2 + by^2 ,
\end{align}

so

 ax^2 + by^2 + c = |z|^2 + c . \,\!

[ Geometric perspective

Completing the square 307.PNG

Consider completing the square for the equation

x^2 + bx = a.\,

Since x2 represents the area of a square with side of length x, and bx represents the area of a rectangle with sides b and x, the process of completing the square can be viewed as visual manipulation of rectangles.

Simple attempts to combine the x2 and the bx rectangles into a larger square result in a missing corner. The term (b/2)2 added to each side of the above equation is precisely the area of the missing corner, whence derives the terminology "completing the square". [1]

[ A variation on the technique

As conventionally taught, completing the square consists of adding the third term, v 2 to

u^2 + 2uv\,

to get a square. There are also cases in which one can add the middle term, either 2uv or −2uv, to

u^2 + v^2\,

to get a square.

[ Example: the sum of a positive number and its reciprocal

By writing


\begin{align}
x + {1 \over x} &{} = \left(x - 2 + {1 \over x}\right) + 2\\
                &{}= \left(\sqrt{x} - {1 \over \sqrt{x}}\right)^2 + 2
\end{align}

we show that the sum of a positive number x and its reciprocal is always greater than or equal to 2. The square of a real expression is always greater than or equal to zero, which gives the stated bound; and here we achieve 2 just when x is 1, causing the square to vanish.

[ Example: factoring a simple quartic polynomial

Consider the problem of factoring the polynomial

x^4 + 324 . \,\!

This is

(x^2)^2 + (18)^2, \,\!

so the middle term is 2(x2)(18) = 36x2. Thus we get

\begin{align} x^4 + 324 &{}= (x^4 + 36x^2 + 324 ) - 36x^2  \\
&{}= (x^2 + 18)^2 - (6x)^2 =\text{a difference of two squares} \\
&{}= (x^2 + 18 + 6x)(x^2 + 18 - 6x) \\
&{}= (x^2 + 6x + 18)(x^2 - 6x + 18)
\end{align}

(the last line being added merely to follow the convention of decreasing degrees of terms).

[ References

[ External links

Personal tools
Namespaces
Variants
Source: this wikipedia article, under CC-BY-SA.

Tutors Answer Your Questions about Quadratic Equations (FREE)


Older solutions: 1..45, 46..90, 91..135, 136..180, 181..225, 226..270, 271..315, 316..360, 361..405, 406..450, 451..495, 496..540, 541..585, 586..630, 631..675, 676..720, 721..765, 766..810, 811..855, 856..900, 901..945, 946..990, 991..1035, 1036..1080, 1081..1125, 1126..1170, 1171..1215, 1216..1260, 1261..1305, 1306..1350, 1351..1395, 1396..1440, 1441..1485, 1486..1530, 1531..1575, 1576..1620, 1621..1665, 1666..1710, 1711..1755, 1756..1800, 1801..1845, 1846..1890, 1891..1935, 1936..1980, 1981..2025, 2026..2070, 2071..2115, 2116..2160, 2161..2205, 2206..2250, 2251..2295, 2296..2340, 2341..2385, 2386..2430, 2431..2475, 2476..2520, 2521..2565, 2566..2610, 2611..2655, 2656..2700, 2701..2745, 2746..2790, 2791..2835, 2836..2880, 2881..2925, 2926..2970, 2971..3015, 3016..3060, 3061..3105, 3106..3150, 3151..3195, 3196..3240, 3241..3285, 3286..3330, 3331..3375, 3376..3420, 3421..3465, 3466..3510, 3511..3555, 3556..3600, 3601..3645, 3646..3690, 3691..3735, 3736..3780, 3781..3825, 3826..3870, 3871..3915, 3916..3960, 3961..4005, 4006..4050, 4051..4095, 4096..4140, 4141..4185, 4186..4230, 4231..4275, 4276..4320, 4321..4365, 4366..4410, 4411..4455, 4456..4500, 4501..4545, 4546..4590, 4591..4635, 4636..4680, 4681..4725, 4726..4770, 4771..4815, 4816..4860, 4861..4905, 4906..4950, 4951..4995, 4996..5040, 5041..5085, 5086..5130, 5131..5175, 5176..5220, 5221..5265, 5266..5310, 5311..5355, 5356..5400, 5401..5445, 5446..5490, 5491..5535, 5536..5580, 5581..5625, 5626..5670, 5671..5715, 5716..5760, 5761..5805, 5806..5850, 5851..5895, 5896..5940, 5941..5985, 5986..6030, 6031..6075, 6076..6120, 6121..6165, 6166..6210, 6211..6255, 6256..6300, 6301..6345, 6346..6390, 6391..6435, 6436..6480, 6481..6525, 6526..6570, 6571..6615, 6616..6660, 6661..6705, 6706..6750, 6751..6795, 6796..6840, 6841..6885, 6886..6930, 6931..6975, 6976..7020, 7021..7065, 7066..7110, 7111..7155, 7156..7200, 7201..7245, 7246..7290, 7291..7335, 7336..7380, 7381..7425, 7426..7470, 7471..7515, 7516..7560, 7561..7605, 7606..7650, 7651..7695, 7696..7740, 7741..7785, 7786..7830, 7831..7875, 7876..7920, 7921..7965, 7966..8010, 8011..8055, 8056..8100, 8101..8145, 8146..8190, 8191..8235, 8236..8280, 8281..8325, 8326..8370, 8371..8415, 8416..8460, 8461..8505, 8506..8550, 8551..8595, 8596..8640, 8641..8685, 8686..8730, 8731..8775, 8776..8820, 8821..8865, 8866..8910, 8911..8955, 8956..9000, 9001..9045, 9046..9090, 9091..9135, 9136..9180, 9181..9225, 9226..9270, 9271..9315, 9316..9360, 9361..9405, 9406..9450, 9451..9495, 9496..9540, 9541..9585, 9586..9630, 9631..9675, 9676..9720, 9721..9765, 9766..9810, 9811..9855, 9856..9900, 9901..9945, 9946..9990, 9991..10035, 10036..10080, 10081..10125, 10126..10170, 10171..10215, 10216..10260, 10261..10305, 10306..10350, 10351..10395, 10396..10440, 10441..10485, 10486..10530, 10531..10575, 10576..10620, 10621..10665, 10666..10710, 10711..10755, 10756..10800, 10801..10845, 10846..10890, 10891..10935, 10936..10980, 10981..11025, 11026..11070, 11071..11115, 11116..11160, 11161..11205, 11206..11250, 11251..11295, 11296..11340, 11341..11385, 11386..11430, 11431..11475, 11476..11520, 11521..11565, 11566..11610, 11611..11655, 11656..11700, 11701..11745, 11746..11790, 11791..11835, 11836..11880, 11881..11925, 11926..11970, 11971..12015, 12016..12060, 12061..12105, 12106..12150, 12151..12195, 12196..12240, 12241..12285, 12286..12330, 12331..12375, 12376..12420, 12421..12465, 12466..12510, 12511..12555, 12556..12600, 12601..12645, 12646..12690, 12691..12735, 12736..12780, 12781..12825, 12826..12870, 12871..12915, 12916..12960, 12961..13005, 13006..13050, 13051..13095, 13096..13140, 13141..13185, 13186..13230, 13231..13275, 13276..13320, 13321..13365, 13366..13410, 13411..13455, 13456..13500, 13501..13545, 13546..13590, 13591..13635, 13636..13680, 13681..13725, 13726..13770, 13771..13815, 13816..13860, 13861..13905, 13906..13950, 13951..13995, 13996..14040, 14041..14085, 14086..14130, 14131..14175, 14176..14220, 14221..14265, 14266..14310, 14311..14355, 14356..14400, 14401..14445, 14446..14490, 14491..14535, 14536..14580, 14581..14625, 14626..14670, 14671..14715, 14716..14760, 14761..14805, 14806..14850, 14851..14895, 14896..14940, 14941..14985, 14986..15030, 15031..15075, 15076..15120, 15121..15165, 15166..15210, 15211..15255, 15256..15300, 15301..15345, 15346..15390, 15391..15435, 15436..15480, 15481..15525, 15526..15570, 15571..15615, 15616..15660, 15661..15705, 15706..15750, 15751..15795, 15796..15840, 15841..15885, 15886..15930, 15931..15975, 15976..16020, 16021..16065, 16066..16110, 16111..16155, 16156..16200, 16201..16245, 16246..16290, 16291..16335, 16336..16380, 16381..16425, 16426..16470, 16471..16515, 16516..16560, 16561..16605, 16606..16650, 16651..16695, 16696..16740, 16741..16785, 16786..16830, 16831..16875, 16876..16920, 16921..16965, 16966..17010, 17011..17055, 17056..17100, 17101..17145, 17146..17190, 17191..17235, 17236..17280, 17281..17325, 17326..17370, 17371..17415, 17416..17460, 17461..17505, 17506..17550, 17551..17595, 17596..17640, 17641..17685, 17686..17730, 17731..17775, 17776..17820