A monomial is an algebraic expression consisting of a single term, like $2x$ or $3x^2$. A polynomial contains two or more terms added or subtracted together.
According to the distributive property:
$$a(b + c) = ab + ac$$
When we multiply a polynomial by a monomial, such as $2x(x^2 - 3x + 4)$, the monomial is distributed to each term individually:
$$2x \cdot x^2 - 2x \cdot 3x + 2x \cdot 4 = 2x^3 - 6x^2 + 8x$$
The algebra("...") function performs this expansion in a fraction of a second.
algebra("2*x * (x^2 - 3*x + 4)")print(#)
Move the mouse over a dotted box for more information.
Always use the multiplication sign * between numbers and variables in the expression string.
Now you try.
Try multiplying 3*x^2 * (2*x^3 - 5*x + 1) and print the result.
Type your code here:
See your results here:
The algebra() function distributes the monomial 2*x into each term inside the parentheses.
Share your code
Show a friend, family member, or teacher what you've done!