7

fixed in 10.0.2


Update

I have tried like these. I think there is a bug.

Plot[1/Sqrt[-1 + 2^2 Sech[x]^2], {x, 0, ArcCosh[2]},
 Ticks -> {{ArcCosh[2]}, Automatic}]

Blockquote

This is the antiderivative.

primitive = Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], x]; 

Plot[primitive, {x, 0, ArcCosh[2]},
 Ticks -> {{ArcCosh[2]}, {π/4, π/2}}]

Blockquote

Limit[primitive, x -> 0]

0

So far, that's right. Look at this any situation. Limits of primitive are same regardless of the direction. And the limit value is minus. Is this right?

(version 10)

Limit[primitive, x -> ArcCosh[2], Direction -> -1] // FullSimplify

-π/2

Limit[primitive, x -> ArcCosh[2], Direction -> 1] // FullSimplify

-π/2

But this computation is right at version 9

(version 9)

Limit[primitive, x -> ArcCosh[2], Direction -> 1] // FullSimplify

π/2

And as mentioned earlier origin, the definite integral is an erroneous conclusion at version 9 also.

===============================================================

Edit

The definite integral is solved using substitution method as Dr. Wolfgang Hintze says like this.

$u$ =$\frac{\cosh ^2(x)-1}{a^2-1}$

$dx$ = $\frac{\left(a^2-1\right)}{2 \sinh (x) \cosh (x)}du$

$\int_0^1 \frac{a^2-1}{2 \sinh (x) \cosh (x) \sqrt{a^2 \text{sech}^2(x)-1}} \, du$

$\frac{1}{2} \int_0^1 \frac{a^2-1}{\sqrt{a^2 \sinh ^2(x)-\sinh ^2(x) \cosh ^2(x)}} \, du$

$\frac{1}{2} \int_0^1 \frac{1}{\sqrt{\frac{\left(\cosh ^2(x)-1\right) \left(a^2-\cosh ^2(x)+1-1\right)}{\left(a^2-1\right) \left(a^2-1\right)}}} \, du$

$\frac{1}{2} \int_0^1 \frac{1}{\sqrt{u (1-u)}} \, du=\frac{\pi }{2}$

It is solved in the real number region. And ArcCos[2]is also real number. But I don't konw why mathematica make $\int_0^{\cosh ^{-1}(2)} \frac{1}{\sqrt{2^2 \text{sech}^2(x)-1}}\, dx$ appear a imaginary term like $\left(\frac{1}{2}-i\right) \pi$ .

===============================================================

Origin

I have tried two expressions.(version 10)

(1)

 Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], {x, 0, ArcCosh[2]}]

$\left(\frac{1}{2}-i\right) \pi$

(2)

$Assumptions = {a > 1}; 
Integrate[1/Sqrt[-1 + a^2*Sech[x]^2], {x, 0, ArcCosh[a]}]

$\frac{\pi }{2}$

  1. What difference does it make it?

  2. The first computing (1) makes the imaginary term. - I π. I don't know why it did such result?

(version 9)

 Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], {x, 0, ArcCosh[2]}]

$\frac{3 \pi }{2}$

  1. If possible, I want to know mathematica's detail process.
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Junho Lee
  • 5,155
  • 1
  • 15
  • 33
  • (at)Junho Lee: the integral is independent of "a". In fact, substituting u = (Cosh[x]^2-1)/(a^2-1) leads to 1/2 Integrate[1/Sqrt[u(1-u),{u,0,1}] = pi/2. This result is also returned in version 8 of MMA under the (natural) assumption a>1. – Dr. Wolfgang Hintze Sep 22 '14 at 07:00
  • Here you'll find why imaginary terms can appear Why does Integrate declare a convergent integral divergent? – Artes Sep 22 '14 at 09:14
  • @Dr. Wolfgang Hintze: thanks I have got the solution by your method. but I don't know why does the imaginary term appear. thanks a lot. – Junho Lee Sep 22 '14 at 11:50
  • @Artes: thank you. your comment is helpful for me. – Junho Lee Sep 22 '14 at 11:55
  • @JunhoLee I don't have time to provide an answer however for a deeper understanding what happens here I recommend calculating a countour integral, see e.g. How to calculate contour integrals with Mathematica? or Paths integrals in the complex plane. – Artes Sep 22 '14 at 21:49
  • I reported this as a bug. Hope to get it fixed. – Daniel Lichtblau Sep 23 '14 at 17:01
  • 1
    Regarding the process, in this example Mathematica uses the Newton-Leibniz method. (1) Find an antiderivative. (2) Check integration path for possible singularities. (3) Evaluate between consecutive point pairs comprised of path endpoints and singularities, if any. Take limits from appropriate directions to do these evaluations (this is how jump discontinuities get managed). As for the bug in question... – Daniel Lichtblau Sep 24 '14 at 18:20
  • 1
    ... The singularity detection code finds a "jump" point, in the range [0, arccosh(2)]. The trouble arises from the following bad interaction: (1) The antiderivative takes a jump at that endpoint arccosh(2) (not a problem in and of itself), and (2) the singular point is found to be Log[7 + 4*Sqrt[3]]/2, which is not recognized as being equal to that endpoint of ArcCosh[2]. So an excess pair of limits are evaluated and they give a jump value that does not belong in the definite integral. Fix is to do a better job of determining when a "singlar" point is actually a path endpoint. – Daniel Lichtblau Sep 24 '14 at 18:28
  • @Daniel Lichtblau : Thank you very much. Is this a bug too? Limit[\[Integral]1/Sqrt[-1 + 2^2 Sech[x]^2] \[DifferentialD]x, x -> ArcCosh[2], Direction -> 1] // FullSimplifyis -(\[Pi]/2) – Junho Lee Sep 25 '14 at 00:36
  • Well, it would be a bug. I get Pi/2 though, which is correct. I also get -Pi/2 when I approach from the other direction (again correct). I see this in versions 9 (running on Windows) and 10 (Linux). – Daniel Lichtblau Sep 25 '14 at 22:55

3 Answers3

3

It seems to be a branch cut issue. It depends when the substitution is done, that causes the integrator to go one way vs. the other. This below shows difference

ClearAll[x, a];
sol = Integrate[1/Sqrt[-1 + a^2*Sech[x]^2], x]

The integrand at x=0 is always zero, so we can ignore this, The issue is with the upper limit

low = Limit[sol, x -> 0]
(*0*)

Taking the limit using ArcCosh[a] first, then after that replacing a by 2 :

up = Limit[sol, x -> ArcCosh[a]]
Limit[up, a -> 2]
(*  -Pi/2 *)

Now taking the limit using ArcCosh[2] first then replacing a by 2 :

up = Limit[sol, x -> ArcCosh[2]]
Limit[up, a -> 2]
(* Pi/2 *)

So depending when a is set to 2 causes different result. This would indicate a branch cut issue.

Nasser
  • 143,286
  • 11
  • 154
  • 359
3

This has been fixed in 10.0.2. On windows 7, 64 bit:

Mathematica graphics

Mathematica graphics

Nasser
  • 143,286
  • 11
  • 154
  • 359
  • I think that Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], {x, 0, ArcCosh[2]}] should be Pi/2 – Junho Lee Dec 20 '14 at 13:28
  • @JunhoLee Well, may be, but looking at: r = Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], x]; Limit[r, x -> ArcCosh[2]] - Limit[r, x -> 0]; N[%] gives -Pi/2 and -Pi/2 is actually the same as 3 Pi/2 However, NIntegrate[1/Sqrt[-1 + 2^2*Sech[x]^2], {x, 0, ArcCosh[2]}] gives Pi/2. So I am not sure. May be someone knows. – Nasser Dec 20 '14 at 13:41
  • 1
    @JunhoLee I also just verified it with Rubi, it also gives -Pi/2 or 3 Pi/2 : Mathematica graphics so I think the symbolic result is correct. May be there is problem with numerical integration. – Nasser Dec 20 '14 at 13:49
  • @JunhoLee fyi, in 10.1 Integrate[1/Sqrt[-1 + 2^2*Sech[x]^2], {x, 0, ArcCosh[2]}] gives Pi/2, but with some message as well. Screen shot Mathematica graphics – Nasser Apr 02 '15 at 10:58
1
$Version

"10.0 for Mac OS X x86 (64-bit) (September 10, 2014)"

$Assumptions = {a > 1};
Integrate[1/Sqrt[-1 + a^2*Sech[x]^2], {x, 0, ArcCosh[a]}]

Pi/2

f[a_?NumericQ] := Module[
  {ar = Rationalize[a, 0]},
  NIntegrate[
    1/Sqrt[-1 + ar^2*Sech[x]^2],
    {x, 0, ArcCosh[ar]},
    WorkingPrecision -> 20] //
   Chop]

RootApproximant[f[2]/Pi]*Pi

Pi/2

Plot[f[a], {a, 1, 5},
 Exclusions -> 1,
 PlotRange -> Pi/2 {.9, 1.1}]

enter image description here

The integral is a constant Pi/2 for a > 1, the integral result with the imaginary component is wrong.

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198