Ask Your Question

Revision history [back]

Your system is an algebraic system that could be solved with variable elimination. The first step consists in building the ideal of solutions.

sage: R.<a,b,c,d> = QQ[]
sage: F1 = c - (a*(a/(a+2*b))+2*b*(a/(a+b)))
sage: F2 = d - (a*(b/(a+2*b))+b*(b/(a+b)))
sage: I = R.ideal([F1.numerator(), F2.numerator()]).radical()
sage: I
Ideal (a*b + 2*b^2 - b*c - 2*b*d,
         a^2 - 4*b^2 - a*c + 2*b*c - 2*a*d + 4*b*d,
         2*b^3 - 2*b^2*c + b*c^2 - 4*b^2*d - a*c*d + 3*b*c*d - 2*a*d^2 + 2*b*d^2)
of Multivariate Polynomial Ring in a, b, c, d over Rational Field

Now, you want to know the expression of a in terms of b,d. To do so, just eliminate b

sage: Ib = I.elimination_ideal([b])
sage: Ib
Ideal (a^4 - a^3*c + a^2*c^2 - a*c^3 - 2*a^3*d + 6*a^2*c*d - 4*a*c^2*d + 8*a^2*d^2 - 4*a*c*d^2) of Multivariate Polynomial Ring in a, b, c, d over Rational Field
sage: Ib.gens()[0]
a^4 - a^3*c + a^2*c^2 - a*c^3 - 2*a^3*d + 6*a^2*c*d - 4*a*c^2*d + 8*a^2*d^2 - 4*a*c*d^2
sage: Ib.gens()[0] // a
a^3 - a^2*c + a*c^2 - c^3 - 2*a^2*d + 6*a*c*d - 4*c^2*d + 8*a*d^2 - 4*c*d^2

The last polynomial is the (implicit) expression of a in terms of c and d. Since this is a cubic polynomial in a, you could use the Cardano formula (see https://en.wikipedia.org/wiki/Cubic_equation). This is what you obtain when using solve on a cubic equation

sage: poly = Ib.gens()[0] // a
sage: poly
a^3 - a^2*c + a*c^2 - c^3 - 2*a^2*d + 6*a*c*d - 4*c^2*d + 8*a*d^2 - 4*c*d^2
sage: solve([SR(poly) == 0], SR.var('a'))
[a == -1/3*(1/2)^(2/3)*((c + 2*d)^2 - 3*c^2 - 18*c*d - 24*d^2)*(-I*sqrt(3) + 1)/(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3) - 1/6*(1/2)^(1/3)*(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3)*(I*sqrt(3) + 1) + 1/3*c + 2/3*d,
 a == -1/3*(1/2)^(2/3)*((c + 2*d)^2 - 3*c^2 - 18*c*d - 24*d^2)*(I*sqrt(3) + 1)/(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3) - 1/6*(1/2)^(1/3)*(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3)*(-I*sqrt(3) + 1) + 1/3*c + 2/3*d,
 a == 2/3*(1/2)^(2/3)*((c + 2*d)^2 - 3*c^2 - 18*c*d - 24*d^2)/(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3) + 1/3*c + 2/3*d + 1/3*(1/2)^(1/3)*(2*(c + 2*d)^3 + 27*c^3 + 108*c^2*d + 108*c*d^2 + 36*sqrt(1/3)*sqrt((c^3 + 2*c*d^2 + 14*d^3)*(c + 2*d))*(c + 2*d) - 9*(c^2 + 6*c*d + 8*d^2)*(c + 2*d))^(1/3)]