<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="description">
    <name>
      <text>1.2.2 (Why completing the square works)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<p>In order to understand why completing the square works, we can think of it geometrically. Consider the expression \(x^2 + bx\). This is a quadratic in standard form with \(a = 1\) and \(c = 0\). The \(x^2\) term represents a square, with side length \(x\) and \(bx\) is a rectangle with side lengths \(b\) and \(x\). The diagram below shows how we can rearrange \(x^2 + bx\) into being 'almost' a square.</p>
<br>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="@@PLUGINFILE@@/Completing%20the%20Square.svg?time=1597664956129" alt="Diagram explaing completing the square" width="589" height="138"></p>
<br>
<p>When we divide the \(b\) by two, we split the \(bx\) rectangle into two, both with side lengths \(\frac{b}{2}\) and \(x\). Placing the rectangles as in the right hand image we see that we almost get a square but we are missing the bottom right square with side length \(\frac{b}{2}\). Hence for the right hand image we <em>complete the square</em> by adding the area of the small square, namely \(\left(\frac{b}{2}\right)^2\).</p>

<p>Writing this in terms of an equation we have 
\[ 
x^2 + bx + \left(\frac{b}{2}\right)^2 = (x + \frac{b}{2})^2. 
\] 
Note that in order to make sure the equation is balanced, we have to subtract the value \(\left(\frac{b}{2}\right)^2\) as well, to compensate for the fact we had added it previously. Comparing this process with the example above, we can see that this is precisely what we did in the previous example to get 
\[ 
x^2 + 6x = (x+ 3)^2 - 9. 
\]
</p>
<br>
<h3>Example</h3>

<p>Complete the square for \(x^2 + 8x + 1\).</p>
<br>
<h3>Solution</h3>
<p>In this case we have that \(b = 8\), thus \(\frac{b}{2} = 4\) and \(\left(\frac{b}{2}\right)^2 = 16\). We now complete the square by adding and subtracting \(\left(\frac{b}{2}\right)^2\) to obtain 
\[ 
x^2 + 8x + 1 + 16 - 16. 
\] 
Rearranging gives 
\[ 
x^2 + 8x + 16 + 1 -16 = (x+4)^2 +1 -16  = (x+4)^2 -15. 
\] 
We can now see that the quadratic has been re-written in the form (\(x+p)^2 + q\), (with \(p = 4\) and \(q = -15\)). Hence we have successfully completed the square!</p>]]></text>
<file name="Completing the square.svg" path="/" encoding="base64">[encoded data, 71788 characters]</file>
<file name="Completing the Square.svg" path="/" encoding="base64">[encoded data, 71512 characters]</file>
    </questiontext>
    <generalfeedback format="html">
      <text/>
    </generalfeedback>
    <defaultgrade>0</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
  </question>
</quiz>
