I'm working on a learning game, and I want to use Algebra.js to teach power rules (eg. (x^2)^3 becomes x^6).
The challenge I'm running into is that Algebra.js strips out brackets from the parsed expression, and then applies powers simply as repeated multiplication.
Example:
new algebra.Expression().add(algebra.parse("(x^2)"), false).pow(3, false).toString()
I'm working on a learning game, and I want to use Algebra.js to teach power rules (eg.
(x^2)^3
becomesx^6
).The challenge I'm running into is that Algebra.js strips out brackets from the parsed expression, and then applies powers simply as repeated multiplication.
Example:
new algebra.Expression().add(algebra.parse("(x^2)"), false).pow(3, false).toString()
Expected:
> "(x^2)^3 "
Actual:
> "x^2x^2x^2