Lesson goal: Introduction: combining exponents

Previous: Card Pickup Passes and Eulerian Numbers | Home | Next: Multiplying a polynomial by a monomial

When working with algebraic powers that have the same base, the rules of exponents tell us that: $$x^a \cdot x^b = x^{a+b}$$ For example, $x^2 \cdot x^3 = (x \cdot x) \cdot (x \cdot x \cdot x) = x^5$. Instead of multiplying things out by hand, the CodeByMath computer has a built-in symbolic algebra engine. The function algebra("...") simplifies and expands algebraic expressions, combining matching powers and like terms automatically.
algebra("x^2 * x^3")print(#)
Move the mouse over a dotted box for more information.

Notice that the argument to algebra() is passed inside quotation marks as a string.

Now you try. Try multiplying $(x^5) \cdot (x^7)$ and $(y^3) \cdot (y^4)$ using algebra().

Type your code here:


See your results here: