Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 104 lines (102 sloc) 6.321 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
<!DOCTYPE html>
<html data-require="math polynomials expressions math-format">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Solving quadratics by completing the square 1</title>
    <script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
    <div class="exercise">
        <div class="problems">
            <div id="original" data-weight="5">
                <div class="vars">
                    <var id="X1">randRangeNonZero( -10, 10 )</var>
                    <var id="X2" data-ensure="X1 !== X2">randRange( -5, 5 ) * 2 + ( X1 % 2 )</var>
                    <var id="B">( X1 + X2 ) * -1</var>
                    <var id="C">X1 * X2</var>
                    <var id="POLY">new Polynomial( 0, 2, [C, B, 1], "x" )</var>
                    <var id="POLY_TEXT">POLY.text()</var>
                    <var id="OR">$._("or")</var>
                </div>
                <p class="question">Complete the square to solve for <code>x</code>.</p>
                <p><code><var>POLY_TEXT</var> = 0</code></p>

                <div class="solution" data-type="set">
                    <div class="set-sol" data-type="multiple">
                        <span class="sol"><var>B/2</var></span>
                        <span class="sol"><var>C * -1 + pow( B / 2, 2 )</var></span>
                        <span class="sol"><var>X1</var></span>
                        <span class="sol"><var>X2</var></span>
                    </div>
                    <div class="set-sol" data-type="multiple">
                        <span class="sol"><var>B/2</var></span>
                        <span class="sol"><var>C * -1 + pow( B / 2, 2 )</var></span>
                        <span class="sol"><var>X2</var></span>
                        <span class="sol"><var>X1</var></span>
                    </div>
                    <div class="input-format">
                        <div class="entry" data-type="multiple">
                            <b>Completed Square:</b> <br>
                            <code>(x + {}</code><span class="sol short32"></span> <code>)^2 = {}</code> <span class="sol short32"></span> <br><br>
                            <b>Solution:</b> <br>
                            <code>x = {}</code><span class="sol short32"></span><code>\quad\text{<var>OR</var>}\quad x = {}</code><span class="sol short32"></span>
                        </div>
                    </div>
                </div>
            </div>
            <div id="one-root" data-type="original" data-weight="1">
                <div class="vars">
                    <var id="X2">X1</var>
                </div>
                <div class="solution" data-type="multiple">
                    <p>
                        <b>Completed Square:</b> <br>
                        <code>(x + {}</code><span class="sol short32"><var>-X1</var></span> <code>)^2 = {}</code> <span class="sol short32">0</span> <br><br>
                        <b>Solution:</b> <br>
                        <code>x = \quad</code><span class="sol short32"><var>X1</var></span>
                    </p>
                </div>
            </div>
        </div>
        <div class="hints">
            <div data-if="X1 !== X2" data-unwrap="">
                <div data-if="C !== 0">
                    <p>Begin by moving the constant term to the right side of the equation.</p>
                    <p><code>x^2 <span data-if="B !== 0"> + <var>B</var>x</span> = <var>C * -1</var></code></p>
                </div>
                <div data-if="B !== 0">
                    <p>We complete the square by taking half of the coefficient of our <code>x</code> term, squaring it, and adding it to both sides of the equation. Since the coefficient of our <code>x</code> term is <code><var>B</var></code>, half of it would be <code><var>B / 2</var></code>, and squaring it gives us <code>\color{blue}{<var>pow( B / 2, 2 )</var>}</code>.</p>
                    <p><code>x^2 + <var>B</var>x \color{blue}{ + <var>pow( B / 2, 2 )</var>} = <var>C * -1</var> \color{blue}{ + <var>pow( B / 2, 2 )</var>}</code></p>
                </div>
                <div data-if="B !== 0">
                    <p>We can now rewrite the left side of the equation as a squared term.</p>
                    <p><code>( x + <var>B / 2</var> )^2 = <var>C * -1 + pow( B / 2, 2 )</var></code></p>
                </div>
            </div>
            <div data-else="" data-unwrap="">
                <p>The left side of the equation is already a perfect square trinomial. The coefficient of our <code>x</code> term is <code><var>B</var></code>, half of it is <code><var>B / 2</var></code>, and squaring it gives us <code>\color{blue}{<var>pow( B / 2, 2 )</var>}</code>, our constant term.</p>
                <div>
                    <p>Thus, we can rewrite the left side of the equation as a squared term.</p>
                    <p><code>( x + <var>B / 2</var> )^2 = <var>C * -1 + pow( B / 2, 2 )</var></code></p>
                </div>
            </div>
            <div>
                <p>Take the square root of both sides.</p>
                <p><code>x <span data-if="B !== 0"> + <var>B / 2</var></span> = <span data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0">\pm</span><var>sqrt( C * -1 + pow( B / 2, 2 ) )</var></code></p>
            </div>
            <div data-if="B !== 0">
                <p>Isolate <code>x</code> to find the solution(s).</p>
                <p data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0"><code>x = <var>-B / 2</var>\pm<var>sqrt( C * -1 + pow( B / 2, 2 ) )</var></code></p>
            </div>
            <div>
                <div data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0">
                    <p>So the solutions are: <code>x = <var>-B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) )</var> \text{ <var>OR</var> } x = <var>-B / 2 - sqrt( C * -1 + pow( B / 2, 2 ) )</var></code></p>
                </div>
                <div data-else="">
                    <p>The solution is: <code>x = <var>-B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) )</var></code></p>
                </div>
                <p>We already found the completed square: <code>( x + <var>B / 2</var> )^2 = <var>C * -1 + pow( B / 2, 2 )</var></code></p>
            </div>
        </div>
    </div>
</body>
</html>
Something went wrong with that request. Please try again.