Machine mathematical reasoning by clever substitutions, How to do with AI
What you're asking here is actually not reasoning but rather symbolic computation.  Sympy is an example of a library which does it.
Explaining computer algebra systems could be a series of lectures and this is too broad for a single question. To give you an idea: (1) represent equations symbolically (2) bring them in a normal form (3) substitute.
Although it is not elegant, you can simplify the problem by brute Force: try all combinations of solving for a variable and substituting it in the other equations.
Related:

How do symbolic math software work? | Mathematics Stack Exchange