4
$\begingroup$

I need to calculate the value of the integral enter image description here

Over the region between the four lines enter image description here

I thought I could perhaps define the region using

Boole[{-8 <= 2 x + 3 y <= 8 && -2 <= 5 x + 2 y <= 2}]

but that doesn't work. ("Incomplete; more input is needed").

What functions can be used to solve this problem?

$\endgroup$
3
  • $\begingroup$ The region should be defined as reg = ImplicitRegion[ -2 <= 2 x + 7 y <= 2 && -2 <= 3 x + 6 y <= 2 , {x, y}] I think. $\endgroup$ Commented Jan 27, 2022 at 14:20
  • $\begingroup$ You are nearly there with "Boole": NIntegrate[ Boole[-8 <= 2 x + 3 y <= 8 && -2 <= 5 x + 2 y <= 2], {x, -10, 10}, {y, -10, 10}] this yields: 5.81818 $\endgroup$ Commented Jan 27, 2022 at 15:37
  • $\begingroup$ See also Double integral over a parallelogram $\endgroup$
    – Artes
    Commented Jan 28, 2022 at 0:34

2 Answers 2

8
$\begingroup$
  • Method 1
Integrate[
 Boole[{ -2 <= 2 x + 7 y <= 2 && -2 <= 3 x + 6 y <= 2}](6 x^2 + 
    33 x*y + 42 y^2)^4, {x, -∞, ∞}, {y, -∞, ∞}]

4096/225

  • Method 2
Integrate[(6 x^2 + 33 x*y + 42 y^2)^4, {x, y} ∈ 
  ImplicitRegion[{ -2 <= 2 x + 7 y <= 2 && -2 <= 3 x + 6 y <= 2}, {x, 
    y}]]

4096/225

  • Method 3
(* change of variables *)
sol = Solve[{u == 2 x + 7 y, v == 3 x + 6 y}, {x, y}][[1]];
(*  {x -> 1/9 (-6 u + 7 v), y -> 1/9 (3 u - 2 v)}  *)
expr = (6 x^2 + 33 x*y + 42 y^2)^4 /. sol // Simplify;
(* u^4 v^4 *)
jacobian = Grad[{x, y} /. sol, {u, v}] // Det // Abs
(* 1/9 *)
Integrate[expr*jacobian, {u, -2, 2}, {v, -2, 2}]

4096/225

  • Method 4
Factor[6 x^2 + 33 x*y + 42 y^2]
(* 3 (x + 2 y) (2 x + 7 y) *)

It means that the integrand (6 x^2 + 33 x*y + 42 y^2)^4 is just (u*v)^4 if we set u=3(x+2y) and v=2x+7y.

Then the region became -2<=u<=2 and -2<=v<=2.

To calculate Grad[{x,y},{u,v}]//Det, we just need to calculate 1/Grad[{u,v},{x,y}]//Det.

1/(Grad[{3(x+2y),2x+7y}, {x, y}] // Det // Abs)

1/9

Clear[u,v];
Integrate[(u*v)^4*1/9,{u,-2,2},{v,-2,2}]

4096/225

$\endgroup$
4
  • $\begingroup$ Are you sure about the region definition? I think it should be ImplicitRegion[ -2 <= 2 x + 7 y <= 2 && -2 <= 3 x + 6 y <= 2 , {x, y}] $\endgroup$ Commented Jan 27, 2022 at 14:23
  • $\begingroup$ Thank you. These don't yield the correct result, though. $\endgroup$
    – Orm
    Commented Jan 27, 2022 at 14:24
  • $\begingroup$ @UlrichNeumann Thanks, I just copy the author's code, not aware the picture. $\endgroup$
    – cvgmt
    Commented Jan 27, 2022 at 14:27
  • $\begingroup$ Wow, thank you so much!! Really helpful stuff to learn from. You're a star. $\endgroup$
    – Orm
    Commented Jan 27, 2022 at 17:11
2
$\begingroup$

The region defined by the four lines doesn't agree with Boole[{-8 <= 2 x + 3 y <= 8 && -2 <= 5 x + 2 y <= 2}] mentioned by OP.

regQ = ImplicitRegion[ -8 <= 2 x + 3 y <= 8 && -2 <= 5 x + 2 y <= 2 , {x, y}] (*QP*)
reg = ImplicitRegion[-2 <= 2 x + 7 y <= 2 && -2 <= 3 x + 6 y <= 2, {x,y}] 
Show[{RegionPlot[{regQ, reg}, BoundaryStyle -> { Dashed,Automatic}],ContourPlot[{2 x + 7 y == -2, 2 x + 7 y == 2, 3 x + 6 y == -2,3 x + 6 y == 2}, {x, -3, 3}, {y, -3, 3}]}]

enter image description here

The correct result follows, in accordance with @cvgmt 's modified answer, to

Integrate[(6 x^2 + 33 x*y + 42 y^2)^4, Element[{x, y}, reg]]
(*4096/225*)
$\endgroup$

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