TransWikia.com

Excluding singular curves in NIntegrate

Mathematica Asked on July 3, 2021

I would like to calculate

NIntegrate[1/(x2 x3 + (1 - x2 - x3) (x2 + x3)), {x2, 0, 1}, {x3, 0, 1}, Exclusions -> {x2 == 1/2 (1 - x3 + Sqrt[1 + 2 x3 - 3 x3^2])}]

I have tried excluding the singular curve. Any ideas about how to calculate this? Most answers here suggest Exclusions, but alas, it doesn’t work. I also tried

NIntegrate[1/(x2 x3 + (1 - x2 - x3) (x2 + x3)), {x2, 0, 1}, {x3, 0, 1},Method -> {"GlobalAdaptive", "SingularityHandler" -> None, MaxRecursion -> 120]

Any ideas will be helpful.

One Answer

Do first integration analytically.

int1 = Integrate[1/(x2 x3 + (1 - x2 - x3) (x2 + x3)), {x2, 0, 1}, 
   PrincipalValue -> True, Assumptions -> 0 < x3 < 1]

(*   Log[(1 - 2 x3^3 + Sqrt[1 + (2 - 3 x3) x3] + 
     x3 (3 + 2 Sqrt[1 + (2 - 3 x3) x3]))/(
     2 x3^3)]/Sqrt[1 + (2 - 3 x3) x3]   *)

NIntegrate[int1, {x3, 0, 1}]

(*   3.51586   *)

Edit Numerical test yield the same result.

Do a two -step numerical integration, regarding x3 as a parameter for the first NIntegrate.

nint2[x3_?NumericQ] := 
   NIntegrate[1/(x2 x3 + (1 - x2 - x3) (x2 + x3)), {x2, 0, 1}, 
   Method -> "PrincipalValue", 
   Exclusions -> {(x2 x3 + (1 - x2 - x3) (x2 + x3)) == 0}, 
   MaxRecursion -> 100, WorkingPrecision -> 30]

pl = Plot[nint2[Rationalize[x3, 0]], {x3, 0, 1}, 
      WorkingPrecision -> 25, PlotRange -> {0, 30}]

NIntegrate[nint2[x3], {x3, 0, 1}, WorkingPrecision -> 25] // Timing

(*   {48.016, 3.515860858034190463653627}   *)

Answered by Akku14 on July 3, 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