A15-CompletingSquare.mws

High School Modules > Algebra by Gregory A. Moore

     Completing the Square


The square root principle, the method of completing the square and its application to solving second degree equations.

[Directions : Execute the Code Resource section first. Although there will be no output immediately, these definitions are used later in this worksheet.]

0. Code

>    restart;

>    SquarerootSolve := proc(eq)
    local  EQ,EQ1, EQ2,L,R,s1,s2;
    print(`\nOriginal Problem :`); print(eq);

    EQ := sqrt(lhs(eq)) = sqrt(rhs(eq));
    print(`\nTake squareroot of each side`); print(EQ);print(` `);
    print(`\nDon't forget the +/-`);
    print(lhs(EQ), ` = (+/-) `, rhs(EQ));print(` `);

    L := op(1,op(1,simplify( abs(sqrt(lhs(EQ))))));
    R := rhs(EQ);

    EQ1 := L = R; EQ2  := L = -R;
    print(`\nNow break this into two linear equations`);
    print( EQ1,EQ2);

    s1 := solve(EQ1,x); s2 := solve(EQ2,x);
    print(`\nThe solutions are :  `); print( s1, s2 );
end proc:

>    CompleteSteps := proc(EQ)        #ONLY for leading coefficient = +1 or -1
  local EQ2,EQ3,C,b, lt ;

  print(`\nOriginal Equation :`); print(EQ);

  EQ2 := sort(op(1,EQ)-op(2,EQ), x);
  
  C := coeff(EQ2,x,0);
  EQ3 := EQ2 - C = - C;
  print(`\n1. Put x terms on left and the number term on right :`);
  print(EQ3); print(` `);

  lt := coeff(EQ2,x,2); lt:= lt/abs(lt);
  if( lt = -1) then
      EQ3 := lt*lhs(EQ3) = lt*rhs(EQ3);
      print(`(If the coefficient of x^2 is negative then multiply both sides by -1)`);
      print(EQ3);
  fi;

  b := coeff( lhs(EQ3), x);
  print(`\n2. Take half of the x coefficinet`,b,
        ` and square it, add both sides`);
  print(EQ3);
  print(cat(`+   `,  convert((b/2)^2, string),
            `    +`, convert((b/2)^2, string) )); print(`_______  ___`);
  EQ2 := lhs(EQ3) + (b/2)^2 = rhs(EQ3) + (b/2)^2;
  print(EQ2);

  print(` `);
  print(factor(lhs(EQ2)) = rhs(EQ2));

  factor(lhs(EQ2)) = rhs(EQ2);
  sqrt(lhs(%)) = sqrt(rhs(%));
  print(`\n3. Take the square root of each side (with + or -)`);
  print(`\n4. Now solve the two linear equations :`); print(solve(%, x));
end proc:

>    CompleteStepsMore := proc(EQ)  #ONLY for case when leading coef­ 1
  local EQ2,EQ3,A,B,C,b, lt, sg, subEQ, rEQ,g ;
  

  print(`\nOriginal Equation :`); print(EQ);
  subEQ := sort(op(1,EQ)-op(2,EQ), x);
  A := coeff(subEQ,x,2); B := coeff(subEQ,x,1); C := coeff(subEQ,x,0);
  g := A;
  if( B <> 0 ) then g := gcd( g, B); fi;
  if( C <> 0 ) then g := gcd( g, C); fi;
  
  EQ3 := (subEQ - C)/g = - C/g;  
  
  lt := coeff((subEQ/g),x,2);
  if(lt=1) then CompleteSteps(EQ3);
  else
    
    print(` `);
    print(`\n1. Factor out any common terms and put x terms on left and the number term on right :`);
    print(EQ3); print(` `);
    A := A/g;  sg := A/abs(A);
    if( sg = -1) then
      EQ3 := -lhs(EQ3) = -rhs(EQ3);
      print(`\n(If the coefficient of x^2 is negative, then multiply both sides by -1)`);
      print(EQ3);
    fi;

    lt := abs(A);
    subEQ := lhs(EQ3)/lt;  rEQ := rhs(EQ3);
    print(`\n  Factor the leading coefficient from the left side`);
  print(cat(lt,`(`,subEQ,`) = `, rEQ));
  

  b := coeff( subEQ, x);
  print(`\n2. Take half of the x coefficient`,b,
         ` and square it to get `, (b/2)^2);
  print(`..then MULTIPLY it by leading coefficient factor`,lt,
        ` and add to both sides :`);
  
  subEQ := subEQ + (b/2)^2;     
  print(cat(
         lt,`(`,subEQ,`) = `,rEQ,` + `,lt,`*`,(b/2)^2, `)`
           ));
  rEQ := rEQ + lt*(b/2)^2;

  EQ2 := lt*subEQ = rEQ;

  print(`\n3. Take the square root of each side (with +/-)`);
  EQ2 := factor(lhs(EQ2)) = rhs(EQ2);     print(EQ2);

  
  EQ3 := sqrt(lhs(%)) = sqrt(rhs(%));
  lt:= op(1, lhs(EQ3));     rEQ := rhs(EQ3);
  subEQ := op(1, op(2, lhs(EQ2)));
  
  print(` `); print(`\n4. Now solve the two linear equations :`);
  print(cat(      lt,`(`, subEQ ,`) = `, rEQ      ));
  print(cat(      lt,`(`, convert(subEQ, string) ,`) = `, -rEQ      ));
  print(` `);
  print( lt*subEQ = rEQ);
  print( lt*subEQ = -rEQ);
  print(` `);

  
  print(x = {solve(EQ2, x)});
  fi;
end proc:

1. The Square Root Principle

Here is a straight forward problem. You can probably guess the answers; but, lets use this as an example of this solution method.

>    SquarerootSolve(x^2 = 9);

`\nOriginal Problem :`
`\nOriginal Problem :`

x^2 = 9

`\nTake squareroot of each side`
`\nTake squareroot of each side`

(x^2)^(1/2) = 3

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

(x^2)^(1/2), ` = (+/-) `, 3

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

x = 3, x = -3

`\nThe solutions are :  `
`\nThe solutions are :  `

3, -3

>    SquarerootSolve(x^2 = 324);

`\nOriginal Problem :`
`\nOriginal Problem :`

x^2 = 324

`\nTake squareroot of each side`
`\nTake squareroot of each side`

(x^2)^(1/2) = 18

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

(x^2)^(1/2), ` = (+/-) `, 18

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

x = 18, x = -18

`\nThe solutions are :  `
`\nThe solutions are :  `

18, -18



That works fine enough for perfect squares. How about for numbers which are NOT perfect squares?

>    SquarerootSolve(x^2 = 8);

`\nOriginal Problem :`
`\nOriginal Problem :`

x^2 = 8

`\nTake squareroot of each side`
`\nTake squareroot of each side`

(x^2)^(1/2) = 2*2^(1/2)

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

(x^2)^(1/2), ` = (+/-) `, 2*2^(1/2)

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

x = 2*2^(1/2), x = -2*2^(1/2)

`\nThe solutions are :  `
`\nThe solutions are :  `

2*2^(1/2), -2*2^(1/2)

>    SquarerootSolve(x^2 = 75);

`\nOriginal Problem :`
`\nOriginal Problem :`

x^2 = 75

`\nTake squareroot of each side`
`\nTake squareroot of each side`

(x^2)^(1/2) = 5*3^(1/2)

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

(x^2)^(1/2), ` = (+/-) `, 5*3^(1/2)

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

x = 5*3^(1/2), x = -5*3^(1/2)

`\nThe solutions are :  `
`\nThe solutions are :  `

5*3^(1/2), -5*3^(1/2)


What if the expression being squared is not just x?

>    SquarerootSolve( (x-3)^2 = 25 );

`\nOriginal Problem :`
`\nOriginal Problem :`

(x-3)^2 = 25

`\nTake squareroot of each side`
`\nTake squareroot of each side`

((x-3)^2)^(1/2) = 5

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

((x-3)^2)^(1/2), ` = (+/-) `, 5

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

x-3 = 5, x-3 = -5

`\nThe solutions are :  `
`\nThe solutions are :  `

8, -2

>    SquarerootSolve( (3*x+2)^2 = 40 );

`\nOriginal Problem :`
`\nOriginal Problem :`

(3*x+2)^2 = 40

`\nTake squareroot of each side`
`\nTake squareroot of each side`

((3*x+2)^2)^(1/2) = 2*10^(1/2)

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

((3*x+2)^2)^(1/2), ` = (+/-) `, 2*10^(1/2)

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

3*x+2 = 2*10^(1/2), 3*x+2 = -2*10^(1/2)

`\nThe solutions are :  `
`\nThe solutions are :  `

-2/3+2/3*10^(1/2), -2/3-2/3*10^(1/2)

>    SquarerootSolve( ((x+1)/2)^2 = 49 );

`\nOriginal Problem :`
`\nOriginal Problem :`

(1/2*x+1/2)^2 = 49

`\nTake squareroot of each side`
`\nTake squareroot of each side`

((1/2*x+1/2)^2)^(1/2) = 7

` `

`\nDon't forget the +/-`
`\nDon't forget the +/-`

((1/2*x+1/2)^2)^(1/2), ` = (+/-) `, 7

` `

`\nNow break this into two linear equations`
`\nNow break this into two linear equations`

1/2*x+1/2 = 7, 1/2*x+1/2 = -7

`\nThe solutions are :  `
`\nThe solutions are :  `

13, -15

2. The Idea of Completing the Square (leading coef = 1)


First note the difference between the
complete squares  of binomials and incomplete squares.

>    for k from 1 to 10 do
     `Perfect Square = `, (x+k)^2=expand((x+k)^2),
     `        Incomplete Square = `, expand( (x+k)^2 - k^2); od;

`Perfect Square = `, (x+1)^2 = x^2+2*x+1, `        Incomplete Square = `, x^2+2*x

`Perfect Square = `, (x+2)^2 = x^2+4*x+4, `        Incomplete Square = `, x^2+4*x

`Perfect Square = `, (x+3)^2 = x^2+6*x+9, `        Incomplete Square = `, x^2+6*x

`Perfect Square = `, (x+4)^2 = x^2+8*x+16, `        Incomplete Square = `, x^2+8*x

`Perfect Square = `, (x+5)^2 = x^2+10*x+25, `        Incomplete Square = `, x^2+10*x

`Perfect Square = `, (x+6)^2 = x^2+12*x+36, `        Incomplete Square = `, x^2+12*x

`Perfect Square = `, (x+7)^2 = x^2+14*x+49, `        Incomplete Square = `, x^2+14*x

`Perfect Square = `, (x+8)^2 = x^2+16*x+64, `        Incomplete Square = `, x^2+16*x

`Perfect Square = `, (x+9)^2 = x^2+18*x+81, `        Incomplete Square = `, x^2+18*x

`Perfect Square = `, (x+10)^2 = x^2+20*x+100, `        Incomplete Square = `, x^2+20*x

>    for k from 1 to 10 do
     `Perfect Square = `, (x-k)^2=expand((x-k)^2),
     `        Incomplete Square = `, expand( (x-k)^2 - k^2); od;

`Perfect Square = `, (x-1)^2 = x^2-2*x+1, `        Incomplete Square = `, x^2-2*x

`Perfect Square = `, (x-2)^2 = x^2-4*x+4, `        Incomplete Square = `, x^2-4*x

`Perfect Square = `, (x-3)^2 = x^2-6*x+9, `        Incomplete Square = `, x^2-6*x

`Perfect Square = `, (x-4)^2 = x^2-8*x+16, `        Incomplete Square = `, x^2-8*x

`Perfect Square = `, (x-5)^2 = x^2-10*x+25, `        Incomplete Square = `, x^2-10*x

`Perfect Square = `, (x-6)^2 = x^2-12*x+36, `        Incomplete Square = `, x^2-12*x

`Perfect Square = `, (x-7)^2 = x^2-14*x+49, `        Incomplete Square = `, x^2-14*x

`Perfect Square = `, (x-8)^2 = x^2-16*x+64, `        Incomplete Square = `, x^2-16*x

`Perfect Square = `, (x-9)^2 = x^2-18*x+81, `        Incomplete Square = `, x^2-18*x

`Perfect Square = `, (x-10)^2 = x^2-20*x+100, `        Incomplete Square = `, x^2-20*x


The incomplete squares are "missing" the constant term. We can make these "incomplete squares" become complete by adding the term that will make them complete. But how do we figure out what that is?

>    (x + a)^2: % = expand(%);

(x+a)^2 = x^2+2*x*a+a^2


Notice that the last term is the square of a  , while the middle coefficient is twice a !

>    (x + 7)^2: % = expand(%);

(x+7)^2 = x^2+14*x+49


Notice that the last term is the square of 7 , while the middle coefficient is twice 7. Therefore, if we new the middle term,
2a , we could divide it by 2 to get a , and then square a to get the "missing" constant term.

_________________________________________________________________________________
Lets try an experiment with this idea. We'll start with an incomplete square and try to complete it.

>    Expression := x^2 + 18*x;

Expression := x^2+18*x

>    `The middle coefficient is `; b := coeff(Expression, x, 1);

`The middle coefficient is `

b := 18

>    a := b/2; a2 := a^2;

a := 9

a2 := 81



Now if we add the square of a to the original expression and try to factor it, we SHOULD get a perfect square!

>    Expression + a2: % = factor(%);

x^2+18*x+81 = (x+9)^2

And we do! It works!

Lets try some more examples.

>    x^2 + 24*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2+24*x

a := 12

x^2+24*x+144 = (x+12)^2

>    x^2 + 100*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2+100*x

a := 50

x^2+100*x+2500 = (x+50)^2


It also works if the middle coefficient is negative.

>    x^2 - 30*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2-30*x

a := -15

x^2-30*x+225 = (x-15)^2

>    x^2 - 84*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2-84*x

a := -42

x^2-84*x+1764 = (x-42)^2


It even works if the middle term is odd! However, a will end up being a fraction.

>    x^2 + 5*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2+5*x

a := 5/2

x^2+5*x+25/4 = 1/4*(2*x+5)^2

>    x^2 + 21*x;
a := coeff(%, x, 1)/2;
%% + %^2 = factor( %% + %^2);

x^2+21*x

a := 21/2

x^2+21*x+441/4 = 1/4*(2*x+21)^2


So thats it. We halve then middle coefficient, then square it and add that number to make an incomplete square, complete.

3. Solving Equations by Completing the Square (leading coef = 1)

To complete the square  on an equation which is not in "square = square" form, we need to do a little preparation, and then use the method above. First, we write

>    CompleteSteps( x^2 + 6*x - 7= 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+6*x-7 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+6*x = 7

` `

`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`

x^2+6*x = 7

`+   9    +9`

`_______  ___`

x^2+6*x+9 = 16

` `

(x+3)^2 = 16

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

1, -7


You may notice that the last problem is actually much more easily solved by simply factoring the original equation. However, this method also works where factoring fails, and gives us answers not possible via integer factoring.

>    CompleteSteps( x^2 + 6*x + 7= 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+6*x+7 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+6*x = -7

` `

`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`

x^2+6*x = -7

`+   9    +9`

`_______  ___`

x^2+6*x+9 = 2

` `

(x+3)^2 = 2

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-3+2^(1/2), -3-2^(1/2)

>    CompleteSteps( x^2 + 20*x + 36 = 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+20*x+36 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+20*x = -36

` `

`\n2. Take half of the x coefficinet`, 20, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 20, ` and square it, add both sides`

x^2+20*x = -36

`+   100    +100`

`_______  ___`

x^2+20*x+100 = 64

` `

(x+10)^2 = 64

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-2, -18

>    CompleteSteps( x^2 - 20*x + 36 = 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2-20*x+36 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2-20*x = -36

` `

`\n2. Take half of the x coefficinet`, -20, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, -20, ` and square it, add both sides`

x^2-20*x = -36

`+   100    +100`

`_______  ___`

x^2-20*x+100 = 64

` `

(x-10)^2 = 64

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

18, 2


It also works when there answers are not real. <Intermediate Algebra use only>

>    CompleteSteps( x^2 + 8*x - 11= 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+8*x-11 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+8*x = 11

` `

`\n2. Take half of the x coefficinet`, 8, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 8, ` and square it, add both sides`

x^2+8*x = 11

`+   16    +16`

`_______  ___`

x^2+8*x+16 = 27

` `

(x+4)^2 = 27

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-4+3*3^(1/2), -4-3*3^(1/2)

>    CompleteSteps( x^2 + 6*x + 20= 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+6*x+20 = 0

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+6*x = -20

` `

`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 6, ` and square it, add both sides`

x^2+6*x = -20

`+   9    +9`

`_______  ___`

x^2+6*x+9 = -11

` `

(x+3)^2 = -11

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-3+11^(1/2)*I, -3-I*11^(1/2)



Note that the problem might be slightly obscured to begin with because the terms are not in the "right places." We can easily fix that by putting them back in order.

>    CompleteSteps(  x + 10 = x^2);

`\nOriginal Equation :`
`\nOriginal Equation :`

x+10 = x^2

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

-x^2+x = -10

` `

`(If the coefficient of x^2 is negative then multiply both sides by -1)`

x^2-x = 10

`\n2. Take half of the x coefficinet`, -1, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, -1, ` and square it, add both sides`

x^2-x = 10

`+   1/4    +1/4`

`_______  ___`

x^2-x+1/4 = 41/4

` `

1/4*(2*x-1)^2 = 41/4

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

1/2+1/2*41^(1/2), 1/2-1/2*41^(1/2)



Sometimes we have an additional step - to make sure that the coefficient on x^2 is positive 1.

>    CompleteSteps( 2 - x^2 = x);

`\nOriginal Equation :`
`\nOriginal Equation :`

2-x^2 = x

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

-x^2-x = -2

` `

`(If the coefficient of x^2 is negative then multiply both sides by -1)`

x^2+x = 2

`\n2. Take half of the x coefficinet`, 1, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 1, ` and square it, add both sides`

x^2+x = 2

`+   1/4    +1/4`

`_______  ___`

x^2+x+1/4 = 9/4

` `

1/4*(2*x+1)^2 = 9/4

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

1, -2

>    CompleteSteps( 8 - x^2 = 5*x);

`\nOriginal Equation :`
`\nOriginal Equation :`

8-x^2 = 5*x

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

-x^2-5*x = -8

` `

`(If the coefficient of x^2 is negative then multiply both sides by -1)`

x^2+5*x = 8

`\n2. Take half of the x coefficinet`, 5, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 5, ` and square it, add both sides`

x^2+5*x = 8

`+   25/4    +25/4`

`_______  ___`

x^2+5*x+25/4 = 57/4

` `

1/4*(2*x+5)^2 = 57/4

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-5/2+1/2*57^(1/2), -5/2-1/2*57^(1/2)



There is also a built-in function for completing the square.

>    student[completesquare](x^2 + 6*x = 7);
solve(%, x);

(x+3)^2-9 = 7

1, -7

4. More Difficult Equations to solve (leading coef ­ 1)

>    CompleteStepsMore( 2*x^2 + 3*x + 1 = 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

2*x^2+3*x+1 = 0

` `

`\n1. Factor out any common terms and put x terms on left and the number term on right :`
`\n1. Factor out any common terms and put x terms on left and the number term on right :`

2*x^2+3*x = -1

` `

`\n  Factor the leading coefficient from the left side`
`\n  Factor the leading coefficient from the left side`

`2(` || (x^2+3/2*x) || `) = ` || (-1)

`\n2. Take half of the x coefficient`, 3/2, ` and square it to get `, 9/16
`\n2. Take half of the x coefficient`, 3/2, ` and square it to get `, 9/16

`..then MULTIPLY it by leading coefficient factor`, 2, ` and add to both sides :`

`2(` || (x^2+3/2*x+9/16) || `) = ` || (-1) || ` + ` || 2 || `*` || (9/16) || `)`

`\n3. Take the square root of each side (with +/-)`
`\n3. Take the square root of each side (with +/-)`

1/8*(4*x+3)^2 = 1/8

` `

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

`` || (1/4) || `(` || (4*x+3) || `) = ` || (1/4*2^(1/2))

`` || (1/4) || `(` || (

` `

x+3/4 = 1/4*2^(1/2)

x+3/4 = -1/4*2^(1/2)

` `

x = {-1, -1/2}

>    CompleteStepsMore( 3 - 2*x = 4*x^2); solve( 3 - 2*x = 4*x^2);

`\nOriginal Equation :`
`\nOriginal Equation :`

3-2*x = 4*x^2

` `

`\n1. Factor out any common terms and put x terms on left and the number term on right :`
`\n1. Factor out any common terms and put x terms on left and the number term on right :`

-4*x^2-2*x = -3

` `

`\n(If the coefficient of x^2 is negative, then multiply both sides by -1)`
`\n(If the coefficient of x^2 is negative, then multiply both sides by -1)`

4*x^2+2*x = 3

`\n  Factor the leading coefficient from the left side`
`\n  Factor the leading coefficient from the left side`

`4(` || (x^2+1/2*x) || `) = ` || 3

`\n2. Take half of the x coefficient`, 1/2, ` and square it to get `, 1/16
`\n2. Take half of the x coefficient`, 1/2, ` and square it to get `, 1/16

`..then MULTIPLY it by leading coefficient factor`, 4, ` and add to both sides :`

`4(` || (x^2+1/2*x+1/16) || `) = ` || 3 || ` + ` || 4 || `*` || (1/16) || `)`

`\n3. Take the square root of each side (with +/-)`
`\n3. Take the square root of each side (with +/-)`

1/4*(4*x+1)^2 = 13/4

` `

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

`` || (1/2) || `(` || (4*x+1) || `) = ` || (1/2*13^(1/2))

`` || (1/2) || `(` || (

` `

2*x+1/2 = 1/2*13^(1/2)

2*x+1/2 = -1/2*13^(1/2)

` `

x = {-1/4+1/4*13^(1/2), -1/4-1/4*13^(1/2)}

-1/4-1/4*13^(1/2), -1/4+1/4*13^(1/2)

>    CompleteStepsMore( 5*x^2 + x - 1 = 0); solve(5*x^2 + x - 1 = 0, x);

`\nOriginal Equation :`
`\nOriginal Equation :`

5*x^2+x-1 = 0

` `

`\n1. Factor out any common terms and put x terms on left and the number term on right :`
`\n1. Factor out any common terms and put x terms on left and the number term on right :`

5*x^2+x = 1

` `

`\n  Factor the leading coefficient from the left side`
`\n  Factor the leading coefficient from the left side`

`5(` || (x^2+1/5*x) || `) = ` || 1

`\n2. Take half of the x coefficient`, 1/5, ` and square it to get `, 1/100
`\n2. Take half of the x coefficient`, 1/5, ` and square it to get `, 1/100

`..then MULTIPLY it by leading coefficient factor`, 5, ` and add to both sides :`

`5(` || (x^2+1/5*x+1/100) || `) = ` || 1 || ` + ` || 5 || `*` || (1/100) || `)`

`\n3. Take the square root of each side (with +/-)`
`\n3. Take the square root of each side (with +/-)`

1/20*(10*x+1)^2 = 21/20

` `

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

`` || (1/10) || `(` || (10*x+1) || `) = ` || (1/10*105^(1/2))

`` || (1/10) || `(` || (

` `

x+1/10 = 1/10*105^(1/2)

x+1/10 = -1/10*105^(1/2)

` `

x = {-1/10-1/10*21^(1/2), -1/10+1/10*21^(1/2)}

-1/10+1/10*21^(1/2), -1/10-1/10*21^(1/2)


Sometimes, the equation only appears to have a leading coefficient other than one.

>    CompleteStepsMore( 100*x^2 + 200*x + 100 = 0);

`\nOriginal Equation :`
`\nOriginal Equation :`

100*x^2+200*x+100 = 0

`\nOriginal Equation :`
`\nOriginal Equation :`

x^2+2*x = -1

`\n1. Put x terms on left and the number term on right :`
`\n1. Put x terms on left and the number term on right :`

x^2+2*x = -1

` `

`\n2. Take half of the x coefficinet`, 2, ` and square it, add both sides`
`\n2. Take half of the x coefficinet`, 2, ` and square it, add both sides`

x^2+2*x = -1

`+   1    +1`

`_______  ___`

x^2+2*x+1 = 0

` `

(x+1)^2 = 0

`\n3. Take the square root of each side (with + or -)`
`\n3. Take the square root of each side (with + or -)`

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

-1, -1


Lets try this big guy.

>    CompleteStepsMore( 3600*x^2-15120*x+15876=0 );

`\nOriginal Equation :`
`\nOriginal Equation :`

3600*x^2-15120*x+15876 = 0

` `

`\n1. Factor out any common terms and put x terms on left and the number term on right :`
`\n1. Factor out any common terms and put x terms on left and the number term on right :`

100*x^2-420*x = -441

` `

`\n  Factor the leading coefficient from the left side`
`\n  Factor the leading coefficient from the left side`

`100(` || (x^2-21/5*x) || `) = ` || (-441)

`\n2. Take half of the x coefficient`, -21/5, ` and square it to get `, 441/100
`\n2. Take half of the x coefficient`, -21/5, ` and square it to get `, 441/100

`..then MULTIPLY it by leading coefficient factor`, 100, ` and add to both sides :`

`100(` || (x^2-21/5*x+441/100) || `) = ` || (-441) || ` + ` || 100 || `*` || (441/100) || `)`

`\n3. Take the square root of each side (with +/-)`
`\n3. Take the square root of each side (with +/-)`

(10*x-21)^2 = 0

` `

`\n4. Now solve the two linear equations :`
`\n4. Now solve the two linear equations :`

`` || ((10*x-21)^2) || `(` || 2 || `) = ` || 0

`` || ((10*x-21)^2) || `(` || (

` `

2*(10*x-21)^2 = 0

2*(10*x-21)^2 = 0

` `

x = {21/10}


Not so big after all!

5. Equations of Parabolas and Circles


PARABOLAS

Its very nice to express parabolas in the form : y = (x-a)^2 + b or (y-b) = (x-a)^2, because we can immediately read the vertex as being (a,b). This makes it easy to graph and easy to find the maximum or minimum point of the parabola. When we are given an equation for a parabola which is NOT in the form, our new friend "completing the square" can come to the rescue.

>    y = x^2 + 6*x + 7;
student[completesquare](%,x);

y = x^2+6*x+7

y = (x+3)^2-2

>    y = x^2 + 46*x ;
student[completesquare](%,x);

y = x^2+46*x

y = (x+23)^2-529

>    y = x^2 + 9*x + 3;
student[completesquare](%,x);

y = x^2+9*x+3

y = (x+9/2)^2-69/4


This works for downward parabolas also.

>    y = -x^2 + 20*x - 23;
student[completesquare](%,x);

y = -x^2+20*x-23

y = -(x-10)^2+77


This also works for parabolas which have some vertical stretching or compression. These more generalized parabolas are expressable in the form y = c(x-a)^2 + b, or (y-b) = c(x-a)^2.

>    y = 4*x^2 + 9*x - 11;
student[completesquare](%,x);

y = 4*x^2+9*x-11

y = 4*(x+9/8)^2-257/16

>    y = 1205*x^2 + 4030*x ;
student[completesquare](%,x);

y = 1205*x^2+4030*x

y = 1205*(x+403/241)^2-812045/241

>    y = -20000*x^2 + 926*x -8;
student[completesquare](%,x);

y = -20000*x^2+926*x-8

y = -20000*(x-463/20000)^2+54369/20000



CIRCLES

To find the equation of a circle in center-radius form -  (x-h)^2 + (y-k)^2 = r^2 - its sometimes necessary to perform  completion of the square on BOTH x and y! Although it may appear to be double trouble, its only the same process performed twice.

Here is an example. First we complete the square with respect to x.

>    x^2 + 6*x + y^2 -8*y = 7;
student[completesquare](%,x);

x^2+6*x+y^2-8*y = 7

(x+3)^2-9+y^2-8*y = 7


To tidy things up a bit, lets add 9 to both sides. This gets all of the loose constants onto the right side, where they are safely away from dangerously spinning variables.

>    lhs(%) + 9 = rhs(%) + 9;

(x+3)^2+y^2-8*y = 16


Now lets do it again - but this time with respect to y.

>    student[completesquare](%,y);

(y-4)^2-16+(x+3)^2 = 16


Tidy up a bit ....

>    lhs(%) + 16 = rhs(%) + 16;

(y-4)^2+(x+3)^2 = 32



There it is! The center is (-3,4) and the radius is sqrt(32).

Lets try another example.

>    x^2 - 200*x + y^2 + 200*y = 0;
student[completesquare](%,x);

x^2-200*x+y^2+200*y = 0

(x-100)^2-10000+y^2+200*y = 0

>    lhs(%) + 10000 = rhs(%) + 10000;

(x-100)^2+y^2+200*y = 10000

>    student[completesquare](%,y);

(y+100)^2-10000+(x-100)^2 = 10000

>    lhs(%) + 10000 = rhs(%) + 10000;

(y+100)^2+(x-100)^2 = 20000


         © 2002 Waterloo Maple Inc