randRange(2, 9) random() < 0.2
randRangeExclude(-20, 20, [-1, 0, 1]) getGCD(A, B)
IS_IRREDUCIBLE ? plus(A + "x", B) : GCD + "(" + plus(A / GCD + "x", B / GCD) + ")" toSentenceTex(getFactors(abs(A)).concat(["x"])) toSentenceTex(getFactors(abs(B)))

Factor the expression below completely. All coefficients should be integers.

expr(["+", ["*", A, "x"], B])

SOLUTION

To factor a binomial, you should first find the greatest common factor of all the terms.

The factors of Ax are Ax_FACTORS.
The factors of B are B_FACTORS.

The greatest common factor of Ax and B is GCD.

Since the greatest common factor is 1, the expression is already in its most factored form.

Therefore the answer is the original expression, SOLUTION.

So we can factor out the GCD.

If we divide each of the terms in the original expression by GCD we get \dfrac{Ax}{GCD} = plus((A/GCD) + "x") and \dfrac{B}{GCD} = B/GCD.

So the factored expression is SOLUTION.