# public Khan /khan-exercises

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Fetching contributors…

Cannot retrieve contributors at this time

file 111 lines (94 sloc) 5.629 kb
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110         Chain rule 1

generateFunction("x")            new CalcFunctions[randRange(1, CalcFunctions.length - 1)](INNER.f)                            ( ( OUTER.f[0] === '^' && OUTER.f[1] === 'e' && INNER.f[0] === 'ln' )                    || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] === 'e' ) )                    ? 'x'                    : null
randFromArray( INNER.wrongs )                randFromArray( OUTER.wrongs )

randFromArray( INNER.wrongs )                randFromArray( OUTER.wrongs )
['*', OUTER.ddxF, INNER.ddxF]                            ( ( OUTER.f[0] === '^' && OUTER.f[1] === 'e' && INNER.f[0] === 'ln' )                    || ( OUTER.f[0] === 'ln' && INNER.f[0] === '^' && INNER.f[1] === 'e' ) )                    ? [['frac', 'x', 'x'], '1']                    : []                                        DERIVATIVE_SIMPLIFICATIONS.length === 0                    ? expr(UNSIMPLIFIED_DERIVATIVE)                    : expr(DERIVATIVE_SIMPLIFICATIONS[DERIVATIVE_SIMPLIFICATIONS.length - 1])                        funcNotation("x")

Let NOTATION.f = OUTER.fText

NOTATION.ddxF = {?}

DERIVATIVE

•                         expr(["*", OUTER.ddxF, randFromArray(INNER.wrongs)])
•
•                         expr(["*", randFromArray(OUTER.wrongs), INNER.ddxF])
•
•                         expr(["*", OUTER_WRONG_1, INNER_WRONG_1])
•
•                         expr(["*", OUTER_WRONG_2, INNER_WRONG_1])
•
•                         expr(["+", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
•
•                         expr(["+", randFromArray(OUTER.wrongs), randFromArray(INNER.wrongs)])
•
•                         expr(OUTER.ddxF)
•
•                         expr(randFromArray(OUTER.wrongs))
•
•                         expr(randFromArray(OUTER.wrongs))
•
•                         1
•

NOTATION.ddxF = ( derivative of OUTER.fText with respect to INNER.fText            ) \cdot ( derivative of INNER.fText with respect to x)

The derivative of OUTER.fText with respect to INNER.fText is OUTER.ddxFText.

The derivative of INNER.fText with respect to x is INNER.ddxFText.

The derivative at this point is expr(UNSIMPLIFIED_DERIVATIVE), but this expression can be simplified.

expr( i === 0 ? UNSIMPLIFIED_DERIVATIVE : DERIVATIVE_SIMPLIFICATIONS[i - 1] ) can be simplified to expr(newexpr).

So NOTATION.ddxF = DERIVATIVE.

Interestingly, if we simplify the function before we take the derivative, we can reach the answer more quickly: OUTER.fText simplifies to expr(PRE_SIMPLIFICATION), and \frac{d}{dx}(expr(PRE_SIMPLIFICATION)) is DERIVATIVE.

Something went wrong with that request. Please try again.