Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

111 lines (94 sloc) 5.629 kB
<!DOCTYPE html>
<html data-require="math calculus polynomials expressions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chain rule 1</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="vars">
<var id="INNER">generateFunction("x")</var>
<var id="OUTER">new CalcFunctions[randRange(1, CalcFunctions.length - 1)](INNER.f)</var>
<var id="PRE_SIMPLIFICATION">
( ( OUTER.f[0] === '^' &amp;&amp; OUTER.f[1] === 'e' &amp;&amp; INNER.f[0] === 'ln' )
|| ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] === 'e' ) )
? 'x'
: null
</var>
<div data-ensure="expr(INNER_WRONG_1) !== expr(['-', INNER.ddxF]) || expr(OUTER_WRONG_1) !== expr(['-', OUTER.ddxF])">
<var id="INNER_WRONG_1">randFromArray( INNER.wrongs )</var>
<var id="OUTER_WRONG_1">randFromArray( OUTER.wrongs )</var>
</div>
<div data-ensure="expr(INNER_WRONG_2) !== expr(['-', INNER.ddxF]) || expr(OUTER_WRONG_2) !== expr(['-', OUTER.ddxF])">
<var id="INNER_WRONG_2">randFromArray( INNER.wrongs )</var>
<var id="OUTER_WRONG_2">randFromArray( OUTER.wrongs )</var>
</div>
<var id="UNSIMPLIFIED_DERIVATIVE">['*', OUTER.ddxF, INNER.ddxF]</var>
<var id="DERIVATIVE_SIMPLIFICATIONS">
( ( OUTER.f[0] === '^' &amp;&amp; OUTER.f[1] === 'e' &amp;&amp; INNER.f[0] === 'ln' )
|| ( OUTER.f[0] === 'ln' &amp;&amp; INNER.f[0] === '^' &amp;&amp; INNER.f[1] === 'e' ) )
? [['frac', 'x', 'x'], '1']
: []
</var>
<var id="DERIVATIVE">
DERIVATIVE_SIMPLIFICATIONS.length === 0
? expr(UNSIMPLIFIED_DERIVATIVE)
: expr(DERIVATIVE_SIMPLIFICATIONS[DERIVATIVE_SIMPLIFICATIONS.length - 1])
</var>
<var id="NOTATION">funcNotation("x")</var>
</div>
<div class="problems">
<div>
<p class="problem">Let <code><var>NOTATION.f</var> = <var>OUTER.fText</var></code></p>
<p class="question"><code><var>NOTATION.ddxF</var> = {?}</code></p>
<p class="solution"><code><var>DERIVATIVE</var></code></p>
<ul class="choices" data-none="true" data-show="5">
<li><code><var>
expr(["*", OUTER.ddxF, randFromArray(INNER.wrongs)])
</var></code></li>
<li><code><var>
expr(["*", randFromArray(OUTER.wrongs), INNER.ddxF])
</var></code></li>
<li><code><var>
expr(["*", OUTER_WRONG_1, INNER_WRONG_1])
</var></code></li>
<li><code><var>
expr(["*", OUTER_WRONG_2, INNER_WRONG_1])
</var></code></li>
<li><code><var>
expr(["+", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
</var></code></li>
<li><code><var>
expr(["+", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
</var></code></li>
<li><code><var>
expr(OUTER.ddxF)
</var></code></li>
<li><code><var>
expr(randFromArray(OUTER.wrongs))
</var></code></li>
<li><code><var>
expr(randFromArray(OUTER.wrongs))
</var></code></li>
<li><code>
1
</code></li>
</ul>
</div>
</div>
<div class="hints">
<p><code><var>NOTATION.ddxF</var> = (</code> derivative of <code><var>OUTER.fText</var></code> with respect to <code><var>INNER.fText</var>
) \cdot (</code> derivative of <code><var>INNER.fText</var></code> with respect to <code>x)</code></p>
<p>The derivative of <code><var>OUTER.fText</var></code> with respect to <code><var>INNER.fText</var></code> is <code><var>OUTER.ddxFText</var></code>.</p>
<p>The derivative of <code><var>INNER.fText</var></code> with respect to <code>x</code> is <code><var>INNER.ddxFText</var></code>.</p>
<p data-if="DERIVATIVE_SIMPLIFICATIONS.length !== 0">The derivative at this point is <code><var>expr(UNSIMPLIFIED_DERIVATIVE)</var></code>, but this expression can be simplified.</p>
<div data-if="DERIVATIVE_SIMPLIFICATIONS.length !== 0" data-each="DERIVATIVE_SIMPLIFICATIONS as i, newexpr">
<p><code><var>expr( i === 0 ? UNSIMPLIFIED_DERIVATIVE : DERIVATIVE_SIMPLIFICATIONS[i - 1] )</var></code> can be simplified to <code><var>expr(newexpr)</var></code>.</p>
</div>
<p>So <code><var>NOTATION.ddxF</var> = <var>DERIVATIVE</var></code>.</p>
<p data-if="PRE_SIMPLIFICATION !== null">Interestingly, if we simplify the function before we take the derivative, we can reach the answer more quickly: <code><var>OUTER.fText</var></code> simplifies to <code><var>expr(PRE_SIMPLIFICATION)</var></code>, and <code>\frac{d}{dx}(<var>expr(PRE_SIMPLIFICATION)</var>)</code> is <code><var>DERIVATIVE</var></code>.</p>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.