Mathematica's Definite Integration

New algorithms extend Mathematica's capabilities for calculating definite integrals.

by Victor Adamchik

The aim of this paper is to provide a short description of the definite integration algorithms implemented in Mathematica Version 3.0.

Proper Integrals

It is well known that

\(TraditionalForm
    \`∫\_a\%b\( f(x)\)dx = F(b) - F(a)\)

where F(x) is an antiderivative

F(x) = ∫f(x)dx

However, the Newton-Leibniz formula in the given form no longer holds if the function F(x) has singularities on an interval of integration (a, b). Let us consider the following integral

\(TraditionalForm
    \`∫\_0\%4
        \(\( x\^2 + 2\ x + 4\)\/\(x\^4 - 7\ x\^2 + 2\ x + 17
              \)\)dx\)

where the integrand is a smooth integrable function on the interval (0,  4).

Plot[
      (4  +  2*x  +  x^2)/(17  +  2*x  -  7*x^2  +  x^4), {
        x, 0, 4}]

It follows from the Risch structure theorem that the corresponding indefinite integral is expressible in elementary functions.

∫(((x^2) + 2 x + 4)/((x^4) - 7 (x^2) + 2 x + 17
              ))\[DifferentialD]x

Therefore, the standard way to evaluate the definite integral is to use the Newton-Leibniz theorem. However, if we simply substitute limits of integration into the antiderivative we get a wrong result.

Limit[%, x -> 4] - Limit[%, x -> 0]

This is because the antiderivative is not a continuous function on the interval (0, 4). It has a jump discontinuity at x = 2,  which is easy to see in the following graph.

Plot[%%,  {x,  0,  4}]

The correct way to apply the Newton-Leibniz theorem is to take into account the occurrence of the jump.

Limit[%2,  x -> 4,  Direction  ->  -1]  - 
      Limit[%2,  x -> 2,  Direction  ->    1]  + 
      Limit[%2,  x -> 2,  Direction  ->  -1]  - 
      Limit[%2,  x -> 0,  Direction  ->    1]

Mathematica evaluates definite integrals in precisely that way.

(∫_0^4)
        (( (x^2) + 2 x + 4)/((x^4) - 7 (x^2) + 2 x + 17
              ))\[DifferentialD]x

Discontinuities of antiderivatives along the path of integration are due to the nature of the integrand—not the method of indefinite integration. In the above example, the integrand has four singular poles that become branch points for the antiderivative.

NSolve[(x^4) - 7 (x^2) + 2 x + 17 == 0, x]

Connected in pairs these points make two branch cuts. The path of integration crosses one of them. The following ContourPlot clearly exposes the problem.

ContourPlot[Evaluate[Re[%2 /. x -> x + I y]],  {x,  -3,  4}, 
       {y,  -3,  4},  ContourShading -> False,  Contours  ->  20, 
       PlotPoints -> 40, 
      Epilog  -> {Hue[0], Thickness[0.005], Line[{{0, 0}, {4, 0}}]}]

We see that in a complex plane of the variable x the antiderivative has two branch cuts (bold black vertical lines) and the path of integration—the line (0,4)—intersects the right branch cut.  Obviously, by varying the constant of integration  we can change the form of the antiderivative so that we would get various forms of branch cuts. Here we understand the constant of integration as a function f(x) such that ((df(x))/dx) is zero. As a simple example let us consider the step-wise constant function ((Sqrt[(x^2)])/x)

Simplify[(∂_x)((Sqrt[ (x^2)])/x)]

Thinking hard, we can build an anderivative with no branch cut crossing a given interval of integration. However, we can never get rid of branch cuts!

Analysis of the singularities of antiderivatives is a time-consuming and sometimes heuristic process, especially if trigonometric or special functions are involved in antiderivatives.  In the latter case Integrate may not be able to detect all singular points on the interval of integration, which will result in a warning message.

You should pay attention to the message, since it warns you that the result of the integration might be wrong!

Improper Integrals

It is quite clear that the above procedure cannot cover all definite integrals. There are two reasons behind that. First, the corresponding indefinite integral may not be expressed in finite terms of functions represented in Mathematica. For instance,

∫Cos[Sin[x]]\[DifferentialD]x

However, the definite integral with specific limits of integration can be expressed as a Mathematica function.

(∫_0^π) Cos[Sin[x]]\[DifferentialD]x

Second, even if an indefinite integral is expressible, it may require a great deal of effort to find limits at the end points. Here is an example,

(∫_0^((π/2)))Tan[x]^(1/π)\[DifferentialD]x

This is an improper integral since the top limit is a singular point of the integrand. The   result of  indefinite integration is

∫Tan[x]^(1/π)\[DifferentialD]x

To find the limit at x = (π/2) one has to first develop the asymptotic expansion of the hypergeometric Gauss function at ∞, and second, construct the asymptotic scale for the Puiseux series. Currently, Mathematica's Series structure is based on  power series that allow only rational exponents.

In the next section, I present a short description of the algorithm for evaluating improper integrals. The overall idea has been given in [Marichev 1983] and  [Adamchik and Marichev 1990]. Some practical details regarding "logarithmic" cases are described in [Adamchik and Kilbig 1988] and [Adamchik 1995].

The General Idea

By means of the Mellin integral transform and Parseval's equality, a given improper integral is transformed to a contour integral over the straight line         \(TraditionalForm
      \`\((γ - i∞, 
        γ + i∞)\)\) in a complex plane of the parameter z:

\(TraditionalForm
    \`\(∫\_0\%∞\(\( f\_1\)(x)\)\ 
          \(\(f\_2\)(z\/x)\)dx\/x\  = 
      \(1\/\(2\ π\ i\)\)\(∫\_\(γ - 
              i∞\)\%\(γ + 
              i∞\)\(\(f\_1\%*\)(s)\)\(\(f\_2\%*\)(s)
              \)\(z\^\(-s\)\)ds
              \)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)\)

where \(TraditionalForm\`\(\(f\_1\%*\)(x)\)\ and\ \(\(f\_2\%*\)(x)\)\) are Mellin transforms of (Subscript[f, 1])(x)  and (Subscript[f, 2])(x)

\(TraditionalForm
    \`\(f\^*\)(s) = 
      ∫\_0
          \%∞\(\( f(x)\)\ x\^\(s - 1\)\)\[DifferentialD]x\)

The real parameter γ in formula (1) is defined by conditions of existence of Mellin transforms \(TraditionalForm\`\(\(f\_1\%*\)(x)\)\ and\ \(\(f\_2\%*\)(x)\)\). Finally, the residue theorem is used to evaluate the contour integral in the right side of formula (1)

\(\(1\/\(2\ π\ I\)\)           \(∮\_Γ\( f(z)\)               \[DifferentialD]z\)\) = \(∑\+\(k = 1\)\%m res\+\(z\  = \ a\_k\)\ \(f(z)\)\)

where Γ is a closed contour, and (Subscript[a, k]) are poles of f(z) that lie in a domain bounded by Γ. The success of this scheme depends on two factors: first, the Mellin image of an integrand  (Subscript[f, 1])(x) (Subscript[f, 2])((z/x)) must exist, and, second, it should be represented in terms of Gamma functions. If these conditions are satisfied, then the contour integral in (1), called the Mellin-Barnes integral or the Meijer G-function, can almost always be expressed in finite terms of hypergeometric functions. This fact is known as Slater's theorem (see [Marichev 1983] and  [Slater 1966]). We said "almost always", since there is a special case of the G-function when the latter cannot be reduced to hypergeometric functions but to their derivatives with respect to parameters. By analogy with linear differential equations with polynomial coefficients, such a singular case of the G-function is named a logarithmic case. The modified Bessel function (Subscript[K, 0])(z) is such a classical example, since its series representation

(Subscript[K, 0])(z)=\(\(-\(\(I\_0\)(z)\)\)\ \(log(z\/2)\)\)+(∑_(k = 0)^∞)((ψ(k + 1))/(((k!)^2))) (((((z^2)/4)))^k)

cannot be expressed via hypergeometrics.

Mellin-Barnes Integrals

These integrals are defined by

\(TraditionalForm
    \`\(1\/\(2\ π\ 
            I\)\)\(∮\_ℒ\( g(s)
            \)\(z\^\(-s\)\)\[DifferentialD]s\)\)

where

\(TraditionalForm
    \`g\ \((s)\) = 
      \(∏\+\(j = 1\)\%n Γ\ 
            \((a\_j + s)
              \)\(∏\+\(j = 1\)\%m Γ(b\_j - s)
                \)\)\/\(∏\+\(j = 1\)\%k Γ\ 
            \((c\_j + s)
              \)\(∏\+\(j = 1\)\%l Γ(d\_j - s)\)\)\)

and the contour ℒ is a line that separates poles of Γ ((Subscript[a, j]) + s) from Γ ((Subscript[b, j]) - s) [Luke 1969]. Let us investigate the existence of the integral. On a straight line ℒ, 
       = (γ - i∞, 
          γ + i∞) the real part of s ∈ ℒ is bounded, and \(TraditionalForm
      \`|Im(s)| -> 
        ∞\). Using the Stirling asymptotic formula

\(TraditionalForm
    \`\[LeftBracketingBar]Γ(x + I\ y)
          \[RightBracketingBar] = 
      \(\@\(2\ π\)\)\(\[LeftBracketingBar]y\[RightBracketingBar]\^\(x - 
              1\/2\)\)\(\(E\^\(\(-
                  \(π\/2\)\)\[LeftBracketingBar]y\[RightBracketingBar]\ 
              \)\)(1\  + \ O(1\/\[LeftBracketingBar]y\[RightBracketingBar]))
          \), \[LeftBracketingBar]y\[RightBracketingBar]\  -> 
      ∞\)

we can deduce that the integrand g(s)(z^(-s)) vanishes exponentially as |Im(s)|->∞ if m + n - k - l > 0, and |arg(z)|<(π/2)  (m+n-k-l). If m + n - k - l = 0, then z must be real and positive. Some additional conditions are required here (see details in [1]).

It is clear that we can not simply apply the residue theorem to this contour integral. We need initially to transform the contour ℒ to a closed one. There are two posssibilities: we can either transform ℒ into the left loop (Subscript[ℒ,  -∞]), the contour encircling all poles of Γ ((Subscript[a, j]) + s),  or to the right loop (Subscript[ℒ,  +∞]), the contour encircling the poles of Γ ((Subscript[b, j]) - s). The criteria for which contour should be chosen appear from the convergence of the integral along that contour. On the left-hand loop (Subscript[ℒ,  -∞]), the imaginary part of s∈(Subscript[ℒ,  -∞ ])is bounded and Re(s) -> -∞. Assuming that \(TraditionalForm
      \`|arg(\(-s\))| < π\/2\), and making use of the Stirling formula

\(TraditionalForm
    \`Γ(z) = 
      \@\(2\ π\)\ z\^\(z - 1\/2\)\ 
        \(\(E\^\(-z\)\)(1\  + \ O(1\/z))\), \ 
    z -> ∞, 
    \[LeftBracketingBar]arg(z)\[RightBracketingBar] < π\)

and the reflection formula of the Gamma function, we find that the Mellin-Barnes integral over the loop (Subscript[ℒ,  -∞]) exists, if n + l - m - k > 0. If n + l - m - k = 0, then z must be within the unit disk |z |  < 1. If z is on a unit circle |z |   =  1, the integral converges if

\(TraditionalForm
    \`Re(∑\+\(j = 1\)\%n a\_j + ∑\+\(j = 1\)\%m b\_j - 
          ∑\+\(j = 1\)\%k c\_j - ∑\+\(j = 1\)\%l d\_j) < 
      n - k - 1\)

On the right-hand loop (Subscript[ℒ,  +∞]), the imaginary part of s∈(Subscript[ℒ,  +∞ ])is bounded and Re(s) -> +∞. Proceeding as above, we find that the Mellin-Barnes integral over the loop (Subscript[ℒ,  +∞]) exists, if n + l - m - k < 0. If n + l - m - k = 0, then z must be outside of the unit disk. Additional conditions are required if z is on a unit circle.

After determining the correct contour, the next step is to calculate residues of  the integrand. Since the integrand contains only Gamma functions, this task is  more or less formal. We don't even need to calculate residues of the integrand, but  go straightforwardly to the generalized hypergeometric functions. The only obstacle is the logarithmic case, which occurs when the integrand has multiple poles. We have to separate two subcases here: the integrand that has a finite number of multiple poles, and the integrand that has infinitely many multiple poles. The Mathematica integration routine has a full implementation of the former case. In the latter, the integration is artificially restricted by the second-order poles, since for the higher-order poles it would lead to infinite sums with higher-order polygamma functions. This class of infinite sums is extremely hard to deal with, symbolically and numerically.  If such a situation is detected, Integrate  returns the Meijer G-function. However, there are some very special transformations of the G-function, which could avoid bulky infinite sums with polygamma functions, and give a nice result in terms of known functions. In [Adamchik 1995] I demonstrated a few transformations that reduce the order of the G-function and make it possible to handle special class of Bessel integrals in terms of Bessel functions.

An Example

Consider the integral

\(TraditionalForm
    \`Ω = 
      ∫\_0
          \%∞\(\(\ 
              sin(x)\)\/\(x\ \((x\^2 + 1)\)\)\)\[DifferentialD]x\)

According to the formula  (1), we have

\(TraditionalForm
    \`\(Ω = 
      \(∫\_0\%∞\( 1\/\(x\^2 + 1\)\)\(sin(1\/\(1/x\))\)\ 
            \[DifferentialD]x\/x = 
        \(1\/\(2\ π\ I\)\)\(∫\_\(γ - 
                I∞\)\%\(γ + 
                I∞\)\(\(f\_1\%*\)(s)\)\(\(f\_2\%*\)(s)
                \)\[DifferentialD]s\)\)\ \ \ \)\)

where \(TraditionalForm\`\(\(f\_1\%*\)(s)\)\ and\ \(\(f\_2\%*\)(s)\)\) are Mellin transforms of (e^(-x))  and sin((1/x)):

\(TraditionalForm
    \`\(f\_1\%*\)(s) = 
      ∫\_0\%∞ 1\/\(x\^2 + 1\)\ 
          \(x\^\(s - 1\)\)\[DifferentialD]x\)

\(TraditionalForm
    \`\(f\_2\%*\)(s) = 
      ∫\_0\%∞\( sin(1\/x)\)\ 
          \(x\^\(s - 1\)\)\[DifferentialD]x\)

Therefore,

\(TraditionalForm
    \`\(Ω = 
      \(\(-π\)\/\(4\ π\ I\)\)\(∫\_\(γ - 
              I∞\)\%\(γ + 
              I∞\)\(Γ(\(-s\))
              \)\[DifferentialD]s\)\ \ \ \)\)

where γ is defined by conditions of the existence of Mellin transforms

0 < γ = Re(s) < 1

As it follows from the previous section we can transform the integration contour  \(TraditionalForm
      \`\((γ - ∞, γ + i∞)\)\) into the right loop (Subscript[ℒ,  +∞]) . Then, using the residue theorem we evaluate the integral as a sum of residues  at simple poles s = 1, 2, ... .

\(TraditionalForm
    \`Ω = 
      \(-\(π\/2\)\)\(∑\+\(k = 1\)\%∞\(\((\(-1\))\)\^k\ \ 
            \)\/\(k!\)\)\)

Meijer G-Function

We did not give a complete picture of the Meijer G-function here, but only necessary facts. In Version 3.0 the G-function is defined by

\(MeijerG[{{a\_1, a\_2, \ ...\ , a\_n}, {a\_\(n + 1\), a\_\(n + 2\),                 \ ...\ , a\_p}}, {{b\_1, b\_2, \ ...\ , b\_m}, {b\_\(m + 1\),                 b\_\(m + 2\), \ ...\ , b\_q}}\ , z]\) =
	            (Subscript[G, p, q]^(m, n))(z\[VerticalSeparator]({{(Subscript[a, 1]), , (Subscript[a, 2]), }, {(Subscript[b, 1]), , (Subscript[b, 2]), }})({{\(...\ , \), (Subscript[a, p])}, {\(...\ , \), (Subscript[b, q])}})) =
	             \(\(1\/\(2\ π\ I\)\)               \(∮\_ℒ\(\(∏\+\(i = 1                             \)\%m\( Γ(b\_i + s)\)                          \(∏\+\(i = 1\)\%n Γ(                               1 - a\_i - \ s)\)\                       \)\/\(∏\+\(i = n + 1\)\%p                           \( Γ(a\_i + s)\)                          \(∏\+\(i = m + 1\)\%q Γ(                               1 - b\_i - s)\)\)\) \(z\^\(-s\)\)                   \[DifferentialD]s\)\)

and the contour ℒ is a left (or right) loop (Subscript[ℒ,  -∞]) (or (Subscript[ℒ,  +∞])) separated poles of Γ ((Subscript[b, j]) + s) from Γ (1 - (Subscript[a, j]) - s). The current implementation of the Meijer function has two noticeable features that distinguish it from the classical G-function. First, one is not allowed to choose or move the contour of integration, and, second, MeijerG has an optional parameter (the classical G-function does not) that regulates the branch cut. The Meijer function is supported symbolically and numerically.

MeijerG[{{0},  {}},  {{0},  {}},  z]

MeijerG[{{-1},  {1, 2}},  {{0, 1/2},  {}},  1/2]

N[%]

Only in trivial cases is MeijerG simplified automatically to the lower-level special functions. Beyond that all further transformations are assigned to FunctionExpand:

FunctionExpand[%%]

MeijerG is used with indefinite and definite integration and with solving linear differential equations with polynomial coefficients. Here is an example related to definite integration:

\(TraditionalForm
    \`∫\_1
        \%∞\(\( x\^2\ 
              \(\(K\_0\)(x)\)\)\/\@\(x\^2 - 1\)\)\[DifferentialD]x\)

The first element of the second argument of MeijerG, which is {-1,0,0}, indicates that the integrand of the corresponding contour integral contains the product of three Gamma functions Γ(s - 1)Γ(s)Γ(s) and has an infinite number of triple poles at s=-k, k=0,1,2, ... . From the design point of view it is definitely an advantage for Integrate  to return a short object, MeijerG, rather than enormous infinite sums involving derivatives of the Gamma function.

Hypergeometric Functions

Essential to integration is the generalized hypergeometric function, defined by

HypergeometricPFQ[{(Subscript[a, 1]), ..., (Subscript[a, p])}, {(Subscript[b, 1]), ..., (Subscript[b, q])}, z]=(Subscript[, p])(Subscript[F, q])(z\[VerticalSeparator]({{(Subscript[a, 1]), , (Subscript[a, 2]), }, {(Subscript[b, 1]), , (Subscript[b, 2]), }})({{\(...\ , \), (Subscript[a, p])}, {\(...\ , \), (Subscript[b, q])}})) =
		\(∑\+\(k = 0                 \)\%∞\(\(∏\+\(j = 1\)\%p\((a\_j)\)\_k                  \)\/\(∏\+\(j = 1\)\%q\((b\_j)\)\_k\ \)\)               z\^k\/\(k!\)\)

where (Subscript[((a)), k]) is a Pochhammer symbol

\(TraditionalForm
    \`\((a\_j)\)\_k\  = 
      \(∏\+\(l = 1\)\%k\((a\_j\  + \ l - 1)\) = 
        \(Γ(a\_j + k)\)\/\(Γ(a\_j)\)\)\)

Conditions of convergence can be easily obtained by applying the d'Alembert test. It follows that (Subscript[, p])(Subscript[F, q]) converges for all finite z if p ≤ q, and for |z| < 1 if p = q + 1. Additional conditions are required on the circle of convergence |z|=1. The above series definition of (Subscript[, p])(Subscript[F, q]) has an exceptional case. When p = 2 and q = 0, HypergeometricPFQ is defined via the confluent hypergeometric function HypergeometricU.

(Subscript[ , 2]) (Subscript[F, 0])(a,b;;z)

For \(TraditionalForm
      \`|z| ⩾ 1\) and p = q + 1, the hypergeometric function is defined as an analytic continuation via the Mellin-Barnes integral, with the branch cut [1, ∞):

(Subscript[, q + 1])(Subscript[F, q])(z\[VerticalSeparator]({{(Subscript[a, 1]), , (Subscript[a, 2]), }, {(Subscript[b, 1]), , (Subscript[b, 2]), }})({{\(...\ , \), (Subscript[a, q + 1])}, {\(...\ , \), (Subscript[b, q])}})) =
	\(\(\(∏\+\(k = 1\)\%q Γ(b\_k)                   \)\/\(∏\+\(k = 1\)\%\(q + 1\)Γ(a\_k)                   \)\) \(1\/\(2  π\ I\)\)           \(∫\_\(γ -                 I∞\)\%\(γ +                 I∞\)\(\(Γ\ \((s)\)                    \(∏\+\(j = 1\)\%\(q + 1\)Γ                        \((a\_j - s)\)\)\)\/\(∏\+\(j = 1\)\%q                       Γ\ \((b\_j - s)\)\)\)               \(\((\(-z\))\)\^\(-s\)\) \[DifferentialD]s\)\)

where the straight line \(TraditionalForm
      \`\((γ - i∞, 
        γ + i∞)\)\) separates poles of Γ(s) from Γ ((Subscript[a, j]) - s).

Almost all symbolic simplifications of (Subscript[, p])(Subscript[F, q]) to the lower level functions are done automatically

(Subscript[ , 2]) (Subscript[F, 1])((1/3),(1/3);(4/3);(1/2))

(Subscript[ , 3]) (Subscript[F, 2])(1,(1/3),(1/3);(4/3),(4/3);1)

(Subscript[ , 4]) (Subscript[F, 3])(1,1,1,1;4,4,4;1)

The exception is the Gauss function Hypergeometric2F1. Since Hypergeometric2F1 has so many different transformation and simplification rules, some of them are assigned to FunctionExpand:

(Subscript[ , 2]) (Subscript[F, 1])(1,(1/4);(5/4);(1/4))

FunctionExpand[%]

New Classes of Integrals

In this section I give a short overview of  specific classes of definite integrals that are significantly improved in version 3.0. Mathematica now is able to calculate about half of the definite and almost all indefinite integrals from the well-known collection of integrals compiled by Gradshteyn and Ryzhik. Moreover, Version 3.0 makes it possible to calculate thousands of new integrals not included in any published handbook.

integrals of rational functions

The RootSum object has been linked to Integrate to display the result of integration in a more elegant and shorter way.

(∫_0^1)
        (( x - 1)/((x^7) + (x^3) + 1))\[DifferentialD]x

logarithmic and polylogarithmic integrals

(∫_0^1)
        (( (x^2) Log[x] Log[1 + x])/(1 + x))\[DifferentialD]x

\(∫\_0\%1
        \( Log[1 - x]\^3\/\((1 - x\ z)\)\^2\)\[DifferentialD]x\)

elliptic integrals

The package is now autoloaded (as are as all other integration packages).

(∫_(-
          (π/4))^((π/4)))(1/(Sqrt[Cos]))[x]\[DifferentialD]x

(∫_0^((π/2)))(x/(Sqrt[Sin]))[x]\[DifferentialD]x

integrals involving Bessel functions

(∫_0
        ^∞) t Exp[-(t^2)] BesselI[2, t] 
          BesselK[2, t]\[DifferentialD]t

(∫_0
        ^∞)(( BesselJ[1, x] Exp[-(2/x)])/x)
            \[DifferentialD]x

(∫_0^∞) AiryAi[x]^2\[DifferentialD]x

integrals involving non-analytic functions

(∫_(-1 - I)^(2 + 2 I))Sin[Abs[x]]\[DifferentialD]x

(∫_0
        ^(((3 π)/2)))Max[Sin[x], Cos[2 x]]\[DifferentialD]x

Additional Features

Mathematica's capability for definite integration has gained substantial power in the new version. Other essential features of Integrate not discussed in the previous sections include convergence tests and the assumptions mechanism.

Conditions

In Version 3.0 Integrate is "conditional." In most cases, if the integrand or limits of integration contains symbolic parameters, Integrate returns an If statement of the form

If[ conditions, answer, held integral ]

which gives necessary conditions for the existence of the integral. For example

(∫_0
        ^∞) (x
            ^(λ - 1))(E^(-α x
              ))\[DifferentialD]x

Setting the option GenerateConditions to False prevents Integrate from returning conditional results (as in Version 2.2):

Integrate[
      (x^(λ - 1)) Exp[-α x], {x, 0, ∞}, 
      GenerateConditions -> False]

If a given definite integral has symbolic parameters, then the result of integration essentially depends on certain specific conditions  on those parameters. In this example the  restrictions  Re(α) > 0  and  Re(λ) > 0 come from conditions of the convergence.  Even when a definite integral is convergent, other conditions on parameters may appear. For instance, the presence of singularities on the integration path could lead to essential changes when the parameters  vary. The next section is devoted to the convergence of definite integrals.

Convergence

The new integration code contains criteria for the convergence of definite integrals. In each case Integrate examines the integrand for convergence

(∫_(-1)^1) Cos[x]/x\[DifferentialD]x

This integral has a nonintegrable singularity at x = 0. Thus, Integrate generates a warning message and returns unevaluated. However, the integral exists in the Cauchy sense. Setting the option PrincipalValue to True, we obtain

\(TraditionalForm
    \`Integrate[\(cos(x)\)\/x, {x, \(-1\), 1}, PrincipalValue -> True]
         // FullSimplify\)

Consider another integral with a symbolic parameter α

(∫_0^1) (x^(ρ - 1)) ArcTan[x]\[DifferentialD]x

The integral has a singular point at x = 0, which is integrable only if Re(ρ) > -2.

If you are sure that a particular integral is convergent or you don't care about the convergence, you can avoid testing the convergence by setting the option GenerateConditions to False. This will make Integrate return an answer a bit faster.

Setting GenerateConditions to False also lets you evaluate divergent integrals

\(TraditionalForm
    \`Integrate[1\/x, {x, 0, 2}, GenerateConditions -> False]\)

Assumptions

The new option Assumptions is used to specify particular assumptions on parameters in definite integrals. Consider the integral with the arbitrary parameter y

\(TraditionalForm
    \`∫\_0
        \%∞\( E\^\(\(-x\^2\) - x\ y\)\/\@x
              \)\[DifferentialD]x\)

Here we set the option Assumptions to Re(y) > 0

\(TraditionalForm
    \`Integrate[
      E\^\(\(-x\^2\) - x\ y\)\/\@x, {x, 0, ∞}, 
      Assumptions -> Re(y) > 0]\)

Setting Assumptions to Re(y) < 0, we get a different form of the answer

\(TraditionalForm
    \`Integrate[
      E\^\(\(-x\^2\) - x\ y\)\/\@x, {x, 0, ∞}, 
      Assumptions -> Re(y) < 0]\)

although the integral is a continuous function with respect to the parameter y

Plot[
      NIntegrate[Exp[-(x^2) - x y]/(Sqrt[x]), {x, 0, ∞}], {y, 
        -2, 2}]

The next integral is discontinuous with respect to the parameter γ

\(TraditionalForm
    \`Integrate[
      \(\(cos(x)\)\ \((1 - cos(γ\ x))\)\)\/x\^2, {x, 0, ∞}, 
      Assumptions -> γ > 1]\)

\(TraditionalForm
    \`Integrate[
      \(\(cos(x)\)\ \((1 - cos(γ\ x))\)\)\/x\^2, {x, 0, ∞}, 
      Assumptions -> \(-1\) < γ < 1]\)

\(TraditionalForm
    \`Integrate[
      \(\(cos(x)\)\ \((1 - cos(γ\ x))\)\)\/x\^2, {x, 0, ∞}, 
      Assumptions -> γ < \(-1\)]\)

If the given assumptions exactly match the generated assumptions, then the latter won't show up in the output; otherwise, Integrate produces assumptions complementary to ones given:

\(TraditionalForm
    \`Integrate[x\^\(ν - 1\)\ \((1 - x)\)\^\(μ - 1\), {x, 0, 1}, 
      Assumptions -> Re(ν) > 0]\)

References

1. Marichev, O.I.,  Handbook of integral transforms of higher transcendental functions: theory and algorithmic tables, Ellis Horwood, 1983.

2.  Adamchik, V. S. and Kolbig, K. S.,  A definite integral of a product of two polylogarithms, SIAM J. Math. Anal. 4(1988), 926-938.

3. Adamchik, V. S.  and Marichev, O.I., The algorithm for calculating integrals of hypergeometric type functions and its realization in REDUCE system, Proc. Conf. ISSAC'90, Tokyo (1990), 212-224.

4. Adamchik, V. S., The evaluation of integrals of Bessel functions via G-function identities, J. Comp. Applied Math. 64(1995), 283 - 290.

5. Slater, L.J., Generalized Hypergeometric Functions, Cambridge Univ. Press, 1966.

6. Luke, Y.L., The Special Functions and Their Approximations, Vol.1, Academic Press, 1969.

About the Author

Standard for Victor

Electronic Subscriptions

Included in the distribution for each electronic subscription is the file DefIntegral.nb, containing Mathematica code for the material described in this article.