MathGroup Archive 2007

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

Search the Archive

Re: Definite Integration in Mathematica 2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74469] Re: Definite Integration in Mathematica 2
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Thu, 22 Mar 2007 01:15:24 -0500 (EST)
  • References: <etqo3f$10i$1@smc.vnet.net>

And here is one case that evaluating first the indefinite integral and
then
apply the Newton-Leibniz formula is preferable than trust Definite
Integration
capabillities of Mathematica

Integrate[(2 - Sin[x])^(1/4), {x, 1, 4}]
N[%]
Integrate[(2 - Sin[x])^(1/4), x]
Simplify[Limit[%, x -> 4, Direction -> 1] - Limit[%, x -> 1, Direction
-> -1]]
Chop[N[%]]
NIntegrate[(2 - Sin[x])^(1/4), {x, 1, Pi/2, 4}]

-((1/
(5*Sqrt[3]*Gamma[7/4]))*(2*I*(5*Sqrt[Pi]*Gamma[5/4]*Hypergeometric2F1[5/4,
1/2, 7/4, 1/3] -
     2*Gamma[7/4]*(AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[1]), 2
- Sin[1]]*(2 - Sin[1])^(5/4) +
       AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[4]), 2 - Sin[4]]*(2
- Sin[4])^(5/4)))))
3=2E3356211372370748 - 2.324008709185599*I
(-(4/5))*AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[x]), 2 -
Sin[x]]*Sec[x]*Sqrt[1 + (1/3)*(-2 + Sin[x])]*(2 - Sin[x])^(5/4)*
  Sqrt[-1 + Sin[x]]
(4*I*(AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[1]), 2 - Sin[1]]*(2
- Sin[1])^(5/4) +
    AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[4]), 2 - Sin[4]]*(2 -
Sin[4])^(5/4)))/(5*Sqrt[3])
3=2E3356211372370748
3=2E3356211372353624

Interestingly

Drop[Expand[Integrate[(2 - Sin[x])^(1/4), {x, 1, 4}]], 1]
Chop[N[%]]

(8*I*AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[1]), 2 - Sin[1]]*(2 -
Sin[1])^(1/4))/(5*Sqrt[3]) -
  (4*I*AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[1]), 2 - Sin[1]]*(2
- Sin[1])^(1/4)*Sin[1])/(5*Sqrt[3]) +
  (8*I*AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[4]), 2 - Sin[4]]*(2
- Sin[4])^(1/4))/(5*Sqrt[3]) -
  (4*I*AppellF1[5/4, 1/2, 1/2, 9/4, (1/3)*(2 - Sin[4]), 2 - Sin[4]]*(2
- Sin[4])^(1/4)*Sin[4])/(5*Sqrt[3])
3=2E3356211372370743

(i.e. ommiting the whole Hypergeometric term)

Dimitris


=CF/=C7 dimitris =DD=E3=F1=E1=F8=E5:
> Hello to all of you!
>
> Firstly, I apologize for the lengthy post!
> Secondly, this post has a close connection with a recent (and well
> active!)
> thread titled "Integrate" and one old post of mine which was based on
> a older
> post of David Cantrell. Since there was no response and I do consider
> the
> subject very fundamental I would like any kind of insight.
>
> In the section about Proper Integrals in his article, Adamchik
> mentions that the Newton-Leibniz formula (i.e. the Fundamental
> Theorem 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
> (a,b).
>
> 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
> result
>
> Limit[F[x], x -> 4, Direction -> 1] - Limit[F[x], x -> 0, Direction -
> >1]
> N[%]
> NIntegrate[f[x], {x, 0, 4}]
>
> -ArcTan[1/4] - ArcTan[5/12]
> -0.6397697828266257
> 2.501822870767894
>
> This is because the antiderivative has a jump discontinuity at x=2
> (also at x = -2), so that the Fundamental theorem cannot be used.
>
> Indeed
>
> Limit[F[x], x -> 2, Direction -> #1]&/@{-1, 1}
> Show@Block[{$DisplayFunction=Identity},
>     Plot[F[x],{x,#[[1]],#[[2]]}]&/@Partition[Range[0,4,2],2,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, Direction
> -> -1])
> N[%]
> Pi - ArcTan[1/4] - ArcTan[5/12]
> 2.501822870763167
>
> Integrate works in precisely this way
>
> Integrate[f[x], {x, 0, 4}]
> N[%]
>
> Pi - ArcTan[1/4] - ArcTan[5/12]
> 2.501822870763167
>
> A little later, he (i.e. Adamchik) says "The origin of
> discontinuities
> along the path of integration is not in the method of indefinite
> integration but rather in  the integrand."
>
> Adamchik mentions next that the four zeros of the integrand's
> denominator
> are two complex-conjugate pairs having real parts +/- 1.95334. It
> then
> seems that he is saying that, connecting these conjugate pairs by
> vertical 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
> at x = +/- 2, rather than at x = +/- 1.95334?
>
> (NOTE: The difference between 1.95334 and 2 is not due to numerical
> error).
>
> Exactly what's going on here?
>
> 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];
> (*contour plots to be displayed*)
>
>
> Consider next the following function
>
> f[x_] = 1/(5 + Cos[x]);
>
> Then
>
> Integrate[f[x], {x, 0, 4*Pi}]
> N[%]
> NIntegrate[f[x], {x, 0, 4*Pi}]
>
> Sqrt[2/3]*Pi
> 2.565099660323728
> 2.5650996603270704
>
> F[x_] = Integrate[f[x], x]
> ArcTan[Sqrt[2/3]*Tan[x/2]]/Sqrt[6]
>
> D[F[x], x]==f[x]//Simplify
> True
>
> Plot[f[x], {x, 0, 4*Pi}, Ticks -> {Range[0, 4*Pi, Pi/2], Automatic}]
> Plot[F[x], {x, 0, 4*Pi}, Ticks -> {Range[0, 4*Pi, Pi/2], Automatic}]
>
> The antiderivative has jump discontinuities at Pi and 3Pi inside the
> integration range
>
> Table[(Limit[F[x], x -> n*(Pi/2), Direction -> #1] & ) /@ {-1, 1}, {n,
> 0, 4}]
> {{0, 0}, {ArcTan[Sqrt[2/3]]/Sqrt[6], ArcTan[Sqrt[2/3]]/Sqrt[6]}, {-(Pi/
> (2*Sqrt[6])), Pi/(2*Sqrt[6])},
>   {-(ArcTan[Sqrt[2/3]]/Sqrt[6]), -(ArcTan[Sqrt[2/3]]/Sqrt[6])}, {0,
> 0}}
>
> Reduce[5 + Cos[x] == 0 && 0 <= Re[x] <= 4*Pi, x]
> {ToRules[%]} /. (x_ -> b_) :> x -> ComplexExpand[b]
> x /. %;
> ({Re[#1], Im[#1]} & ) /@ %;
> poi = Point /@ %;
>
> x == 2*Pi - ArcCos[-5] || x == 4*Pi - ArcCos[-5] || x == ArcC=
os[-5] ||
> x == 2*Pi + ArcCos[-5]
> {{x -> Pi - I*Log[5 - 2*Sqrt[6]]}, {x -> 3*Pi - I*Log[5 - 2*Sqrt[6]]},
> {x -> Pi + I*Log[5 - 2*Sqrt[6]]},
>   {x -> 3*Pi + I*Log[5 - 2*Sqrt[6]]}}
>
> Of course F[4Pi]-F[0]=0 incorrectly.
>
> The reason for the discrepancy in the above result is not because of
> any problem with the fundamental theorem of calculus, of course; it is
> caused by the multivalued nature of the indefinite integral arctan.
>
>
> Show[GraphicsArray[Block[{$DisplayFunction = Identity},
>     (ContourPlot[#1[F[x + I*y]], {x, 0, 4*Pi}, {y, -4, 4}, Contours ->
> 50, PlotPoints -> 50, ContourShading -> False,
>        FrameTicks -> {Range[0, 4*Pi, Pi], Automatic, None, None},
> Epilog -> {{PointSize[0.03], Red, poi},
>          {Blue, Line[{{0, 0}, {4*Pi, 0}}]}}] & ) /@ {Re, Im}]],
> ImageSize -> 500]
>
> So, in this example the discontinuities are indeed from the branch
> cuts that start and end from the simple poles of the integrand which
> is in agreement with V.A. paper!
>
>
> I think I am not aware of something fundamental!
> Can someone point out what I miss?
>
>
> Regards
> Dimitris


"#FFFFFF">
  <tr>
    <td><table width="644" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="64"><img src="http://www.usa.canon.com/app/emails/eosmarch07/images/top_3_mar07.jpg"; width="644" 
height="64"></td>
      </tr>
      <tr>
        <td><table width="644" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
          <tr>
            <td height="97" colspan="2"><a href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.3.kvdilAs5RWz1dJ"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/main_img_01.gif"; width="644" height="97" border="0"></a></td>
            </tr>
          <tr>
            <td width="394" rowspan="2"><a href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.3.kvdilAs5RWz1dJ"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/main_img_02.jpg"; width="394" height="304" border="0"></a></td>
            <td width="250" height="112"><a href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.3.kvdilAs5RWz1dJ"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/main_img_03.gif"; width="250" height="112" border="0"></a></td>
          </tr>
          <tr>
            <td width="250" height="192"><a href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.3.kvdilAs5RWz1dJ"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/main_img_04.gif"; width="250" height="192" border="0"></a></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="4"><img src="http://www.usa.canon.com/app/emails/eosmarch07/images/greybar.gif"; width="644" 
height="4"></td>
      </tr>
      <tr>
        <td><table width="644" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="322" height="242"><a 
href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.5.x$VipZUb8V$WrS"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/eos5d_ef24-105.jpg"; width="322" height="242" border="0"></a></td>
            <td width="322" height="242"><a 
href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.7.AcE1Ouz95w8Xcy"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/eos30d_ef28-135.jpg"; width="322" height="242" border="0"></a></td>
          </tr>
          <tr>
            <td height="49" colspan="2"><a 
href="http://campman1.usa.canon.com/ema/www/r?1000064389.6114.9.VskROexR5HxSA0"; target="_blank"><img 
src="http://www.usa.canon.com/app/emails/eosmarch07/images/newlenskit.gif"; width="644" height="49" border="0"></a></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="12"><img src="http://www.usa.canon.com/app/emails/eosmarch07/images/greybar.gif"; width="644" 
height="12"></td>
      </tr>
      <tr>
        <td><table width="644" border="0" cellspacing="0" cellpadding="0">
          <tr>


  • Prev by Date: Re: Definite Integration in Mathematica
  • Next by Date: Applying a list of functions to a single number
  • Previous by thread: Re: a suprising result from Integrate (Null appeared in the result!)
  • Next by thread: Re: Re: Definite Integration in Mathematica 2