cortex-js / compute-engine

An engine for symbolic manipulation and numeric evaluation of math formulas expressed with MathJSON
https://cortexjs.io
MIT License
356 stars 42 forks source link

Factoring before trying to simplify [FEATURE] #180

Open andrew-murdza opened 2 months ago

andrew-murdza commented 2 months ago

Is your feature request related to a problem? Please describe. \sqrt{(x+1)^2} simplifies but not \sqrt{x^2+2x+1} \frac{x}{x^2-x} doesn't simplify (also that might be just because \frac{x}{x(x-1)} doesn't simplify)

Describe the solution you'd like Expressions are factored in to try to simplify them. If the simplification fails, then don't factor them

Describe alternatives you've considered \sqrt{a^2+2ab+b^2}->|a+b| and \sqrt{a^2-2ab+b^2}->|a-b|

Additional context Add any other context or screenshots about the feature request here.