Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 81 lines (81 sloc) 4.904 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
<!DOCTYPE html>
<html data-require="math polynomials expressions math-format">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Completing the square 1</title>
    <script src="../khan-exercise.js"></script>
    <style type="text/css">
        #answer_area .short input[type=text] {
            width: 32px;
        }
    </style>
</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>
                </div>
                <p class="question">Solve for <code>x</code> by completing the square.</p>
                <p><code><var>POLY_TEXT</var> = 0</code></p>
                <div class="solution" data-type="set">
                    <div class="set-sol"><var>X1</var></div>
                    <div class="set-sol"><var>X2</var></div>
                    <div class="input-format">
                        <p><code>x = {}</code><span class="entry short"></span><code>\quad\text{or}\quad x = {}</code><span class="entry short"></span></p>
                    </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><code>x = \quad</code><span class="sol"><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>
                <p><code>x = <var>-B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) )</var><span data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0"> \text{ or } x = <var>-B / 2 - sqrt( C * -1 + pow( B / 2, 2 ) )</var></span></code></p>
            </div>
            <div data-else>
                <p><code>x = <var>-B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) )</var><span data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0"> \text{ or } x = <var>-B / 2 - sqrt( C * -1 + pow( B / 2, 2 ) )</var></span></code></p>
            </div>
        </div>
    </div>
</body>
</html>
Something went wrong with that request. Please try again.