9
$\begingroup$

I need to find the points at which the two ellipses implicitly defined by

$\qquad y^2=4-4\,x^2 \quad[E1]$

and

$\qquad (1-(x/2))^2+(y-1)^2=1 \quad[E2]$

intersect.

So I isolated $y$ in E2 and then squared it so that I could eliminate it using E1 and then solve for $x$. This turned to be very gnarly.

Is there an easier way of finding the intersection points of E1 and E2? (as shown here in graph)

ContourPlot[
  {(y^2 == 4 - 4*x^2), ((1 - x/2)^2 + (y - 1)^2 == 1)}, {x, -5, 5}, {y, -5, 5}, 
  Frame -> False, Axes -> True]
$\endgroup$

3 Answers 3

15
$\begingroup$

Solve can be used directly

pts = {x, y} /. 
   Solve[{y^2 == 4 - 4 x^2, (1 - (x/2))^2 + (y - 1)^2 == 1}, {x, y}, 
    Reals] // FullSimplify

(* {{Root[144 - 160*#1 - 328*#1^2 + 
           120*#1^3 + 225*#1^4 & , 1, 
       0], Root[144 - 1280*#1 + 
           1688*#1^2 - 960*#1^3 + 
           225*#1^4 & , 2, 0]}, 
   {Root[144 - 160*#1 - 328*#1^2 + 
           120*#1^3 + 225*#1^4 & , 2, 
       0], Root[144 - 1280*#1 + 
           1688*#1^2 - 960*#1^3 + 
           225*#1^4 & , 1, 0]}} *)

Converting the Root objects to their numeric values

pts // N

(* {{0.539936, 1.68341}, {0.997732, 0.13463}} *)

Show[
 ContourPlot[{
   (y^2 == 4 - 4*x^2),
   ((1 - x/2)^2 + (y - 1)^2 == 1)},
  {x, -1.5, 4.5}, {y, -3, 3},
  Frame -> False,
  Axes -> True],
 Graphics[{Red, AbsolutePointSize[4], Point[pts]}]]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you, @BobHanlon $\endgroup$
    – wendy
    Commented Aug 11, 2019 at 0:19
13
$\begingroup$

You can (1) use Cases to extract the Lines from ContourPlot output, and (2) use RegionIntersection to find the intersections:

cp = ContourPlot[{(y^2 == 4 - 4*x^2), ((1 - x/2)^2 + (y - 1)^2 == 
      1)}, {x, -5, 5}, {y, -5, 5}, Frame -> False, Axes -> True];

intersections = RegionIntersection @@ Cases[Normal @ cp, _Line, All]

Point[{{0.992916, 0.140285}, {0.539984, 1.68261}}]

Show[cp, Epilog->{Red, PointSize[Large], intersections}]

enter image description here

Show[cp, ListPlot[Callout[#, {##}, Automatic, 
     LabelStyle -> 13, Appearance -> "Frame", LeaderSize -> 30, CalloutStyle -> Red, 
     CalloutMarker -> "BoxPoint"] & /@ intersections[[1]]],
   PlotRange -> {{-3, 4}, {-3, 3}}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you for your help, @kglr $\endgroup$
    – wendy
    Commented Aug 11, 2019 at 0:19
2
$\begingroup$

Clearly the easy way is to get a computer program to solve it for you.

If for some reason you want to do it by hand, you could do this:

$(1 - x/2)^2 + (y - 1)^2 == 1$

$(y - 1)^2 == 1-(1 - x/2)^2 == x - x^2/4 $

$y^2 - (y - 1)^2 == 4-4x^2 - (x - x^2/4 )$

$y^2 - (y^2 -2y+ 1) == 4-4x^2 - x + x^2/4 $

$ 2y-1 == 4-4x^2 - x + x^2/4)$

$ y == \frac{5-4x^2 - x + x^2/4}{2})$

And now it's practically a straight binomial.

But I notice this is for Mathematica, and you didn't show why you had a problem using Mathematica. It looked like you were doing stuff by hand.

$\endgroup$
1
  • 1
    $\begingroup$ Hi, @JThomas , thanks for your help! The problem was that as I have not used Mathematica for long, I wasn't sure as to how to solve the equation using Mathematica. $\endgroup$
    – wendy
    Commented Aug 12, 2019 at 8:59

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.