2

A question asks me to calculate the following integral using NIntegrate:

Calculate the double integral of (30x^2+37xy+10y^2)^2 over the area D bounded by the four lines 6x+5y=9, 6x+5y=-9, 5x+2y=1 and 5x+2y=-1

Calculate the double integral ... where D is the area bounded by the four lines ...

With the following code I only manage to get zero as an answer, which is wrong:

f[x_, y_] := (30*x^2 + 37*x*y + 10*y^2)^2

NIntegrate[f[x, y] Boole[6x + 5y == 9 && 6x + 5y == -9 && 5x + 2y == 1 && 5x + 2y == -1], {x, -Infinity, Infinity}, {y, -Infinity, Infinity}]

image of code

What should I do instead?

MarcoB
  • 67,153
  • 18
  • 91
  • 189
  • https://mathematica.stackexchange.com/questions/262725/double-integral-over-special-region/262727#262727 – cvgmt May 23 '22 at 19:59

1 Answers1

3

You want the region of integration to be defined by inequalities, rather than equalities. Your region can be described as follows:

region = ImplicitRegion[Abs[6*x + 5*y] < 9 && Abs[5 x + 2 y] < 1, {x, y}]];
RegionPlot[region, AspectRatio -> Automatic]

representation of the parallelogram bounded by those four lines

With that definition, you can then write:

ClearAll[f]
f[x_, y_] := (30*x^2 + 37*x*y + 10*y^2)^2

NIntegrate[ f[x, y], {x, y} ∈ region ]

(* Out: 24.9231 *)

In this case, you can also obtain a symbolic answer, just by replacing Integrate for NIntegrate above (it returns 324/13).

MarcoB
  • 67,153
  • 18
  • 91
  • 189