Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

MathePower provides an form. There you can input a formula (1st input field) and a variable to release (2nd input field) and it will output a simplified version of that formula.

I want to write a script which needs to do something similar.

So my question is:

  • Do you know about any simple algorithm which can do something like the script on MathePower? (I just want to simplify formulas based on the four basic arithmetical operations.)
  • Are there any example implementations in a programming language?

Thanks for your answer. (And please execuse my bad English.)

share|cite|improve this question

This is generally known as "computer algebra," and there are entire books and courses on the subject. There's no single magic bullet. Generally it relies on things like specifying canonical forms for certain types of expressions and massaging them. Playing with the form, it seems to know how to simplify a rational expression, but not for instance that $\sin^2 x + \cos^2 x = 1$.

share|cite|improve this answer
Thanks for your answer. --- Yeah, I know that there's a lot of stuff out there. - But I don't need to handle any of the complicated cases. I just want to simplify formulas based on some variables, numbers and the operators of the four basic arithmetical operations --- I don't need to do more than this script can do. So: Do you know about an simple algorithm (that's just all I need)? – fridojet Nov 3 '12 at 22:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.