Using a computer algebra system to optimize mathematical expressions
This doesn't completely answer your question, but you ask if research has been done on this.

This is an area called Symbolic Algebra. I'm sure there are many such research groups, but here is one:

https://www.scg.uwaterloo.ca/

They're the group at Waterloo which developed the Maple software (similar to Mathematica).