Algorithm to determine two binary expression trees will give the same result based on associative and commutative properties of some operators
Note that if you just want to know if two equations without variables have the same result, then just evaluate them already.  But it's more tricky with variables:

I assume that you are basically just functionally rearranging lists (ie: like Python/JavaScript/Lisp code).  For associative binary operators, it's convenient to make them have n operands to avoid a re-association pattern matching mess.  A sum or product of one operand is a redundant parenthesis.  Because they happen to be commutative, have the sum and product objects consistently sort their operands if you want them to be efficiently comparable (ie: define a canonical form that everything should reduce to).

It is harder if variables are involved though.  The equals sign can be treated as just another binary operator to create new expressions, where you do things like:  a, (a=(b*2)), ((a=(b*2))+6), ((a+6)=(b*2)+6), ((a+6)=(2*b)+6).  At that point, you construct new expressions like:  equate(expr,expr), add(expr,expr), mul(expr, expr), ldistribute(expr,expr), rdistribute(expr,expr), commute(expr), etc.  

Some of the rules are obvious like distributing multiplication over addition, or additive or multiplicative cancellation; and usually go in one direction (like automatic differentiation).  But there will be other times where you will need to do a more clever search (like a chess engine), doing things like multiply an expression times 1, and equate it with a new variable divided by itself, etc.  One of the more tricky things in an algorithm for solving is that some operations like division add new logical constraints.  If you construct  div(add(a,b),x), you implicitly construct a logical constraint for x!=0; and you need to work these constraints in so that the search for the solution doesn't generate nonsense.

These kinds of programs are usually written as pattern matching and rewriting, with provisions made to not go in infinite loops.