Machine mathematical reasoning by clever substitutions, How to do with AI I have three equations that relates five variables {a, b, c, r, s} with a sum and two ratios.


Eq. 1: a = b + c;
Eq. 2: s = b / a;
Eq. 3: r = b / c.


Given two values for any of the five variables I get a solution. But, this is not the automation problem I want to solve.

I can have the solution of variable r by simply knowing s. This is solved by a "human algorithm" as follows.


Substitute a of Eq. 1 in Eq. 2.
Divide the second term of the new Eq. 2 by the variable c.
Replace b/c by the expression of Eq. 3.


That means s = r / (r+1).

The questions is -How can an AI algorithm solve this?, i.e. the machine should recognize that given the variable r she can obtain directly the variable s and do no require another variable.
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