# Khan/khan-exercises

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (73 sloc) 4.17 KB
 Adding and subtracting rational expressions 1
randFromArray(["-", "+"]) randVar() randRangeWeighted(1, 8, 1, 0.25) randRangeWeighted(-12, 12, 0, 0.25) new RationalExpression([[DENOMCOEFF, X], DENOMCONST]) randRange(-12, 12) randRange(-8, 8) new RationalExpression([[NUMERCOEFF, X], NUMERCONST]) DENOMINATOR.getGCD(NUMERATORSUM)
randRangeWeighted(-8, 8, 1, 0.25) randRangeWeighted(-12, 12, 0, 0.25)
new RationalExpression([[COEFF1, X], CONST1]) SIGN === "+" ? new RationalExpression([[NUMERCOEFF - COEFF1, X], NUMERCONST - CONST1]) : new RationalExpression([[COEFF1 - NUMERCOEFF, X], CONST1 - NUMERCONST]) NUMERATORSUM.divide(FACTOR) DENOMINATOR.divide(FACTOR)

Simplify the following expression:

\dfrac{NUMERATOR1}{DENOMINATOR}SIGN \dfrac{NUMERATOR2}{DENOMINATOR}

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

Since the expressions have the same denominator we simply subtract the numerators:

\dfrac{NUMERATOR1 - (NUMERATOR2)}{DENOMINATOR}

Distribute the negative sign:

\dfrac{NUMERATOR1 + NUMERATOR2.multiply(-1)}{DENOMINATOR}

Since the expressions have the same denominator we simply combine the numerators:

\dfrac{NUMERATOR1 + NUMERATOR2}{DENOMINATOR}

Combine like terms:

\dfrac{NUMERATORSUM}{DENOMINATOR}

Simplify by dividing numerator and denominator by FACTOR:

\dfrac{NUMERSOL}{DENOMSOL}