Khan/khan-exercises

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
150 lines (128 sloc) 8.09 KB
 Solving rational equations 1
randVar() rand(2) ? 1 : -1

Solve for X,

NUMERCONST < 1 ? randRange(1, 5) : randRange(0, 5)
randRange(2, 10) randRangeWeighted(1, 5, 1, 0.25) randRangeWeighted(-10, 10, 0, 0.25) randRange(-10, 10)
new RationalExpression([[NUMERCOEFF, X], [NUMERCONST]]) new RationalExpression([[DENOMCOEFF, X], [DENOMCONST]]) DENOMINATOR.multiply(CONSTANT) DENOMCONST * CONSTANT - SIGN * NUMERCONST SIGN * NUMERCOEFF - DENOMCOEFF * CONSTANT

- \dfrac{NUMERATOR}{DENOMINATOR} = CONSTANT

-(NUMERATOR) NUMERATOR = CONSTANT(DENOMINATOR)

-(NUMERATOR) = PRODUCT

NUMERATOR.multiply(SIGN) = PRODUCT

new RationalExpression([[FINALCOEFF, X], SIGN * NUMERCONST]) = DENOMCONST * CONSTANT

new Term(FINALCOEFF, X) = FINALCONST

SIGN * NUMERCONST = new RationalExpression([[-FINALCOEFF, X], DENOMCONST * CONSTANT])

-FINALCONST = new Term(-FINALCOEFF, X)

new Term(-FINALCOEFF, X) = -FINALCONST

X = fraction(FINALCONST, FINALCOEFF)

Simplify.

X = fractionReduce(FINALCONST, FINALCOEFF)

NUMERCONST < 1 ? randRange(1, 5) : randRange(0, 5)
randRange(2, 10) randRangeWeighted(1, 5, 1, 0.25) randRangeWeighted(-10, 10, 0, 0.25) randRange(-10, 10)
new RationalExpression([[NUMERCOEFF, X], [NUMERCONST]]) new RationalExpression([[DENOMCOEFF, X], [DENOMCONST]]) NUMERATOR.multiply(CONSTANT * SIGN) DENOMCONST - SIGN * NUMERCONST * CONSTANT SIGN * NUMERCOEFF * CONSTANT - DENOMCOEFF

- \dfrac{NUMERATOR}{DENOMINATOR} = \dfrac{1}{CONSTANT}

-(NUMERATOR) NUMERATOR.multiply(SIGN) = \dfrac{DENOMINATOR}{CONSTANT}

Multiply both sides of the equation by CONSTANT.

CONSTANT * SIGN(NUMERATOR) PRODUCT = DENOMINATOR

PRODUCT = DENOMINATOR

new RationalExpression([[FINALCOEFF, X], SIGN * NUMERCONST * CONSTANT]) = DENOMCONST

new Term(FINALCOEFF, X) = FINALCONST

SIGN * NUMERCONST * CONSTANT = new RationalExpression([[-FINALCOEFF, X], DENOMCONST])

-FINALCONST = new Term(-FINALCOEFF, X)

new Term(-FINALCOEFF, X) = -FINALCONST

X = fraction(FINALCONST, FINALCOEFF)

Simplify.

X = fractionReduce(FINALCONST, FINALCOEFF)

X = FINALCONST / FINALCOEFF

Multiply both sides of the equation by DENOMINATOR.