I have a well-formed tree that represents a mathematical expression. For example, given the string: \"1+2-3*4/5\"
, this gets parsed into:
subtr
You're wanting to build a CAS (compute algebra system) and the topic is so wide that there is an entire field of study dedicated to it. Which means there are a few books that will probably answer your question better than SO.
I know some systems build trees that reduce constants first and then put the tree into a normalized form and then use a large database of proven/known formulas to transform the problem into some other form.