Simplify the expression.
(POLYNOMIALS[0]) SIGNS[0]
(POLYNOMIALS[1]
POLYNOMIALS[1].multiply(-1))
SIGNS[1]
(POLYNOMIALS[2]
POLYNOMIALS[2].multiply(-1))
SOLUTION.parsableText()
Distribute any negative signs.
(POLYNOMIALS[0]) + (POLYNOMIALS[1]) + (POLYNOMIALS[2])
Since we are adding polynomials, we can simply remove the parentheses.
POLYNOMIALS[0] + POLYNOMIALS[1] + POLYNOMIALS[2]
Identify like terms.
(POL.coefs[index] < 0) ? "-" : (n === 0 && POL === POLYNOMIALS[0]) ? "" : "+"
\color{COLORS[ n ]}{abs(POL.coefs[index]) === 1 ? "" : abs(POL.coefs[index])
X^index}
Combine like terms.
+ \color{COLORS[index1]}{
coeff[0]
(
+
TERM
)
X^SORTED_INDICES[index1]}
Add the coefficients.
SOLUTION