Where to look for these kind of problems ?
The computer science / mathematics field "symbolic computation" is a discipline (not a family of algorithms) that aims to find solutions and algorithms to solve these kind of problems.
More precisely, a category of software called "Computer algebra system (CAS)" deals with symbolic manipulation applied to algebra. To simplify, these kind of systems need a parser and their core is an engine for equation solving and equation rearranging.
(Very simplified) anatomy of a CAS
The parser will apply grammar rules in order to analyze the terms in an equation, and the grouping of terms using grammar rules
The engine implement very elaborated term rewriting systems, the kind of algorithms that applies a set of "simplification rules" or "rewriting rules", in order to reach a goal (e.g. all the x on one side, all the y on the other).
This article gives a quick introduction to this family of algorithms.
For example one rule could be
A + expression1 = expression2 ==> expression = expression2 - (A)
But there would be hundreds of rules like this.
In addition, a term rewriting system must have a guiding logic, to choose the most promising rewritings (e.g. rearrangement). You can imagine this as a kind of path-finding algorithm that looks for an optimal path in a graph of possible rewritings, a little bit like your GPS-system is looking for an optimized path in the streets. And in this logic, you need to add some strategies, that make the TRS prefer putting groups of symbols on one side or on the other of the equal sign.
It's not a piece of cake !
Needless to say, these a very complex systems. It's more the thing for a research lab. Fortunately there are some of them available, even some open source you could start with.