Permalink
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (104 sloc) 5.5 KB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Solving quadratics by factoring</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<div data-ensure="abs(A) !== abs(B)">
<var id="A">randRangeNonZero( -10, 10 )</var>
<var id="B">randRangeNonZero( -10, 10 )</var>
</div>
<var id="SQUARE">1</var>
</div>
<div class="problems">
<div id="original">
<div class="vars">
<var id="CONSTANT">SQUARE*A*B</var>
<var id="SIMPLECONSTANT">A*B</var>
<var id="LINEAR">SQUARE*(-A-B)</var>
<var id="SIMPLELINEAR">-A-B</var>
</div>
<p class="question">Solve for <code>x</code>:</p>
<p class="problem"><code><var>plus(SQUARE + "x^2")</var> + <var>plus( LINEAR + "x" )</var> + <var>CONSTANT</var> = 0</code></p>
<div class="solution" data-type="set">
<div class="set-sol"><var>A</var></div>
<div class="set-sol"><var>B</var></div>
<div class="input-format">
<code>x = {}</code><span class="entry short35" data-forms="integer"></span>
and <code>x = {}</code><span class="entry short35" data-forms="integer"></span>
</div>
</div>
<div class="hints" data-apply="appendContents">
<div>
<p>The two numbers <code class="hint_pink"><var>-A</var></code> and <code class="hint_pink"><var>-B</var></code> satisfy both conditions:</p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} + \color{<var>PINK</var>}{<var>-B</var>} =
\color{<var>GREEN</var>}{<var>SIMPLELINEAR</var>}
</code></p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} \times \color{<var>PINK</var>}{<var>-B</var>} =
\color{<var>BLUE</var>}{<var>SIMPLECONSTANT</var>}
</code></p>
</div>
<p>
<code>(x <var>A &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-A</var>})
(x <var>B &lt; 0 ? "+" : ""</var> \color{<var>PINK</var>}{<var>-B</var>}) = 0</code>
</p>
<p>
<span>Since the following equation is true we know that one or both quantities must equal zero.</span>
<code>(x <var>A &lt; 0 ? "+" : ""</var> <var>-A</var>)
(x <var>B &lt; 0 ? "+" : ""</var> <var>-B</var>) = 0</code>
</p>
<p><code>x + <var>-A</var> = 0</code> or <code>x + <var>-B</var> = 0</code></p>
<p>Thus, <code>x = <var>A</var></code> and <code>x = <var>B</var></code> are the solutions.</p>
</div>
</div>
<div id="one-root">
<div class="vars">
<var id="CONSTANT">SQUARE * A * A</var>
<var id="SIMPLECONSTANT">A * A</var>
<var id="LINEAR">SQUARE * ( -2 * A )</var>
<var id="SIMPLELINEAR">-2 * A</var>
</div>
<p class="question">Solve for <code>x</code>:</p>
<p class="problem"><code><var>plus( SQUARE + "x^2")</var> + <var>plus( LINEAR + "x" )</var> + <var>CONSTANT</var> = 0</code></p>
<div class="solution" data-type="multiple">
<p><code>x = \quad</code><span class="sol short35" data-forms="integer"><var>A</var></span></p>
</div>
<div class="hints" data-apply="appendContents">
<div>
<p>The number <code class="hint_pink"><var>-A</var></code> used twice satisfies both conditions:</p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} + \color{<var>PINK</var>}{<var>-A</var>} =
\color{<var>GREEN</var>}{<var>SIMPLELINEAR</var>}
</code></p>
<p><code>
\qquad \color{<var>PINK</var>}{<var>-A</var>} \times \color{<var>PINK</var>}{<var>-A</var>} =
\color{<var>BLUE</var>}{<var>SIMPLECONSTANT</var>}
</code></p>
</div>
<p data-if="A < 0">So <code>(x + \color{<var>PINK</var>}{<var>-A</var>})^2 = 0</code>.</p><p data-else="">So <code>(x \color{<var>PINK</var>}{<var>-A</var>})^2 = 0</code>.</p>
<p><code>x + <var>-A</var> = 0</code></p>
<p>Thus, <code>x = <var>A</var></code> is the solution.</p>
</div>
</div>
</div>
<div class="hints">
<div data-if="SQUARE > 1">
<p>Dividing both sides by <var>SQUARE</var> gives:</p>
<p><code>x^2 + <var> plus(SIMPLELINEAR + "x")</var> + <var>SIMPLECONSTANT</var>=0</code></p>
</div>
<p>
The coefficient on the <code>x</code> term is <code class="hint_green"><var>SIMPLELINEAR</var></code>
and the constant term is <code class="hint_blue"><var>SIMPLECONSTANT</var></code>, so we need to find two numbers
that <span class="hint_green">add up to <code><var>SIMPLELINEAR</var></code></span> and <span class="hint_blue">multiply to
<code><var>SIMPLECONSTANT</var></code></span>.
</p>
</div>
</div>
</body>
</html>