TransWikia.com

Find the area which is between two curves using Nintegrate

Mathematica Asked by Aran on January 26, 2021

    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

One Answer

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 *)

Correct answer by Bob Hanlon on January 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP