randRange( 2, 10 ) randRangeNonZero( -10, 10 ) randRange( 2, 10 ) randRangeNonZero( 2, 10 ) fractionReduce( D - B, A - C )

Solve for x:

Ax + B = Cx + D

x = ( D - B ) / ( A - C )

Subtract Cx from both sides:

(Ax + B) - Cx = (Cx + D) - Cx

A - Cx + B = D

B > 0 ? "Subtract" : "Add" abs(B) B > 0 ? "from" : "to" both sides:

(A - Cx + B) + -B = D + -B

A - Cx = D - B

Divide both sides by A - C.

\frac{A - Cx}{A - C} = \frac{D - B}{A - C}

Simplify.

x = SOLUTION

Subtract Ax from both sides:

(Ax + B) - Ax = (Cx + D) - Ax

B = C - Ax + D

D > 0 ? "Subtract" : "Add" abs(D) D > 0 ? "from" : "to" both sides:

B + -D = (C - Ax + D) + -D

B - D = C - Ax

Divide both sides by C - A.

\dfrac{B - D}{C - A} = \dfrac{C - Ax}{C - A}

Simplify.

SOLUTION = x