0
    eq1 = (x^2/400) + (y^2/256) == 1;

    eq2 = (x^2/144) - (y^2/289) == 1;

    sl = Solve[{eq1, eq2}, {x, y}]

    NIntegrate[eq1 - eq2, {x, s1[1], s1[2]}]
    NIntegrate[eq1 - eq2, {x, s1[2], s1[3]}]
    NIntegrate[eq1 - eq2, {x, s1[3], s1[4]}]

Im trying to find the area which is inside the 2 curves. From s1 there are 4 solutions. What i want to do is find the area between solution 1 and 2, then 2 and 3 and then 3 and 4. When I get these values Im going too add it so it will give me the full area which is enclosed inside the two.

BUT its not working and I get zero, why do I get this value?

is there any way of getting a solutions using NIntegrate? I haven't used Implicit function yet

also another thing im trying

Clear[f, g, x, y]
f[x_, y_] := (x^2/400) + (y^2/256) == 1;

g[x_, y_] := (x^2/144) - (y^2/289) == 1; sol = NSolve[f[x, y] == g[x, y], x, y];

{a, b} = x /. sol {c, d} = y /. sol

Integrate[f[x, y] - g[x, y], {x, a, b}, {y, a, b}]

it doesn't work either

Aran
  • 373
  • 1
  • 9

1 Answers1

3
Clear["Global`*"]

eq1 = (x^2/400) + (y^2/256) == 1;
eq2 = (x^2/144) - (y^2/289) == 1;

(sl = Solve[{eq1, eq2}, {x, y}]) // N

(* {{x -> -14.3491, y -> -11.1456}, {x -> -14.3491, y -> 11.1456}, {x -> 14.3491,
   y -> -11.1456}, {x -> 14.3491, y -> 11.1456}} *)

Assuming that the area of interest is

rgn = ImplicitRegion[eq1 && eq2 /. Equal -> LessEqual, {x, y}]

(* ImplicitRegion[x^2/400 + y^2/256 <= 1 && x^2/144 - y^2/289 <= 1, {x, y}] *)

Show[Region[rgn], ContourPlot[Evaluate@{eq1, eq2}, {x, -20, 20}, {y, -20, 20}], Epilog -> {Red, AbsolutePointSize[6], Point[{x, y} /. sl]}, Frame -> True]

enter image description here

area = Area[rgn] // Simplify

(* 640 ArcSin[3 Sqrt[545/9529]] + 204 Log[(17721 + 640 Sqrt[545])/9529] *)

area // N

(* 763.394 *)

area == Integrate[1, {x, y} [Element] rgn] // Simplify

(* True *)

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
  • I have no idea why, but we've done it slightly differently to each other and ended up with different results. Both our meshes of the regions seem to line up too. – flinty Nov 11 '20 at 18:25
  • Area[Point[s1]] and i got undefined – Aran Nov 11 '20 at 19:03
  • Points don't have an area, they have a count. The RegionMeasure of the points is RegionMeasure[Point[{x, y} /. sl]] which evaluates to 4 – Bob Hanlon Nov 11 '20 at 19:22