Fetching contributors…
Cannot retrieve contributors at this time
75 lines (71 sloc) 3.64 KB
<!DOCTYPE html>
<html data-require="math math-format">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Equations with variables on both sides</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<!-- equation is Ax + B = Cx + D -->
<div class="vars">
<var id="A">randRange( 2, 10 )</var>
<var id="B">randRangeNonZero( -10, 10 )</var>
<var id="C" data-ensure="C !== A &amp;&amp; abs( A - C ) &gt; 1">randRange( 2, 10 )</var>
<var id="D" data-ensure="D !== B">randRangeNonZero( 2, 10 )</var>
<var id="SOLUTION">fractionReduce( D - B, A - C )</var>
</div>
<div class="problems">
<div>
<p class="question">Solve for <code>x</code>:</p>
<div><code><var>A</var>x + <var>B</var> = <var>C</var>x + <var>D</var></code></div>
<div class="solution" data-type="multiple">
<p><code>x =</code> <span class="sol"><var>( D - B ) / ( A - C )</var></span></p>
</div>
</div>
</div>
<div class="hints">
<div data-if="A > C" data-unwrap="">
<div>
<p>Subtract <code><var>C</var>x</code> from both sides:</p>
<p><code>(<var>A</var>x + <var>B</var>) - <var>C</var>x = (<var>C</var>x + <var>D</var>) - <var>C</var>x</code></p>
<p><code><var>A - C</var>x + <var>B</var> = <var>D</var></code></p>
</div>
<div>
<p data-if="B > 0">Subtract <code><var>abs(B)</var></code> from both sides:</p><p data-else="">Add <code><var>abs(B)</var></code> to both sides:</p>
<p><code>(<var>A - C</var>x + <var>B</var>) + <var>-B</var> = <var>D</var> + <var>-B</var></code></p>
<p><code><var>A - C</var>x = <var>D - B</var></code></p>
</div>
<div>
<p>Divide both sides by <code><var>A - C</var></code>.</p>
<p><code>\frac{<var>A - C</var>x}{<var>A - C</var>} = \frac{<var>D - B</var>}{<var>A - C</var>}</code></p>
</div>
<div>
<p>Simplify.</p>
<p><code>x = <var>SOLUTION</var></code></p>
</div>
</div>
<div data-else="" data-unwrap="">
<div>
<p>Subtract <code><var>A</var>x</code> from both sides:</p>
<p><code>(<var>A</var>x + <var>B</var>) - <var>A</var>x = (<var>C</var>x + <var>D</var>) - <var>A</var>x</code></p>
<p><code><var>B</var> = <var>C - A</var>x + <var>D</var></code></p>
</div>
<div>
<p data-if="D > 0">Subtract <code><var>abs(D)</var></code> from both sides:</p><p data-else="">Add <code><var>abs(D)</var></code> to both sides:</p>
<p><code><var>B</var> + <var>-D</var> = (<var>C - A</var>x + <var>D</var>) + <var>-D</var></code></p>
<p><code><var>B - D</var> = <var>C - A</var>x</code></p>
</div>
<div>
<p>Divide both sides by <code><var>C - A</var></code>.</p>
<p><code>\dfrac{<var>B - D</var>}{<var>C - A</var>} = \dfrac{<var>C - A</var>x}{<var>C - A</var>}</code></p>
</div>
<div>
<p>Simplify.</p>
<p><code><var>SOLUTION</var> = x</code></p>
</div>
</div>
</div>
</div>
</body>
</html>