1
$\begingroup$

I want to find the locus of point present of the complex z so that $$|z + 2| + |z - 2| = 18. $$ I tried by hand

ComplexExpand[Abs[z + 2] == 18 - Abs[z - 2] /. z :> (x + y I)];
Simplify[#^2 & /@ %]
Expand[Simplify[(9 Sqrt[4 - 4 x + x^2 + y^2])^2 - (81 - 2 x)^2]]
Simplify[1/6237 (-6237 + 77 x^2 + 81 y^2)]

-1 + x^2/81 + y^2/77

How can I reduce my work to get the result automatically?

$\endgroup$

3 Answers 3

4
$\begingroup$

GroebnerBasis[] does the job:

First[GroebnerBasis[ComplexExpand[Abs[z + 2] + Abs[z - 2] == 18 /. z :> (x + I y)], {x, y}]]
   -6237 + 77 x^2 + 81 y^2

ContourPlot[% == 0, {x, -9, 9}, {y, -9, 9}, AspectRatio -> Automatic]

ellipse

$\endgroup$
2
  • $\begingroup$ Is it always the first element? I admit I don't understand the documentation on GroebnerBasis very well: "The Gröbner basis in general depends on the ordering assigned to monomials. This ordering is affected by the ordering of the $x_i$." And then there's the MonomialOrder option too. How to tell which one to pick? $\endgroup$
    – Roman
    Mar 12, 2019 at 9:01
  • 1
    $\begingroup$ @Roman, often it is, but sometimes you have to look for the "rationalized" expression in the list returned by GroebnerBasis[]. The reason for someone wanting to set MonomialOrder is that both the efficiency of the method and the simplicity of the results (that is, the basis) can depend on the choice of order in eliminating the variables. $\endgroup$ Mar 12, 2019 at 9:18
2
$\begingroup$

In general, you can use Solve:

Solve[ComplexExpand[Abs[z + 2] + Abs[z - 2] == 18 /. z -> x + I y], y]

$\left\{\left\{y\to -\frac{1}{9} \sqrt{77} \sqrt{81-x^2}\right\},\left\{y\to \frac{1}{9}\sqrt{77} \sqrt{81-x^2}\right\}\right\}$

Then you can for example do

DeleteDuplicates[y^2 /. %]

{77/81 (81 - x^2)}

to find something close to your result.

$\endgroup$
1
$\begingroup$
Reduce[Abs[z + 2] + Abs[z - 2] == 18, z]

-9 <= Re[z] <= 9 && (Im[z] == -(1/9) Sqrt[6237 - 77 Re[z]^2] || Im[z] == 1/9 Sqrt[6237 - 77 Re[z]^2])

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.