randRangeNonZero( -10, 10 ) randRangeNonZero( -10, 10 )
"" + (randRangeNonZero(-1, 1) * randRangeNonZero(2, 5)), randRange(0, 1) 1 SQUARE*A*B A*B SQUARE*(-A-B) -A-B simplify(parse(COMMON_CST + "*x^{" + COMMON_POWER + "}"), simplifyOptions.basic) format(COMMON_FACTOR) simplify(parse(SQUARE + "x^{2}+" + LINEAR + "x+" + CONSTANT), simplifyOptions.basic) {op:"*", args:[COMMON_FACTOR, POLY_NO_FACTOR]} [ parse("(x + a)(x + b)&=&xx &+& xb + ax &+& ab"), parse("&=& x^2 &+& #{(a+b)}x &+& #{ab}", [GREEN, BLUE]), simplify(parse("&=& x^2 &+& #{" + SIMPLELINEAR + "}x &+& #{" + SIMPLECONSTANT + "}", [GREEN, BLUE]), simplifyOptions.checkInput), ] simplify(POLY_AND_FACTOR, simplifyOptions.expand) simplify(QUESTION, simplifyOptions.factor) simplify(parse("" + COMMON_FACTOR_LATEX + "(x + " + (-A) + ")(x + " + (-B) + ")"), simplifyOptions.checkInput) simplify(parse("" + COMMON_FACTOR_LATEX + "(-x + " + A + ")(-x + " + B + ")"), simplifyOptions.checkInput) simplify(parse("-" + COMMON_FACTOR_LATEX + "(-x + " + A + ")(x + " + (-B) + ")"), simplifyOptions.checkInput) simplify(parse("-" + COMMON_FACTOR_LATEX + "(x + " + (-A) + ")(-x + " + B + ")"), simplifyOptions.checkInput)

Factor the following expression:

format(QUESTION)

$( "div.instruction input" ).val()
var exprGuess = simplify(parse(guess), simplifyOptions.checkInput); return (isEqual(exprGuess, SOL1) || isEqual(exprGuess, SOL2) || isEqual(exprGuess, SOL3) || isEqual(exprGuess, SOL4));
$( "div.instruction input" ).val( guess );
a factored expression, like (x+1)(x+3)

We first notice that all terms have a common factor. We can rewrite the expression as:

format(POLY_AND_FACTOR)

We can now focus on factoring the polynomial: format(POLY_NO_FACTOR)

When we factor a polynomial, we are basically reversing this process of multiplying linear expressions together:

\qquad formatGroup(GROUP1, [0, 1])

\qquad formatGroup(GROUP1, [2])

The coefficient on the x term is SIMPLELINEAR and the constant term is SIMPLECONSTANT, so to reverse the steps above, we need to find two numbers that add up to SIMPLELINEAR and multiply to SIMPLECONSTANT.

You can start by trying to guess which factors of SIMPLECONSTANT add up to SIMPLELINEAR. In other words, you need to find the values for a and b that meet the following conditions:

\qquad parseFormat("#a+#b=#{"+ SIMPLELINEAR + "}", [PINK, PINK, GREEN])

\qquad parseFormat("#a \\times #b = #{" + SIMPLECONSTANT + "}", [PINK, PINK, BLUE])

If you're stuck, try listing out every single factor of SIMPLECONSTANT and its opposite as a in these equations, and see if it gives a value for b that validates both conditions. For example, since Math.abs(A) is a factor of SIMPLECONSTANT, try substituting Math.abs(A) for a as well as -Math.abs(A).

The two numbers -A and -B satisfy both conditions:

\qquad parseFormat("#{" + (-A) + "}+#{" + (-B) + "}=#{" + SIMPLELINEAR + "}", [PINK, PINK, GREEN])

\qquad parseFormat("#{" + (-A) + "}\\times #{" + (-B) + "}=#{" + SIMPLECONSTANT + "}", [PINK, PINK, BLUE])

So we can factor the polynomial as: parseFormat("(x + #{" + (-A) + "})(x + #{" + (-B) + "})", [PINK, PINK], simplifyOptions.checkInput)

The fully factored expression is: format(SOLUTION)