randFromArray([ 0, Infinity ]) { 0: "0", Infinity: "\\infty" }[ APPROACHES ] "\\frac" + { 0: "{0}{0}", Infinity: "{\\infty}{\\infty}" }[ APPROACHES ] KhanUtil.randRange( 2, 3 ) new KhanUtil.Polynomial( DEGREE - 1, DEGREE, KhanUtil.randCoefs( DEGREE - 1, DEGREE ), "x" ) new KhanUtil.Polynomial( DEGREE - 1, DEGREE, KhanUtil.randCoefs( DEGREE - 1, DEGREE ), "x" ) (function() { var steps = [[ NUMERATOR, DENOMINATOR ]]; var n = NUMERATOR, d = DENOMINATOR; // In an x approaches zero problem we only care when // minDegree is 0 (i.e. there is a plain number // in the denominator so we can evaluate the expression), // in an approaches infinity problem we want maxDegree to be // 0 as well while ( d.findMinDegree() !== 0 || ( APPROACHES === 0 ? false : d.findMaxDegree() !== 0 ) ) { n = KhanUtil.ddxPolynomial( n ); d = KhanUtil.ddxPolynomial( d ); steps.push([ n, d ]); } return steps; })() STEPS[ STEPS.length - 1 ][ 0 ] STEPS[ STEPS.length - 1 ][ 1 ] SLN_NUMERATOR_TEXT.evalOf( 0 ) SLN_DENOMINATOR_TEXT.evalOf( 0 ) reduces( SLN_NUMERATOR, SLN_DENOMINATOR ) || SLN_NUMERATOR < 0 || SLN_DENOMINATOR < 0 || abs( SLN_DENOMINATOR ) === 1

\displaystyle \lim_{x \to APPROACHES_TEXT} \frac{NUMERATOR}{DENOMINATOR} = {?}

SLN_NUMERATOR / SLN_DENOMINATOR

L'Hopital's rule states that since evaluating \displaystyle \lim_{x \to APPROACHES_TEXT} \frac{NUMERATOR}{DENOMINATOR} = INDETERMINATE_FORM,
if \displaystyle \lim_{x \to APPROACHES_TEXT} \frac{\frac{d}{dx} (NUMERATOR)}{\frac{d}{dx} (DENOMINATOR)} exists, evaluating it will give us the actual limit.

Repeat this process until evaluating the limit will not result in an indeterminate form:

Since evaluating the limit at this point still results in INDETERMINATE_FORM, we must apply L'Hopital's rule again:

 \displaystyle\frac{\frac{d}{dx} (STEP[0])}{\frac{d}{dx} (STEP[1])} = \frac{STEPS[N+1][0]}{STEPS[N+1][1]} 

Evaluate the limit:  \displaystyle \lim_{x \to APPROACHES_TEXT} \frac{SLN_NUMERATOR_TEXT.text()}{SLN_DENOMINATOR_TEXT.text()} = \frac{SLN_NUMERATOR_TEXT.text().replace("x", "(0)")}{SLN_DENOMINATOR_TEXT.text().replace("x", "(0)")} = \frac{SLN_NUMERATOR}{SLN_DENOMINATOR} = fractionReduce( SLN_NUMERATOR, SLN_DENOMINATOR )