Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

749 lines (681 sloc) 44.348 kb
<!DOCTYPE html>
<html data-require="math math-format expressions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Multistep equations with distribution</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="X">randVar()</var>
<var id="DENOMS">[2, 3, 4, 5]</var>
<var id="ORDER">rand(2)</var>
<var id="SOL_NUM">randRangeNonZero(-8, 8)</var>
<var id="SOL_DEN">randRangeNonZero(-8, 8)</var>
<var id="SOLUTION">SOL_NUM / SOL_DEN</var>
</div>
<div class="problems">
<div id="fractions-1"> <!-- A = Bx + C(Dx + E) -->
<div class="vars" data-ensure="B !== 0">
<var id="C">randRangeWeightedExclude(-4, 4, -1, 0.4, [0, 1])</var>
<var id="D">randRangeNonZero(-10, 10)</var>
<var id="E">randRangeNonZero(-4, 4)</var>
<var id="C_DENOM, D_DENOM, E_DENOM">rand(2) ?
[randFromArray(DENOMS), 1, 1]:
[1, randFromArray(DENOMS), randFromArray(DENOMS)]
</var>
<var id="A_DENOM">C_DENOM * E_DENOM</var>
<var id="B_DENOM">C_DENOM * D_DENOM</var>
<var id="A">A_DENOM * SOL_NUM + C * E</var>
<var id="B">B_DENOM * SOL_DEN - C * D</var>
<var id="A_GCD">getGCD(A, A_DENOM)</var>
<var id="B_GCD">getGCD(B, B_DENOM)</var>
<var id="D_GCD">getGCD(C * D, B_DENOM)</var>
<var id="E_GCD">getGCD(C * E, A_DENOM)</var>
<var id="A1">fractionReduce(A, A_DENOM)</var>
<var id="B1">fractionVariable(B, B_DENOM, X)</var>
<var id="C1">fractionReduce(C, C_DENOM)</var>
<var id="D1">fractionVariable(D, D_DENOM, X)</var>
<var id="E1">fractionReduce(E, E_DENOM)</var>
<var id="CD">fractionVariable(C * D, B_DENOM, X)</var>
<var id="CE">fractionReduce(C * E, A_DENOM)</var>
<var id="BD">fractionReduce(B + C * D, B_DENOM)</var>
<var id="AE">fractionReduce(A - C * E, A_DENOM)</var>
</div>
<p class="question">Solve for <code><var>X</var></code>:</p>
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A1</var> = <var>B1</var> + <var>coefficient(C1)</var>\left(<var>D1</var> + <var>E1</var>\right)
</span><span data-else="">
<var>B1</var> + <var>coefficient(C1)</var>\left(<var>E1</var> + <var>D1</var>\right) = <var>A1</var>
</span>
</code></p>
<div class="solution" data-type="multiple">
<p><code><var>X</var> = </code> <span class="sol" data-simplify="optional"><var>SOLUTION</var></span></p>
</div>
<div class="hints">
<div data-if="C / C_DENOM !== 1">
<p data-if="C / C_DENOM === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>fractionReduce(C, C_DENOM)</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> &amp;=&amp; <var>B1</var> + \pink{<var>C1</var>} \blue{\left(<var>D1</var> + <var>E1</var>\right)} \\ \\
<var>A1</var> &amp;=&amp; <var>B1</var> +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} \\ \\
<var>A1</var> &amp;=&amp; <var>B1</var> + <var>CD</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>B1</var> + \pink{<var>C1</var>} \blue{\left(<var>E1</var> + <var>D1</var>\right)} &amp;=&amp; <var>A1</var> \\ \\
<var>B1</var> +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} &amp;=&amp; <var>A1</var> \\ \\
<var>B1</var> + <var>CE</var> + <var>CD</var> &amp;=&amp; <var>A1</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p>Combine the <span class="hint_blue"><code><var>X</var></code> terms</span>:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> &amp;=&amp; \blue{<var>B1</var> + <var>CD</var>} + <var>CE</var> \\ \\
<span data-if="B_DENOM / D_GCD !== 1">
<var>A1</var> &amp;=&amp;
\blue{\dfrac{<var>coefficient(B / B_GCD)</var><var>X</var> + <var>coefficient((C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>}} + <var>CE</var> \\ \\
<var>A1</var> &amp;=&amp;
\blue{\dfrac{<var>coefficient((B / B_GCD) + (C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>}} + <var>CE</var> \\ \\
</span>
<var>A1</var> &amp;=&amp; \blue{<var>coefficient(BD)</var><var>X</var>} + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\blue{<var>B1</var>} + <var>CE</var> + \blue{<var>CD</var>} &amp;=&amp; <var>A1</var> \\ \\
<span data-if="B_DENOM / D_GCD !== 1">
\blue{\dfrac{<var>coefficient(B / B_GCD)</var><var>X</var> + <var>coefficient((C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>}} + <var>CE</var> &amp;=&amp; <var>A1</var> \\ \\
\blue{\dfrac{<var>coefficient((B / B_GCD) + (C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>}} + <var>CE</var> &amp;=&amp; <var>A1</var> \\ \\
</span>
\blue{<var>coefficient(BD)</var><var>X</var>} + <var>CE</var> &amp;=&amp; <var>A1</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">
Add <code>\purple{<var>fractionReduce(-C * E, A_DENOM)</var>}</code> to both sides:
</p><p data-else="">
Subtract <code>\purple{<var>CE</var>}</code> from both sides:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> + \purple{<var>fractionReduce(-C * E, A_DENOM)</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
<span data-if="A_DENOM / E_GCD !== 1">
\dfrac{<var>A / A_GCD</var> + \purple{<var>(-C * E) / E_GCD</var>}}
{<var>A_DENOM / E_GCD</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
\dfrac{<var>(A - C * E) / E_GCD</var>}{<var>A_DENOM / E_GCD</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
</span>
<var>AE</var> &amp;=&amp; <var>coefficient(BD)</var><var>X</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; <var>A1</var> + \purple{<var>fractionReduce(-C * E, A_DENOM)</var>} \\ \\
<span data-if="A_DENOM / E_GCD !== 1">
<var>coefficient(BD)</var><var>X</var> &amp;=&amp;
\dfrac{<var>A / A_GCD</var> + \purple{<var>(-C * E) / E_GCD</var>}}{<var>A_DENOM / E_GCD</var>} \\ \\
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; \dfrac{<var>(A - C * E) / E_GCD</var>}{<var>A_DENOM / E_GCD</var>} \\ \\
</span>
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; <var>AE</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="BD !== '1'">
<p>Divide both sides by <code>\green{<var>BD</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>AE</var>}{\green{<var>BD</var>}} =
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}} =
\dfrac{<var>AE</var>}{\green{<var>BD</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
<div id="fractions-2" data-type="fractions-1"> <!-- A - Bx = C(Dx + E) -->
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A1</var> - <var>B1</var> = <var>coefficient(C1)</var>\left(<var>D1</var> + <var>E1</var>\right)
</span><span data-else="">
<var>coefficient(C1)</var>\left(<var>E1</var> + <var>D1</var>\right) = <var>A1</var> - <var>B1</var>
</span>
</code></p>
<div class="hints">
<div data-if="C / C_DENOM !== 1">
<p data-if="C / C_DENOM === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>fractionReduce(C, C_DENOM)</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> - <var>B1</var> &amp;=&amp; \pink{<var>C1</var>} \blue{\left(<var>D1</var> + <var>E1</var>\right)} \\ \\
<var>A1</var> - <var>B1</var> &amp;=&amp;
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} \\ \\
<var>A1</var> - <var>B1</var> &amp;=&amp; <var>CD</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\pink{<var>C1</var>} \blue{\left(<var>E1</var> + <var>D1</var>\right)} &amp;=&amp; <var>A1</var> - <var>B1</var> \\ \\
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} &amp;=&amp; <var>A1</var> - <var>B1</var> \\ \\
<var>CE</var> + <var>CD</var> &amp;=&amp; <var>A1</var> - <var>B1</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="B > 0">Add <code>\blue{<var>B1</var>}</code> to both sides:</p>
<p data-else="">Subtract <code>\blue{<var>fractionVariable(-B, B_DENOM, X)</var>}</code> from both sides:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> &amp;=&amp; \blue{<var>B1</var>} + <var>CD</var> + <var>CE</var> \\ \\
<span data-if="B_DENOM / D_GCD !== 1">
<var>A1</var> &amp;=&amp;
\dfrac{\blue{<var>coefficient(B / B_GCD)</var><var>X</var>} + <var>coefficient((C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>} + <var>CE</var> \\ \\
<var>A1</var> &amp;=&amp;
\dfrac{<var>coefficient((B / B_GCD) + (C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>} + <var>CE</var> \\ \\
</span>
<var>A1</var> &amp;=&amp; <var>coefficient(BD)</var><var>X</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\blue{<var>B1</var>} + <var>CE</var> + <var>CD</var> &amp;=&amp; <var>A1</var> \\ \\
<span data-if="B_DENOM / D_GCD !== 1">
\dfrac{\blue{<var>coefficient(B / B_GCD)</var><var>X</var>} + <var>coefficient((C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>} + <var>CE</var> &amp;=&amp; <var>A1</var> \\ \\
\dfrac{<var>coefficient((B / B_GCD) + (C * D) / D_GCD)</var><var>X</var>}
{<var>B_DENOM / D_GCD</var>} + <var>CE</var> &amp;=&amp; <var>A1</var> \\ \\
</span>
\blue{<var>coefficient(BD)</var><var>X</var>} + <var>CE</var> &amp;=&amp; <var>A1</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">
Add <code>\purple{<var>fractionReduce(-C * E, A_DENOM)</var>}</code> to both sides:
</p><p data-else="">
Subtract <code>\purple{<var>CE</var>}</code> from both sides:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> + \purple{<var>fractionReduce(-C * E, A_DENOM)</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
<span data-if="A_DENOM / E_GCD !== 1">
\dfrac{<var>A / A_GCD</var> + \purple{<var>(-C * E) / E_GCD</var>}}
{<var>A_DENOM / E_GCD</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
\dfrac{<var>(A - C * E) / E_GCD</var>}{<var>A_DENOM / E_GCD</var>} &amp;=&amp; <var>coefficient(BD)</var><var>X</var> \\ \\
</span>
<var>AE</var> &amp;=&amp; <var>coefficient(BD)</var><var>X</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; <var>A1</var> + \purple{<var>fractionReduce(-C * E, A_DENOM)</var>} \\ \\
<span data-if="A_DENOM / E_GCD !== 1">
<var>coefficient(BD)</var><var>X</var> &amp;=&amp;
\dfrac{<var>A / A_GCD</var> + \purple{<var>(-C * E) / E_GCD</var>}}{<var>A_DENOM / E_GCD</var>} \\ \\
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; \dfrac{<var>(A - C * E) / E_GCD</var>}{<var>A_DENOM / E_GCD</var>} \\ \\
</span>
<var>coefficient(BD)</var><var>X</var> &amp;=&amp; <var>AE</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="BD !== '1'">
<p>Divide both sides by <code>\green{<var>BD</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>AE</var>}{\green{<var>BD</var>}} =
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}} =
\dfrac{<var>AE</var>}{\green{<var>BD</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
<div id="decimal-1"> <!-- A = Bx + C(Dx + E) -->
<div class="vars" data-ensure="B !== 0 && A !== 0">
<var id="C_DENOM, D_DENOM, E_DENOM">rand(2) ?
[rand(3) ? 1 : 10, 1, 1]:
[1, rand(2) ? 1 : 10, rand(2) ? 1 : 10]
</var>
<var id="C">randRangeWeightedExclude(-4 * C_DENOM, 4 * C_DENOM, -1 * C_DENOM, 0.4, [0, 1]) / C_DENOM</var>
<var id="D">randRangeNonZero(-10 * D_DENOM, 10 * D_DENOM) / D_DENOM</var>
<var id="E">randRangeNonZero(-4 * E_DENOM, 4 * E_DENOM) / E_DENOM</var>
<var id="MULTIPLE">randFromArray([0.1, 0.2, 0.5, 1, 2, 3, 4])</var>
<var id="A">roundTo(2, MULTIPLE * SOL_NUM + C * E)</var>
<var id="B">roundTo(2, MULTIPLE * SOL_DEN - C * D)</var>
<var id="BX">coefficient(B) + X</var>
<var id="DX">coefficient(D) + X</var>
<var id="CC">coefficient(C)</var>
<var id="CE">roundTo(2, C * E)</var>
<var id="CDX">coefficient(roundTo(2, C * D)) + X</var>
<var id="BD">roundTo(2, B + C * D)</var>
<var id="BDX">coefficient(BD) + X</var>
</div>
<p class="question">Solve for <code><var>X</var></code>:</p>
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A</var> = <var>BX</var> + <var>CC</var>(<var>DX</var> + <var>E</var>)
</span><span data-else="">
<var>BX</var> + <var>CC</var>(<var>E</var> + <var>DX</var>) = <var>A</var>
</span>
</code></p>
<div class="solution" data-type="multiple">
<p><code><var>X</var> = </code> <span class="sol" data-simplify="optional"><var>SOLUTION</var></span></p>
</div>
<div class="hints">
<div>
<p data-if="C === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>C</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> &amp;=&amp; <var>BX</var> + \pink{<var>C</var>}\blue{(<var>DX</var> + <var>E</var>)} \\ \\
<var>A</var> &amp;=&amp; <var>BX</var> + \pink{(<var>C</var>)}\blue{(<var>DX</var>)} +
\pink{(<var>C</var>)}\blue{(<var>E</var>)} \\ \\
<var>A</var> &amp;=&amp; <var>BX</var> + <var>CDX</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>BX</var> + \pink{<var>C</var>} \blue{(<var>E</var> + <var>DX</var>)} &amp;=&amp; <var>A</var> \\ \\
<var>BX</var> + \pink{(<var>C</var>)}\blue{(<var>E</var>)} + \pink{(<var>C</var>)}\blue{(<var>DX</var>)}
&amp;=&amp; <var>A</var> \\ \\
<var>BX</var> + <var>CE</var> + <var>CDX</var> &amp;=&amp; <var>A</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p>Combine the <span class="hint_blue"><code><var>X</var></code> terms</span>:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> &amp;=&amp; \blue{<var>BX</var> + <var>CDX</var>} + <var>CE</var> \\ \\
<var>A</var> &amp;=&amp; \blue{<var>BDX</var>} + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\blue{<var>BX</var>} + <var>CE</var> + \blue{<var>CDX</var>} &amp;=&amp; <var>A</var> \\ \\
\blue{<var>BDX</var>} + <var>CE</var> &amp;=&amp; <var>A</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">
Add <code>\purple{<var>roundTo(2, -C * E)</var>}</code> to both sides:
</p><p data-else="">
Subtract <code>\purple{<var>CE</var>}</code> from both sides:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> + \purple{<var>roundTo(2, -C * E)</var>} &amp;=&amp; <var>BDX</var> \\ \\
<var>roundTo(4, SOL_NUM * MULTIPLE)</var> &amp;=&amp; <var>BDX</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>BDX</var> &amp;=&amp; <var>A</var> + \purple{<var>roundTo(2, -C * E)</var>} \\ \\
<var>BDX</var> &amp;=&amp; <var>roundTo(4, SOL_NUM * MULTIPLE)</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="BD !== 1">
<p>Divide both sides by <code>\green{<var>BD</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BD</var>}} =
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}} =
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BD</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
<div id="decimal-2" data-type="decimal-1"> <!-- A - Bx = C(Dx + E) -->
<p class="question">Solve for <code><var>X</var></code>:</p>
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A</var> - <var>BX</var> = <var>CC</var>(<var>DX</var> + <var>E</var>)
</span><span data-else="">
<var>CC</var>(<var>E</var> + <var>DX</var>) = <var>A</var> - <var>BX</var>
</span>
</code></p>
<div class="hints">
<div>
<p data-if="C === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>C</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> - <var>BX</var> &amp;=&amp; \pink{<var>C</var>}\blue{(<var>DX</var> + <var>E</var>)} \\ \\
<var>A</var> - <var>BX</var> &amp;=&amp; \pink{(<var>C</var>)}\blue{(<var>DX</var>)} +
\pink{(<var>C</var>)}\blue{(<var>E</var>)} \\ \\
<var>A</var> - <var>BX</var> &amp;=&amp; <var>CDX</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\pink{<var>C</var>} \blue{(<var>E</var> + <var>DX</var>)} &amp;=&amp; <var>A</var> \\ \\
\pink{(<var>C</var>)}\blue{(<var>E</var>)} + \pink{(<var>C</var>)}\blue{(<var>DX</var>)} &amp;=&amp;
<var>A</var> - <var>BX</var> \\ \\
<var>CE</var> + <var>CDX</var> &amp;=&amp; <var>A</var> - <var>BX</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="B > 0">Add <code>\purple{<var>BX</var>}</code> to both sides:</p>
<p data-else="">Subtract <code>\purple{<var>coefficient(-B) + X</var>}</code> from both sides:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> &amp;=&amp; <var>CDX</var> + <var>CE</var> + \purple{<var>BX</var>} \\ \\
<var>A</var> &amp;=&amp; <var>BDX</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>CE</var> + <var>CDX</var> + \purple{<var>BX</var>} &amp;=&amp; <var>A</var>\\ \\
<var>CE</var> + <var>BDX</var> &amp;=&amp; <var>A</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">
Add <code>\purple{<var>roundTo(2, -C * E)</var>}</code> to both sides:
</p><p data-else="">
Subtract <code>\purple{<var>CE</var>}</code> from both sides:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> + \purple{<var>roundTo(2, -C * E)</var>} &amp;=&amp; <var>BDX</var> \\ \\
<var>roundTo(4, SOL_NUM * MULTIPLE)</var> &amp;=&amp; <var>BDX</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>BDX</var> &amp;=&amp; <var>A</var> + \purple{<var>roundTo(2, -C * E)</var>} \\ \\
<var>BDX</var> &amp;=&amp; <var>roundTo(4, SOL_NUM * MULTIPLE)</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="BD !== 1">
<p>Divide both sides by <code>\green{<var>BD</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BD</var>}} =
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>BD</var>}}<var>X</var>}{\green{\cancel{<var>BD</var>}}} =
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BD</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
<div id="fractions-3"> <!-- A + Bx = Fx + C(Dx + E) -->
<div class="vars" data-ensure="B !== 0">
<var id="C">randRangeWeightedExclude(-4, 4, -1, 0.4, [0, 1])</var>
<var id="D">randRangeNonZero(-10, 10)</var>
<var id="E">randRangeNonZero(-4, 4)</var>
<var id="F">randRangeNonZero(-8, 8)</var>
<var id="C_DENOM, D_DENOM, E_DENOM">rand(2) ?
[randFromArray(DENOMS), 1, 1]:
[1, randFromArray(DENOMS), randFromArray(DENOMS)]
</var>
<var id="A_DENOM">C_DENOM * E_DENOM</var>
<var id="B_DENOM">C_DENOM * D_DENOM</var>
<var id="A">A_DENOM * SOL_NUM + C * E</var>
<var id="B">B_DENOM * SOL_DEN - C * D - F</var>
<var id="A_GCD">getGCD(A, A_DENOM)</var>
<var id="B_GCD">getGCD(B, B_DENOM)</var>
<var id="D_GCD">getGCD(C * D, B_DENOM)</var>
<var id="E_GCD">getGCD(C * E, A_DENOM)</var>
<var id="COMMON_DENOM">getLCM(
A_DENOM / A_GCD,
B_DENOM / B_GCD,
B_DENOM / D_GCD,
A_DENOM / E_GCD
)</var>
<var id="A1">fractionReduce(A, A_DENOM)</var>
<var id="B1">fractionVariable(B, B_DENOM, X)</var>
<var id="C1">fractionReduce(C, C_DENOM)</var>
<var id="D1">fractionVariable(D, D_DENOM, X)</var>
<var id="E1">fractionReduce(E, E_DENOM)</var>
<var id="F1">fractionVariable(F, B_DENOM, X)</var>
<var id="CD">fractionVariable(C * D, B_DENOM, X)</var>
<var id="CE">fractionReduce(C * E, A_DENOM)</var>
<var id="A2">A * COMMON_DENOM / A_DENOM</var>
<var id="B2">coefficient(B * COMMON_DENOM / B_DENOM) + X</var>
<var id="CD2">coefficient(C * D * COMMON_DENOM / B_DENOM) + X</var>
<var id="CE2">C * E * COMMON_DENOM / A_DENOM</var>
<var id="F2">coefficient(F * COMMON_DENOM / B_DENOM) + X</var>
<var id="AE">(A - C * E) * COMMON_DENOM / A_DENOM</var>
<var id="FBD">(B + C * D + F) * COMMON_DENOM / B_DENOM</var>
<var id="FBDX">coefficient(FBD) + X</var>
</div>
<p class="question">Solve for <code><var>X</var></code>:</p>
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A1</var> - <var>B1</var> = <var>F1</var> + <var>coefficient(C1)</var>\left(<var>D1</var> + <var>E1</var>\right)
</span><span data-else="">
<var>F1</var> + <var>coefficient(C1)</var>\left(<var>E1</var> + <var>D1</var>\right) = <var>A1</var> - <var>B1</var>
</span>
</code></p>
<div class="solution" data-type="multiple">
<p><code><var>X</var> = </code> <span class="sol" data-simplify="optional"><var>SOLUTION</var></span></p>
</div>
<div class="hints">
<div>
<p data-if="C / C_DENOM === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>fractionReduce(C, C_DENOM)</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A1</var> - <var>B1</var> &amp;=&amp;
<var>F1</var> + \pink{<var>C1</var>} \blue{\left(<var>D1</var> + <var>E1</var>\right)} \\ \\
<var>A1</var> - <var>B1</var> &amp;=&amp;
<var>F1</var> +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} \\ \\
<var>A1</var> - <var>B1</var> &amp;=&amp;
<var>F1</var> + <var>fractionVariable(C * D, B_DENOM, X)</var> + <var>fractionReduce(C * E, A_DENOM)</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>F1</var> + \pink{<var>C1</var>} \blue{\left(<var>E1</var> + <var>D1</var>\right)} &amp;=&amp;
<var>A1</var> - <var>B1</var> \\ \\
<var>F1</var> +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>E1</var>\right)} +
\pink{\left(<var>C1</var>\right)}\blue{\left(<var>D1</var>\right)} &amp;=&amp;
<var>A1</var> - <var>B1</var> \\ \\
<var>F1</var> + <var>fractionReduce(C * E, A_DENOM)</var> + <var>fractionVariable(C * D, B_DENOM, X)</var> &amp;=&amp;
<var>A1</var> - <var>B1</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="COMMON_DENOM !==1">
<p>Multiply each term by a common denominator of <code><var>COMMON_DENOM</var></code></p>
<p data-if="ORDER">
<code>\qquad <var>A2</var> - <var>B2</var> = <var>F2</var> + <var>CD2</var> + <var>CE2</var></code>
</p><p data-else="">
<code>\qquad <var>F2</var> + <var>CE2</var> + <var>CD2</var> = <var>A2</var> - <var>B2</var></code>
</p>
</div>
<div>
<p data-if="B > 0">Add <code>\blue{<var>B2</var>}</code> to both sides:</p>
<p data-else="">Subtract <code>\blue{<var>fractionVariable(-B * COMMON_DENOM, B_DENOM, X)</var>}</code> from both sides:</p>
<p data-if="ORDER">
<code>\qquad <var>A2</var> = <var>F2</var> + <var>CD2</var> + <var>CE2</var> + \blue{<var>B2</var>}</code>
</p><p data-else="">
<code>\qquad <var>F2</var> + <var>CE2</var> + <var>CD2</var> + \blue{<var>B2</var>} = <var>A2</var></code>
</p>
</div>
<div>
<p>Combine the <span class="hint_blue"><code><var>X</var></code> terms</span>:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A2</var> &amp;=&amp; \blue{<var>F2</var> + <var>CD2</var>} + <var>CE2</var> + \blue{<var>B2</var>} \\ \\
<var>A2</var> &amp;=&amp; \blue{<var>FBDX</var>} + <var>CE2</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\blue{<var>F2</var>} + <var>CE2</var> + \blue{<var>CD2</var> + <var>B2</var>} &amp;=&amp; <var>A2</var> \\ \\
\blue{<var>FBDX</var>} + <var>CE2</var> &amp;=&amp; <var>A2</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">Add <code>\purple{<var>-CE2</var>}</code> to both sides:</p>
<p data-else="">Subtract <code>\purple{<var>CE2</var>}</code> from both sides:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A2</var> + \purple{<var>-CE2</var>} &amp;=&amp; <var>FBDX</var> \\ \\
<var>AE</var> &amp;=&amp; <var>FBDX</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>FBDX</var> &amp;=&amp; <var>A2</var> + \purple{<var>-CE2</var>} \\ \\
<var>FBDX</var> &amp;=&amp; <var>AE</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="FBD !== 1">
<p>Divide both sides by <code>\green{<var>FBD</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>AE</var>}{\green{<var>FBD</var>}} =
\dfrac{\green{\cancel{<var>FBD</var>}}<var>X</var>}{\green{\cancel{<var>FBD</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>FBD</var>}}<var>X</var>}{\green{\cancel{<var>FBD</var>}}} =
\dfrac{<var>AE</var>}{\green{<var>FBD</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
<div id="decimal-3"> <!-- A + Bx = Fx + C(Dx + E) -->
<div class="vars" data-ensure="B !== 0 && A !== 0">
<var id="C_DENOM, D_DENOM, E_DENOM">rand(2) ?
[rand(3) ? 1 : 10, 1, 1]:
[1, rand(2) ? 1 : 10, rand(2) ? 1 : 10]
</var>
<var id="C">randRangeWeightedExclude(-4 * C_DENOM, 4 * C_DENOM, -1 * C_DENOM, 0.4, [0, 1]) / C_DENOM</var>
<var id="D">randRangeNonZero(-10 * D_DENOM, 10 * D_DENOM) / D_DENOM</var>
<var id="E">randRangeNonZero(-4 * E_DENOM, 4 * E_DENOM) / E_DENOM</var>
<var id="F_DENOM">rand(2) ? 1 : 10</var>
<var id="F">randRangeNonZero(-8 * F_DENOM, 8 * F_DENOM) / F_DENOM</var>
<var id="MULTIPLE">randFromArray([0.1, 0.2, 0.5, 1, 2, 3, 4])</var>
<var id="A">roundTo(2, MULTIPLE * SOL_NUM + C * E)</var>
<var id="B">roundTo(2, MULTIPLE * SOL_DEN - C * D - F)</var>
<var id="BX">coefficient(B) + X</var>
<var id="DX">coefficient(D) + X</var>
<var id="FX">coefficient(F) + X</var>
<var id="CC">coefficient(C)</var>
<var id="CE">roundTo(2, C * E)</var>
<var id="CDX">coefficient(roundTo(2, C * D)) + X</var>
<var id="BDF">roundTo(2, B + F + C * D)</var>
<var id="BDFX">coefficient(BDF) + X</var>
</div>
<p class="question">Solve for <code><var>X</var></code>:</p>
<p class="problem"><code>\qquad
<span data-if="ORDER">
<var>A</var> - <var>BX</var> = <var>FX</var> + <var>CC</var>(<var>DX</var> + <var>E</var>)
</span><span data-else="">
<var>FX</var> + <var>CC</var>(<var>E</var> + <var>DX</var>) = <var>A</var> - <var>BX</var>
</span>
</code></p>
<div class="solution" data-type="multiple">
<p><code><var>X</var> = </code> <span class="sol" data-simplify="optional"><var>SOLUTION</var></span></p>
</div>
<div class="hints">
<div>
<p data-if="C === -1">
Distribute the negative in front of the parentheses. Be careful!
The negative sign in front of the parentheses means we're multiplying by <code>\pink{-1}</code>:
</p><p data-else="">
Distribute the <code>\pink{<var>C</var>}</code>:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> - <var>BX</var> &amp;=&amp; <var>FX</var> + \pink{<var>C</var>}\blue{(<var>DX</var> + <var>E</var>)} \\ \\
<var>A</var> - <var>BX</var> &amp;=&amp; <var>FX</var> + \pink{(<var>C</var>)}\blue{(<var>DX</var>)} +
\pink{(<var>C</var>)}\blue{(<var>E</var>)} \\ \\
<var>A</var> - <var>BX</var> &amp;=&amp; <var>FX</var> + <var>CDX</var> + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>FX</var> + \pink{<var>C</var>} \blue{(<var>E</var> + <var>DX</var>)} &amp;=&amp; <var>A</var> - <var>BX</var> \\ \\
<var>FX</var> + \pink{(<var>C</var>)}\blue{(<var>E</var>)} + \pink{(<var>C</var>)}\blue{(<var>DX</var>)}
&amp;=&amp; <var>A</var> - <var>BX</var> \\ \\
<var>FX</var> + <var>CE</var> + <var>CDX</var> &amp;=&amp; <var>A</var> - <var>BX</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="B > 0">Add <code>\blue{<var>BX</var>}</code> to both sides:</p>
<p data-else="">Subtract <code>\blue{<var>coefficient(-B) + X</var>}</code> from both sides:</p>
<p data-if="ORDER"><code>\qquad
<var>A</var> = <var>FX</var> + <var>CDX</var> + <var>CE</var> + \blue{<var>BX</var>}
</code></p>
<p data-else=""><code>\qquad
<var>FX</var> + <var>CE</var> + <var>CDX</var> + \blue{<var>BX</var>} = <var>A</var>
</code></p>
</div>
<div>
<p>Combine the <span class="hint_blue"><code><var>X</var></code> terms</span>:</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> &amp;=&amp; \blue{<var>FX</var> + <var>CDX</var>} + <var>CE</var> + \blue{<var>BX</var>} \\ \\
<var>A</var> &amp;=&amp; \blue{<var>BDFX</var>} + <var>CE</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
\blue{<var>FX</var>} + <var>CE</var> + \blue{<var>CDX</var> + <var>BX</var>} &amp;=&amp; <var>A</var> \\ \\
\blue{<var>BDFX</var>} + <var>CE</var> &amp;=&amp; <var>A</var>
\end{eqnarray}
</code></p>
</div>
<div>
<p data-if="C * E < 0">
Add <code>\purple{<var>-CE</var>}</code> to both sides:
</p><p data-else="">
Subtract <code>\purple{<var>CE</var>}</code> from both sides:
</p>
<p data-if="ORDER"><code>\qquad\begin{eqnarray}
<var>A</var> + \purple{<var>-CE</var>} &amp;=&amp; <var>BDFX</var> \\ \\
<var>roundTo(4, SOL_NUM * MULTIPLE)</var> &amp;=&amp; <var>BDFX</var>
\end{eqnarray}
</code></p>
<p data-else=""><code>\qquad\begin{eqnarray}
<var>BDFX</var> &amp;=&amp; <var>A</var> + \purple{<var>-CE</var>} \\ \\
<var>BDFX</var> &amp;=&amp; <var>roundTo(4, SOL_NUM * MULTIPLE)</var>
\end{eqnarray}
</code></p>
</div>
<div data-if="BDF !== 1">
<p>Divide both sides by <code>\green{<var>BDF</var>}</code> to isolate <code><var>X</var></code>:</p>
<p data-if="ORDER"><code>\qquad
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BDF</var>}} =
\dfrac{\green{\cancel{<var>BDF</var>}}<var>X</var>}{\green{\cancel{<var>BDF</var>}}}
</code></p>
<p data-else=""><code>\qquad
\dfrac{\green{\cancel{<var>BDF</var>}}<var>X</var>}{\green{\cancel{<var>BDF</var>}}} =
\dfrac{<var>roundTo(4, SOL_NUM * MULTIPLE)</var>}{\green{<var>BDF</var>}}
</code></p>
</div>
<p><code>\qquad <var>X</var> = <var>fractionReduce(SOL_NUM, SOL_DEN)</var></code></p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.