Can use GroebnerBasis for this.
eqs = {x1^2/a^2 + y1^2/b^2 == 1, x2^2/a^2 + y2^2/b^2 == 1,
x1 x2 + y1 y2 == 0, y2/(x2 - c) == y1/(x1 - c) == k};
First take differences to make expressions from the equations.
exprs = Flatten[Map[#[[1]] - Rest[#] &, Apply[List, eqs, 1]]]
(* Out[81]= {-1 + x1^2/a^2 + y1^2/b^2, -1 + x2^2/a^2 + y2^2/b^2,
x1 x2 + y1 y2, -(y1/(-c + x1)) + y2/(-c + x2), -k + y2/(-c + x2)} *)
Now get common denominators and extract numerators, to get polynomials.
polys = Numerator[Together[exprs]]
(* Out[82]= {-a^2 b^2 + b^2 x1^2 + a^2 y1^2, -a^2 b^2 + b^2 x2^2 +
a^2 y2^2, x1 x2 + y1 y2,
c y1 - x2 y1 - c y2 + x1 y2, -c k + k x2 - y2} *)
We now find the variables to keep.
elims = {x1, x2, y1, y2};
vars = Complement[Variables[polys], elims]
(* Out[84]= {a, b, c, k} *)
Now find the polynomial resulting from eliminating the x and y variables.
Timing[
gb = GroebnerBasis[polys, vars, elims,
MonomialOrder -> EliminationOrder]]
(* Out[85]= {0.100000, {a^8 b^8 - a^6 b^8 c^2 + 3 a^8 b^8 k^2 -
3 a^8 b^6 c^2 k^2 - 2 a^6 b^8 c^2 k^2 + 3 a^6 b^6 c^4 k^2 -
a^4 b^8 c^4 k^2 + 3 a^8 b^8 k^4 - 2 a^8 b^6 c^2 k^4 -
5 a^6 b^8 c^2 k^4 + 3 a^8 b^4 c^4 k^4 + a^4 b^8 c^4 k^4 -
3 a^6 b^4 c^6 k^4 + 2 a^4 b^6 c^6 k^4 + a^2 b^8 c^6 k^4 +
a^8 b^8 k^6 + a^8 b^6 c^2 k^6 - 4 a^6 b^8 c^2 k^6 -
a^8 b^4 c^4 k^6 - 3 a^6 b^6 c^4 k^6 + 6 a^4 b^8 c^4 k^6 -
a^8 b^2 c^6 k^6 + 2 a^6 b^4 c^6 k^6 + 3 a^4 b^6 c^6 k^6 -
4 a^2 b^8 c^6 k^6 + a^6 b^2 c^8 k^6 - a^4 b^4 c^8 k^6 -
a^2 b^6 c^8 k^6 + b^8 c^8 k^6}} *)
Thus far I did not try to force denominators not to vanish. One could do that by creating a new polynomial of the form product(denoms)*newvariable-1, adding that to the polynomial list, and adding newvariable to the list of elimination variables. We'll do this below.
denoms =
Apply[Times,
FactorSquareFreeList[Times @@ Denominator[Together[exprs]]][[All,
1]]]
(* Out[93]= a b (c - x1) (c - x2) *)
newpoly = denoms*newvar - 1
(* Out[94]= -1 + a b newvar (c - x1) (c - x2) *)
This will be slower...
Timing[
gb2 = GroebnerBasis[Append[polys, newpoly], vars,
Append[elims, newvar], MonomialOrder -> EliminationOrder]]
(* Out[96]= {27.900000, {a^6 b^6 + 3 a^6 b^6 k^2 - 3 a^6 b^4 c^2 k^2 +
a^4 b^6 c^2 k^2 + 3 a^6 b^6 k^4 - 2 a^6 b^4 c^2 k^4 -
2 a^4 b^6 c^2 k^4 + 3 a^6 b^2 c^4 k^4 - 2 a^4 b^4 c^4 k^4 -
a^2 b^6 c^4 k^4 + a^6 b^6 k^6 + a^6 b^4 c^2 k^6 -
3 a^4 b^6 c^2 k^6 - a^6 b^2 c^4 k^6 - 2 a^4 b^4 c^4 k^6 +
3 a^2 b^6 c^4 k^6 - a^6 c^6 k^6 + a^4 b^2 c^6 k^6 +
a^2 b^4 c^6 k^6 - b^6 c^6 k^6}} *)
So the "correct" result is actually of lower degree. Indeed, the new one is a proper factor of the old.
Factor[gb[[1]]/gb2[[1]]]
(* Out[98]= b^2 (a - c) (a + c) *)
(I guess the pros call it a "quotient ideal" for a reason.)
--- edit ---
Alternatively, since it is a principle ideal, I guess I should have just factored the generating polynomial for gb and removed all factors that divide any denominator. That would also have given gb2 and at much lower computational cost.
--- end edit ---
Solve[{x1^2/a^2 + y1^2/b^2 == 1, x2^2/a^2 + y2^2/b^2 == 1(*,x1 x2+ y1 y2\[Equal]0*), y2/(x2 - c) == k, y1/(x1 - c) == k}, {x1, x2, y1, y2}]. – b.gatessucks Feb 7 at 8:23Solve[{x1^2/a^2 + y1^2/b^2 == 1, x2^2/a^2 + y2^2/b^2 == 1, x1 x2 + y1 y2 == 0, y2/(x2 - c) == k, y1/(x1 - c) == k}, {x1, x2, y1, y2, k}]. – b.gatessucks Feb 7 at 8:25k^2 == (a^2 b^2)/(-a^2 b^2 + (a^2 + b^2) c^2). – chyanog Feb 7 at 8:50