# Khan/khan-exercises

Fetching contributors…
Cannot retrieve contributors at this time
138 lines (125 sloc) 6.34 KB
 Simplifying rational expressions 2
randVar()
randRangeWeighted(-10, 10, 0, 0.15) randRangeWeighted(-10, 10, 0, 0.15)
randRangeWeighted(-10, 10, 0, 0.15) (function() { if (getGCD(COEFFICIENT1, CONSTANT1) !== 1 && getGCD(COEFFICIENT2, CONSTANT1) !== 1) { // Ensure there are no common factors return randFromArray([-13, -11, -1, 1, 11, 13]); } else { if (COEFFICIENT2 !== 0) { return randRangeWeighted(-10, 10, 0, 0.15); } else { return randRangeExclude(-10, 10, [0]); } } })() randRange(2, 12) randRangeWeighted(0, 2, 0, 0.5) (function() { var d = {}; d[X] = DEGREE; return new Term(FACTOR, d); })() new RationalExpression([[COEFFICIENT1, X], CONSTANT1]) new RationalExpression([[COEFFICIENT2, X], CONSTANT2]) NUMERSOL.multiply(FACTORDEGREE) DENOMSOL.multiply(FACTORDEGREE)

Simplify the following expression:

\dfrac{NUMERATOR}{DENOMINATOR}

You can assume X \neq 0.

(NUMERSOL.toString())/(DENOMSOL.toString())
(NUMERSOL.toString())/(DENOMSOL.toStringFactored())
(NUMERSOL.toStringFactored())/(DENOMSOL.toString())
(NUMERSOL.toStringFactored())/(DENOMSOL.toStringFactored())

Find the greatest common factor of the numerator and denominator.

The numerator can be factored:
NUMERATOR = getFactoredExpression(FACTOR, COEFFICIENT1, X, DEGREE, CONSTANT1)

The denominator can be factored:
DENOMINATOR = getFactoredExpression(FACTOR, COEFFICIENT2, X, DEGREE, CONSTANT2)

The greatest common factor of all the terms is FACTORDEGREE.

Factoring out FACTORDEGREE gives us: