MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Definite Integration Question

  • To: mathgroup at
  • Subject: [mg73071] Definite Integration Question
  • From: "dimitris" <dimmechan at>
  • Date: Thu, 1 Feb 2007 03:14:56 -0500 (EST)

Hello to all of you!

Firstly, I apologize for the lengthy post!
Secondly, I have tried to send this message the last three days so I
apologize if it appears more than one time!

In this thread:

I mention Victor Adamchik's Mathematica 3.0's Definite Integration
article (also in notebook format see

David Cantrell made some very interesting comments. Since there were
no responses to his queries (as far as I know) I would like to
again some of the posted issues.

In the section about Proper Integrals in his article, Adamchik
mentions that the Newton-Leibniz formula (i.e. the Fundamental
of Integral Calculus: Integrate[f[x],{x,a,b}]=F[b]-F[a],
F[x]: an antiderivative), does not hold any longer if the
antiderivative F(x)  has singularities in the integration interval

To demonstrate this, he considers the integral of the function:

f[x_] = (x^2 + 2*x + 4)/(x^4 - 7*x^2 + 2*x + 17);

over the interval  (0,4).

Plot[f[x], {x, 0, 4}];
(*plot to be displayed*)

The integrand posseses no singularities on the interval (0,4).

Here is the corresponding indefinite integral

F[x_] = Simplify[Integrate[f[x], x]]
ArcTan[(1 + x)/(4 - x^2)]

Substituting limits of integration into F[x] yields an incorrect

Limit[F[x], x -> 4, Direction -> 1] - Limit[F[x], x -> 0, Direction -
NIntegrate[f[x], {x, 0, 4}]

-ArcTan[1/4] - ArcTan[5/12]

This is because the antiderivative has a jump discontinuity at x=2
(also at x = -2), so that the Fundamental theorem cannot be used.

Limit[F[x], x -> 2, Direction -> #1]&/@{-1, 1}

{-(Pi/2), Pi/2}
(*plot to be displayed*)

The right way of applying the Fundamental theorem is the following

(Limit[F[x], x -> 4, Direction -> 1] - Limit[F[x], x -> 2, Direction -
> -1]) +
  (Limit[F[x], x -> 2, Direction -> 1] - Limit[F[x], x -> 0,
-> -1])

Pi - ArcTan[1/4] - ArcTan[5/12]

Integrate in this particular -(*) see below-definite integral works
precisely this way

Integrate[f[x], {x, 0, 4}]

Pi - ArcTan[1/4] - ArcTan[5/12]

(*) At this point Adamchik makes a quite surprising comment (as David
pointed out in his original post) "Mathematica evaluates definite
integrals in precisely that way".

Of course, later in his article he mentions the "real story", that,
"... above procedure cannot cover the whole variety of definite
integrals...".  E.g.

Integrate[Cos[Sin[x]], x]
Plot[Cos[Sin[x]], {x, 0, 2*Pi}, Axes -> False, Frame -> {True, True,
False, False}];
Integrate[Cos[Sin[x]], {x, 0, 2*Pi}]
NIntegrate[Cos[Sin[x]], {x, 0, 2*Pi}]

Integrate[Cos[Sin[x]], x]
(*plot to be displayed*)
2*Pi*BesselJ[0, 1]

Now, since David Cantrell's queries were stated very readable and
clear and further I also have more or less the same questions I just
copy from his original post (with slightly modifications for my

A little later, he (i.e. Adamchik) says "The origin of
along the path of integration is not in the method of indefinite
integration but rather in  the integrand."
If that were true, since the integrand cannot be changed, it would
seem that there would be absolutely no way to avoid discontinuities
along the path of integration.
But that is simply not the case! Here, for example, is an
antiderivative which is continuous along the whole real line:

FF[x_]=ArcTan[(4x + Sqrt[2(
        15 + Sqrt[241])])/(2 -
                Sqrt[2(-15 + Sqrt[241])])] + ArcTan[(4x - Sqrt[2(
              15 + Sqrt[241])])/(2 + Sqrt[2(-15 + Sqrt[241])])];

(*plot to be displayed*)

Doing a small parentheses in David's post, at this moment I will use
Mathematica in order to find an antiderivative which is continuous
along the whole real line:

Times@@Apply[#1[[1]] - #1[[2]] & , Solve[Denominator[f[x]] == 0, x],
Apart[(4 + 2*x + x^2)/%]
Map[FullSimplify, %, 1]
(Integrate[#1, x] & ) /@ %
Plot[%, {x, 0, 4}];
Chop[N[(%% /. x -> 4) - (%% /. x -> 0)]]
FullSimplify[D[%%%, x] == f[x]]

Returning now to David's post while it might be difficult to use
Mathematica to find FF(x), it is at
least easy to use Mathematica to confirm that it is an antiderivative
of f(x). Indeed

Simplify[D[FF[x], x] == f[x]]

(Continuing to copy from David's original post)

Adamchik mentions next that the four zeros of the integrand's
are two complex-conjugate pairs having real parts +/- 1.95334. It
seems that he is saying that, connecting these conjugate pairs by
line segments in the complex plane, we get two branch cuts...
BUT didn't the relevant branch cuts for his int cross the real axis
x = +/- 2,
rather than at x = +/- 1.95334?
(NOTE: The difference between 1.95334 and 2 is not due to numerical
Exactly what's going on here?

NSolve[Denominator[f[x]] == 0, x]
Show[GraphicsArray[Block[{$DisplayFunction = Identity},
(ContourPlot[#1[f[x + I*y]], {x, -4, 4}, {y, -4, 4}, Contours -> 50,
        PlotPoints -> 50, ContourShading -> False, Epilog -> {Blue,
AbsoluteThickness[2], Line[{{0, 0}, {4, 0}}]},
        PlotLabel -> #1[HoldForm[f[x]]]] & ) /@ {Re, Im}]], ImageSize
> 500];
Show[GraphicsArray[Block[{$DisplayFunction = Identity},
(ContourPlot[#1[F[x + I*y]], {x, -4, 4}, {y, -4, 4}, Contours -> 50,
        PlotPoints -> 50, ContourShading -> False, Epilog -> {Blue,
AbsoluteThickness[2], Line[{{0, 0}, {4, 0}}]},
        PlotLabel -> #1[HoldForm[F[x]]]] & ) /@ {Re, Im}]], ImageSize
> 500];

{{x -> -1.9533360788744223 - 0.2440276635405635*I}, {x ->
-1.9533360788744223 + 0.2440276635405635*I},
  {x -> 1.9533360788744223 - 0.7559723364594371*I}, {x ->
1.9533360788744223 + 0.7559723364594371*I}}
(*contour plots to be displayed*)

Later on, he says "Thinking hard, we can build an antiderivative that
not have a branch cut crossing a given interval of integration.
However, we
can never get rid of branch cuts!" I agree. Nevertheless, integration
along the
real line is often so useful that it would be nice to be able to ask
Mathematica, as an option, to give an antiderivative (such as my
contint-FF[x] in the current
post-above) which is continuous along the real line.

In the last part of that section, Adamchik notes that "...Integrate
may not
be able to detect all singular points on the interval of integration,
will result in a warning message..." But it's also worth noting that
such a
failure may occur without any warning message. A recent example was
posted to this newsgroup by Dimitris in the thread "integrate";

(see here:
e919391644135bdf?lnk=gst&q=integrate&rnum=11&hl=en#e919391644135bdf )

the problem with his last item seems to be caused by branch cuts of
EllipticF[z, m].

I would appreciate any kind of comments!

Thanks in advance!


  • Prev by Date: Re: Apart question
  • Next by Date: Limit question
  • Previous by thread: Re: Apart question
  • Next by thread: Limit question