RuleBasedIntegration / Rubi

Rubi for Mathematica
http://rulebasedintegration.org
MIT License
228 stars 23 forks source link

Problem with `Int` #38

Closed RungeCC closed 3 years ago

RungeCC commented 4 years ago
x4 = 1 - x1 - x2 - x3;
D4[s_, t_] := -x1 x2 s - x3 x4 t + (1 - (x1 + x2) (x3 + x4));
expr = 1/D4[4, 0] + 1/D4[0, 0] + 1/D4[0, 4];
Int[Int[Int[expr, {x3, 0, 1 - x1 - x2}],{x2,0,1-x1}],{x1,0,1}]

After using FullSimlify we will get 1/18 (-6 + (-3 I + 4 Sqrt[3]) \[Pi]). However, it's clear that the answer must be a real number. The correct answer is just the real part of what Rubi` has given above. It seems that Rubi` went the wrong way when choosing the branch of those multi-valued function...

RungeCC commented 4 years ago

Compare the result with NIntegrate's, I finally find the bug in this piece:

Int[((1 - 4*x1)*ArcTan[(-1 + 4*x1)/Sqrt[3 - 8*x1]])/Sqrt[3 - 8*x1], 
  {x1, 0, 1}]
(* result -> 1/6 (2 + I \[Pi] + 2 Sqrt[5] ArcTanh[3/Sqrt[5]]) *)

The correct answer is the above expression dropping I \[Pi] out.

halirutan commented 4 years ago

Have you checked, what ?Int says in its usage message?

image

The correctness of the antiderivative of

int = Int[((1 - 4*x1)*ArcTan[(-1 + 4*x1)/Sqrt[3 - 8*x1]])/Sqrt[3 - 8*x1], x1]

can be checked with D but then it's up to you what you do with the poles along your line. It seems the points 3/8 and 4/8 are critical here and if you consider taking the limits to calculate the definite integral, you will get the correct result

image