Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 116 lines (115 sloc) 8.076 kb
9289958 Scott Menke New exercise: Completing the square 2
smenks13 authored
1 <!DOCTYPE html>
cde9e9f John Resig Re-run the exercises through the updated cleaner.
jeresig authored
2 <html data-require="math polynomials expressions math-format">
3 <head>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
dcd8a7f Ben Alpert Update title tags
spicyj authored
5 <title>Solving quadratics by completing the square 2</title>
ac1415e Ben Alpert Use requirejs for module loading
spicyj authored
6 <script data-main="../local-only/main.js" src="../local-only/require.js"></script>
9289958 Scott Menke New exercise: Completing the square 2
smenks13 authored
7 </head>
8 <body>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
9 <div class="exercise">
10 <div class="problems">
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
11 <div id="original" data-weight="4">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
12 <div class="vars">
13 <var id="X1">randRange( 1, 4 ) / randRangeNonZero( -2, 2 )</var>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
14 <var id="X2" data-ensure="X1 !== X2">( randRange( -3, 3 ) * 2 + 1 ) / 2</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
15 <var id="B">( X1 + X2 ) * -1</var>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
16 <var id="B_SIGN">B &gt; 0 ? "+" : "-"</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
17 <var id="C">X1 * X2</var>
18 <var id="MULT">getLCM( toFraction( B )[1], toFraction( C )[1] )</var>
19 <var id="POLY">new Polynomial( 0, 2, [MULT*C, MULT*B, MULT], "x" )</var>
20 <var id="POLY_TEXT">POLY.text()</var>
cee8be0 Emily Eisenberg Don't use $._ inside of <var>s
xymostech authored
21 <var id="OR">$._("or")</var>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
22 </div>
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
23 <p class="question">Complete the square to solve for <code>x</code>.</p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
24 <p><code><var>POLY_TEXT</var> = 0</code></p>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
25 <div class="solution" data-type="set">
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
26 <div class="set-sol" data-type="multiple">
b0236eb Ben Eater No need to limit to non-decimal rational answers in completing_the_squar...
beneater authored
27 <span class="sol"><var>B / 2</var></span>
28 <span class="sol"><var>C * -1 + pow( B / 2, 2 )</var></span>
29 <span class="sol"><var>X1</var></span>
30 <span class="sol"><var>X2</var></span>
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
31 </div>
32 <div class="set-sol" data-type="multiple">
b0236eb Ben Eater No need to limit to non-decimal rational answers in completing_the_squar...
beneater authored
33 <span class="sol"><var>B / 2</var></span>
34 <span class="sol"><var>C * -1 + pow( B / 2, 2 )</var></span>
35 <span class="sol"><var>X2</var></span>
36 <span class="sol"><var>X1</var></span>
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
37 </div>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
38 <div class="input-format">
42e5174 Justin Helps Cleaned up answer area
Helpsypoo authored
39 <div class="entry" data-type="multiple">
a07cd32 Craig Silverstein Fix up some exercises by running the linter.
csilvers authored
40 <b>Completed Square:</b> <br>
41 <code>(x + {}</code><span class="sol short32"></span> <code>)^2 = {}</code> <span class="sol short40"></span> <br><br>
42 <b>Solution:</b> <br>
3e985ac Craig Silverstein Add tools/runlint.py, which will be automatically run by khan-linter.
csilvers authored
43 <code>x = {}</code><span class="sol short32"></span><code>\quad\text{<var>OR</var>}\quad x = {}</code><span class="sol short32"></span>
42e5174 Justin Helps Cleaned up answer area
Helpsypoo authored
44 </div>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
45 </div>
46 </div>
47 </div>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
48 <div id="one-root" data-type="original" data-weight="1">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
49 <div class="vars">
50 <var id="X1">( randRange( -4, 4 ) * 2 + 1 ) / 2</var>
51 <var id="X2">X1</var>
52 </div>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
53 <div class="solution" data-type="multiple">
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
54 <p>
a07cd32 Craig Silverstein Fix up some exercises by running the linter.
csilvers authored
55 <b>Completed Square:</b> <br>
56 <code>(x + {}</code><span class="sol short32"><var>-X1</var></span> <code>)^2 = {}</code> <span class="sol short40">0</span> <br><br>
57 <b>Solution:</b> <br>
7c7c976 Justin Helps Added boxes to completing the square exercises
Helpsypoo authored
58 <code>x = \quad</code><span class="sol short32"><var>X1</var></span>
59 </p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
60 </div>
61 </div>
0f0c630 Michael Chang Clean up the exercise files using the new cleaning utility. (II)
cbhl authored
62 <div id="odds" data-type="original" data-weight="2">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
63 <div class="vars">
64 <var id="X1">randRangeNonZero( -8, 8 )</var>
65 <var id="X2">randRange( -4, 4 ) * 2 + ( X1 % 2 - 1 )</var>
66 </div>
67 </div>
68 </div>
69 <div class="hints">
70 <div data-if="MULT !== 1">
71 <p>First, divide the polynomial by <code><var>MULT</var></code>, the coefficient of the <code>x^2</code> term.</p>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
72 <p><code>x^2 <span data-if="B !== 0"><span data-if="abs( B ) !== 1"> + <var>decimalFraction( B, 1, 1 )</var></span><span data-else=""><var>B_SIGN</var></span>x</span> + <var>decimalFraction( C, 1, 1 )</var> = 0</code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
73 </div>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
74 <div data-if="X1 !== X2" data-unwrap="">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
75 <div data-if="C !== 0">
76 <p>Move the constant term to the right side of the equation.</p>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
77 <p><code>x^2 <span data-if="B !== 0"><span data-if="abs( B ) !== 1"> + <var>decimalFraction( B, 1, 1 )</var></span><span data-else=""><var>B_SIGN</var></span>x</span> = <var>decimalFraction( C * -1, 1, 1 )</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
78 </div>
79 <div data-if="B !== 0">
80 <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. The coefficient of our <code>x</code> term is <code><var>decimalFraction( B, 1, 1 )</var></code>, so half of it would be <code><var>decimalFraction( B / 2, 1, 1 )</var></code>, and squaring it gives us <code>\color{blue}{<var>decimalFraction( pow( B / 2, 2 ), 1, 1 )</var>}</code>.</p>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
81 <p><code>x^2 <span data-if="abs( B ) !== 1"> + <var>decimalFraction( B, 1, 1 )</var></span><span data-else=""><var>B_SIGN</var></span>x \color{blue}{ + <var>decimalFraction( pow( B / 2, 2 ), 1, 1 )</var>} = <var>decimalFraction( C * -1, 1, 1 )</var> \color{blue}{ + <var>decimalFraction( pow( B / 2, 2 ), 1, 1 )</var>}</code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
82 </div>
83 <div data-if="B !== 0">
84 <p>We can now rewrite the left side of the equation as a squared term.</p>
85 <p><code>( x + <var>decimalFraction( B / 2, 1, 1 )</var> )^2 = <var>decimalFraction( C * -1 + pow( B / 2, 2 ), 1, 1 )</var></code></p>
86 </div>
87 </div>
e9807ff John Resig Clean up the exercise files using the new cleaning utility.
jeresig authored
88 <div data-else="" data-unwrap="">
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
89 <p>Note that the left side of the equation is already a perfect square trinomial. The coefficient of our <code>x</code> term is <code><var>decimalFraction( B, 1, 1 )</var></code>, half of it is <code><var>decimalFraction( B / 2, 1, 1 )</var></code>, and squaring it gives us <code>\color{blue}{<var>decimalFraction( pow( B / 2, 2 ), 1, 1 )</var>}</code>, our constant term.</p>
90 <div>
91 <p>Thus, we can rewrite the left side of the equation as a squared term.</p>
92 <p><code>( x + <var>decimalFraction( B / 2, 1, 1 )</var> )^2 = <var>decimalFraction( C * -1 + pow( B / 2, 2 ), 1, 1 )</var></code></p>
93 </div>
94 </div>
95 <div>
96 <p>Take the square root of both sides.</p>
97 <p><code>x <span data-if="B !== 0"> + <var>decimalFraction( B / 2, 1, 1 )</var></span> = <span data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0">\pm</span><var>decimalFraction( sqrt( C * -1 + pow( B / 2, 2 ) ), 1, 1 )</var></code></p>
98 </div>
99 <div data-if="B !== 0">
100 <p>Isolate <code>x</code> to find the solution(s).</p>
101 <p data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0"><code>x = <var>decimalFraction( -B / 2, 1, 1 )</var>\pm<var>decimalFraction( sqrt( C * -1 + pow( B / 2, 2 ) ), 1, 1 )</var></code></p>
102 </div>
f786f36 Ben Eater Include the full answer in the last hint
beneater authored
103 <div>
104 <div data-if="sqrt( C * -1 + pow( B / 2, 2 ) ) !== 0">
cee8be0 Emily Eisenberg Don't use $._ inside of <var>s
xymostech authored
105 <p>The solutions are: <code>x = <var>decimalFraction( -B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) ), 1, 1 )</var> \text{ <var>OR</var> } x = <var>decimalFraction( -B / 2 - sqrt( C * -1 + pow( B / 2, 2 ) ), 1, 1 )</var></code></p>
f786f36 Ben Eater Include the full answer in the last hint
beneater authored
106 </div>
107 <div data-else="">
108 <p>The solution is: <code>x = <var>decimalFraction( -B / 2 + sqrt( C * -1 + pow( B / 2, 2 ) ), 1, 1 )</var></code></p>
109 </div>
110 <p>We already found the completed square: <code>( x + <var>decimalFraction( B / 2, 1, 1 )</var> )^2 = <var>decimalFraction( C * -1 + pow( B / 2, 2 ), 1, 1 )</var></code></p>
4e4cb9b Ben Eater lint: tabs->spaces and jQuery->$ for exercises
beneater authored
111 </div>
112 </div>
113 </div>
cde9e9f John Resig Re-run the exercises through the updated cleaner.
jeresig authored
114 </body>
115 </html>
Something went wrong with that request. Please try again.