randVar() randRangeNonZero(-10, 10) randRangeNonZero(-10, 10) randRangeNonZero(-10, 10) new RationalExpression([[1, X], A]) new RationalExpression([[1, X], B]) new RationalExpression([[1, X], C]) randRange(0, 1) ? new Term(randRangeExclude(-10, 10, [0, 1])) : new Term(randRangeWeightedExclude(-10, 10, 1, 0.3, [0]), X) randRange(0, 1) ? new Term(randRangeExclude(-10, 10, [0, 1])) : new Term(randRangeWeightedExclude(-10, 10, 1, 0.3, [0]), X) FACTOR.multiply(TERM1).multiply(TERM2) NUMERATOR.getTermsGCD() NUMERATOR.isNegative() ? NUM_FACTOR.multiply(-1) : NUM_FACTOR FACTOR.multiply(TERM3).multiply(TERM4) DENOMINATOR.getTermsGCD() DENOMINATOR.terms[0].isNegative() ? DEN_FACTOR.multiply(-1) : DEN_FACTOR (NUM_FACTOR.isNegative() + DEN_FACTOR.isNegative()) % 2 NUM_FACTORa.getGCD(DEN_FACTORa) NUM_FACTORa.divide(TERM_FACTOR) DEN_FACTORa.divide(TERM_FACTOR) TERM_FACTOR.variables[X] FACTOR_SIGN ? TERM1.multiply(NUM_FACTOR2).multiply(-1) : TERM1.multiply(NUM_FACTOR2) TERM3.multiply(DEN_FACTOR2)

Simplify the following expression and state the condition under which the simplification is valid.

`\dfrac{NUMERATOR}{DENOMINATOR}`

(NUMERATOR_SOL.toString())/(DENOMINATOR_SOL.toString())
(NUMERATOR_SOL.toStringFactored())/(DENOMINATOR_SOL.toString())
(NUMERATOR_SOL.toString())/(DENOMINATOR_SOL.toStringFactored())
(NUMERATOR_SOL.toStringFactored())/(DENOMINATOR_SOL.toStringFactored())
-A 0
`X \neq \space`
`X \neq \space`

First factor out the greatest common factors in the numerator and in the denominator.

`\qquad \dfrac {NUM_FACTOR(NUMERATOR.divide(NUM_FACTOR))} {DEN_FACTOR(DENOMINATOR.divide(DEN_FACTOR))}`

`\qquad - \dfrac{NUM_FACTORa}{DEN_FACTORa} \cdot \dfrac{NUMERATOR.divide(NUM_FACTOR)}{DENOMINATOR.divide(DEN_FACTOR)}`

Simplify:

`\qquad - \dfrac{NUM_FACTOR2}{DEN_FACTOR2} \cdot NUM_FACTOR2 \cdot \dfrac{NUMERATOR.divide(NUM_FACTOR)}{DENOMINATOR.divide(DEN_FACTOR)}`

Since we are dividing by `X`, we must remember that `X \neq 0`.

Next factor the numerator and denominator.

`\qquad - \dfrac{NUM_FACTOR2}{DEN_FACTOR2} \cdot NUM_FACTOR2 \cdot \dfrac{(FACTOR)(TERM1)}{(FACTOR)(TERM3)}`

Assuming `X \neq -A`, we can cancel the `FACTOR`.

`\qquad - \dfrac{NUM_FACTOR2}{DEN_FACTOR2} \cdot NUM_FACTOR2 \cdot \dfrac{TERM1}{TERM3}`

Therefore:

`\qquad \dfrac{ TERM1.multiply(-1) TERM1 -NUM_FACTOR2(TERM1)}{ TERM3 DEN_FACTOR2(TERM3)}`, `X \neq -A` , `X \neq 0`