An Algorithm for Trigonometric-Logarithmic Definite Integrals

John M. Campbell

We present a Mathematica implementation of an algorithm for computing new closed-form evaluations for classes of trig-logarithmic and hyperbolic-logarithmic definite integrals based on the substitution of logarithmic functions into the Maclaurin series expansions of trigonometric and hyperbolic functions. Using this algorithm, we offer new closed-form evaluations for a variety of trig-logarithmic integrals that state-of-the-art computer algebra systems cannot evaluate directly. We also show how this algorithm may be used to evaluate interesting infinite series and products.

1. Introduction

Although there are many well-known techniques for the symbolic evaluation of definite integrals, such as Slater’s convolution method, there are many open issues concerning symbolic definite integration using computer algebra systems [– ]. Computing a closed-form expression for a definite integral often easily reduces to the evaluation of the corresponding indefinite integral, but there are many natural definite integrals of elementary functions that cannot be directly evaluated following that procedure []. This article considers the general problem of the symbolic computation of trig-logarithmic and hyperbolic-logarithmic definite integrals. Integrals of this form are interesting in part because they often have surprising, simple and elegant closed-form evaluations involving special functions such as the gamma function and the generalized Riemann zeta function. They may also be used to evaluate infinite series:

(∑_(n=1)^∞)((((-1))^(n+1))/(Sqrt[8 (n^3)+(((4 (n^2)+1))^(3/2))+2 n]))=(1/2) i ((Zeta2[(1/2), 1+(i/2)])-(Zeta2[(1/2), 1-(i/2)])-(Sqrt[2]) (Zeta2[(1/2), 1+(i/4)])+(Sqrt[2]) (Zeta2[(1/2), 1-(i/4)]))≈0.161257….

In this article, we are primarily concerned with the evaluation of integrals involving an expression of the form (Subscript[ϕ, 1])=cos(c log(x)) or (Subscript[ϕ, 2])=sin(c log(x)), where c is a complex number and x is a variable. Integrals of this form emerge in a natural context within physics and engineering, since the Cauchy–Euler differential equation (x^2)ϕ''+x ϕ'+(c^2)ϕ=0 yields the basic solutions (Subscript[ϕ, 1]) and (Subscript[ϕ, 2]). For example, there are applications based on integrals involving these basic solutions related to the Einstein–Barber field equations [, ].

Integrals with an integrand involving a trigonometric function composed with a logarithmic function as a factor are also interesting because there are many integrals of this form that cannot be directly evaluated by state-of-the-art computer algebra systems. For example, consider the definite integral (∫_( 0)^( 1))((sin(log x))/((x+1) log x))dx. Mathematica 11.2 is not able to directly evaluate this definite integral nor the underlying indefinite integral.

Here is a numerical approximation.

NIntegrate[((Sin[Log[x]])/((x+1) Log[x])),{x,0,1}]

A natural way to evaluate the symbolic definite integral would be to expand the integrand by substituting log x into the Maclaurin series for the sine function and then use Mathematica to evaluate the corresponding infinite series.

Evaluate the expression (∫_( 0)^( 1))(((log^n)(x))/(x+1))dx using Mathematica. This integral would occur in the term-by-term expansion.

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

The Maclaurin series substitution technique applied to this integral gives the series (∑_( n=1)^( ∞))((((4^n)-1) (Zeta[2 n+1]))/((((-4))^n) (2 n+1))). Here is a numerical approximation.

N[(∑_(n=1)^∞)((((4^n)-1)Zeta[2 n+1])/((((-4))^n)(2n+1)))+Log[2],6]

Mathematica is able to evaluate the series involving the Riemann zeta function, leading to the elegant closed-form evaluation for the definite integral (∫_( 0)^( 1))((sin(log x))/((x+1) (log x)))dx that we have previously noted [].

(∑_(n=1)^∞)((((4^n)-1)Zeta[2 n+1])/((((-4))^n)(2n+1)))+Log[2]

In this article, we generalize the strategy illustrated using a Mathematica program for a function TIntegrate that extends the built-in Wolfram Language Integrate function with respect to definite integrals so as to be able to find new evaluations for a large variety of trig-logarithmic and hyperbolic-logarithmic integrals that Mathematica 11.2 is not able to directly evaluate otherwise. The underlying algorithm of the TIntegrate function is based on the substitution of logarithmic functions into the Maclaurin series expansions of certain trigonometric/hyperbolic expressions within numerators of integrands, as illustrated in the preceding example. Since Mathematica is able to evaluate a large variety of integrals involving powers of logarithmic functions, the TIntegrate function is able to evaluate a large variety of interesting and natural definite integrals. Also, the TIntegrate function may be used to prove new evaluations for interesting infinite series:

(∑_(n=1)^∞)(1/(Sqrt[((n^2)+1) ((Sqrt[(n^2)+1])+n)]))=-((i ((Zeta2[(1/2), 1-i])-(Zeta2[(1/2), 1+i])))/(Sqrt[2]))≈1.54655….

We begin by offering a variety of illustrations of applications of this algorithm. The integration results given in this article are new in the sense that Mathematica 11.2 is not able to evaluate the definite integrals. The TIntegrate function is documented in the Mathematica package corresponding to this article.

Get["TIntegratePackage.m"]

In Section , we discuss some nuances concerning TIntegrate. In Section , we summarize the main capabilities of this function. In Section , we discuss some avenues for future research related to the TIntegrate function.

In this article, Mathematica 11.2 was used to generate results; earlier versions may be too slow.

2. Integrands Involving the Sine Function Composed with Logarithmic Functions

Given an integral involving an expression of the form sin(c log x), where c is a complex number, the TIntegrate function generalizes the strategy outlined in Section  to attempt to evaluate the corresponding integral. The TIntegrate function uses the Maclaurin series for the sine function, substitutes a logarithmic function into this power series and integrates it term by term. The resulting infinite series often involves the generalized Riemann zeta function. For example, consider the definite integral (∫_( 0)^( 1))((((x^2)+(Sqrt[x])+2) sin(log x))/((x+1) log x))dx.

Integrate[(((2+(Sqrt[x])+(x^2)) Sin[Log[x]])/((1+x) Log[x])),{x,0,1}]

TIntegrate[(((2+(Sqrt[x])+(x^2)) Sin[Log[x]])/((1+x) Log[x])),{x,0,1}]

The TIntegrate function is also able to compute new evaluations of integrals involving expressions such as (Sqrt[log x]).

Integrate[(((x^(1/3)) ((Sqrt[Log[x]])-((Log[x])^(2/3))) Sin[Log[x]])/(1+x)),{x,0,1}]

TIntegrate[(((x^(1/3)) ((Sqrt[Log[x]])-((Log[x])^(2/3))) Sin[Log[x]])/(1+x)),{x,0,1}]

TIntegrate is also able to compute new evaluations of integrals involving a factor such as log x-2sin(1/2 log x).

Integrate[((x (Log[x]-2 Sin[((Log[x])/2)]))/((-1+x) Log[x])),{x,0,1}]

TIntegrate[((x (Log[x]-2 Sin[((Log[x])/2)]))/((-1+x) Log[x])),{x,0,1}]

2.1. Related Series Results

Integration results such as those in Section  may be used to prove interesting infinite series formulas using this identity:

(∫_( 0)^( 1))(((x^n) sin(log x))/(log x))dx=(tan^(-1))((1/(n+1))).

This elegant infinite series formula is easily verified using equation () together with the TIntegrate function:

(∑_(n=0)^∞)(((-1))^n) (tan^(-1))((1/(n+1)))=log(2 (((((((Gamma[1-(i/2)])^2) (Gamma[1+i]))/(((Gamma[1+(i/2)])^2) (Gamma[1-i])))))^(i/2))).

To prove it, use () with the Maclaurin series expansion of the expression (1/(x+1)) within the integrand of (∫_( 0)^( 1))((sin (x log))/((x+1) (x log)))dx. It is known that (∑_( n=1)^( ∞))(((-1))^(n+1)) (tan^(-1))((1/n))=log(2)-Arg((Binomial[i, (i/2)])) [], and several elegant proofs of this formula are given in []. Similar formulas, such as the following new infinite series formulas, may be proven similarly.

Proposition 1

(∑_(n=1)^∞)(((((-1))^n) ((Sqrt[(n^2)+1])+2 n))/(Sqrt[((((n^2)+1))^3) ((Sqrt[(n^2)+1])+n)]))=(1/2) i ((Zeta2[(3/2), 1+(i/2)])-(Zeta2[(3/2), 1-(i/2)])+(Sqrt[2]) ((Zeta2[(3/2), 1-i])-(Zeta2[(3/2), 1+i])))≈-0.583937….

Proof

Begin by evaluating (∫_( 0)^( 1))(((Sqrt[log x]) sin(log x))/(x+1))dx.

TIntegrate[(((Sqrt[Log[x]]) Sin[Log[x]])/(1+x)),{x,0,1}]

Expand the factor (1/(x+1)) in the integrand as a Maclaurin series, (((Sqrt[log x]) sin(log x))/(1+x))=(∑_( n=0)^( ∞))(((-1))^n) (x^n) (Sqrt[log x]) sin(log x). The desired result follows by integrating both sides of this equality using the evaluation and simplifying the resultant summand. □

Proposition 2

(∑_(n=2)^∞)((tan^(-1))((2/n))-(2/n))=-2 ℽ+2+log((((((Gamma[2-2 i])/(Gamma[2+2 i]))))^(-(i/2))))≈-0.391226….

Proof

First evaluate (∫_( 0)^( 1))((sin(log x)-log x)/(((Sqrt[x])-1) log x))dx.

TIntegrate[((-Log[x]+Sin[Log[x]])/((-1+(Sqrt[x])) Log[x])),{x,0,1}]

We have that ((sin (log x)-log x)/(((Sqrt[x])-1) log x))=(∑_( n=0)^( ∞))-(((x^( n/2)) (sin (log x)-log x))/(log x)). Integrating both sides of this equality using the evaluation may be used to finish the proof. □

Proposition 3

(∑_(n=1)^∞)(1/(Sqrt[((n^2)+1) ((Sqrt[(n^2)+1])+n)]))=-((i ((Zeta2[(1/2), 1-i])-(Zeta2[(1/2), 1+i])))/(Sqrt[2]))≈1.54655….

Proof

Evaluate (∫_( 0)^( 1))((sin(log x)-log x)/((x-1) (Sqrt[log x])))dx.

TIntegrate[((-Log[x]+Sin[Log[x]])/((-1+x) (Sqrt[Log[x]]))),{x,0,1}]

To evaluate the preceding infinite series, expand the factor (1/(x-1)) within the integrand, integrate the resultant summand and use the evaluation of the integral. □

Proposition 4

(∑_(n=1)^∞)((((-1))^(n+1))/(Sqrt[8 (n^3)+(((4 (n^2)+1))^(3/2))+2 n]))=(1/2) i ((Zeta2[(1/2), 1+(i/2)])-(Zeta2[(1/2), 1-(i/2)])-(Sqrt[2]) (Zeta2[(1/2), 1+(i/4)])+(Sqrt[2]) (Zeta2[(1/2), 1-(i/4)]))≈0.161257….

Proof

Evaluate (∫_( 0)^( 1))((sin(((log x)/2)))/((x+1) (Sqrt[log x])))dx.

TIntegrate[((Sin[((Log[x])/2)])/((1+x) (Sqrt[Log[x]]))),{x,0,1}]

Expand the factor (1/(x+1)) and follow the technique used in the previous proofs.

3. Integrands Involving the Cosine Function Composed with Logarithmic Functions

The TIntegrate function is able to evaluate a variety of definite integrals involving expressions of the form cos(c log x), where c is a complex number.

Integrate[((-1+Cos[Log[x]])/((1+x) Log[x])),{x,0,1}]

TIntegrate[((-1+Cos[Log[x]])/((1+x) Log[x])),{x,0,1}]

The evaluation of this trig-logarithmic integral involves Catalan’s constant.

Integrate[((-1+Cos[Log[x]])/((1+(x^2)) ((Log[x])^2))),{x,0,1}]

TIntegrate[((-1+Cos[Log[x]])/((1+(x^2)) ((Log[x])^2))),{x,0,1}]

This one involves the Glaisher–Kinkelin constant.

Integrate[(((Sqrt[x]) (-1+Cos[Log[x]]))/((1+(Sqrt[x])) ((Log[x])^2))),{x,0,1}]

TIntegrate[(((Sqrt[x]) (-1+Cos[Log[x]]))/((1+(Sqrt[x])) ((Log[x])^2))),{x,0,1}]

Here c=2/3.

Integrate[((Cos[((2 Log[x])/3)] (Sqrt[x Log[x]]))/(1-x)),{x,0,1}]

TIntegrate[((Cos[((2 Log[x])/3)] (Sqrt[x Log[x]]))/(1-x)),{x,0,1}]

3.1. Related Series Results

We prove the following well-known infinite product formula following the strategy used in Section 2.: evaluate (∫_( 0)^( 1))((cos(log x)-1)/((1-x) log x))dx, substitute the Maclaurin series for (( 1)/(1-x)) into this integral and integrate term by term.

(∏_(n=1)^∞)((Sqrt[(n^2)+1])/n)=(Sqrt[((sinh(π))/π)]).

Similarly, we prove the following new infinite series formulas.

Proposition 5

(∑_(n=1)^∞)(((-1))^n) (Sqrt[(((Sqrt[(n^2)+1])+n)/((n^2)+1))])=(Zeta2[(1/2), 1+(i/2)])+(Zeta2[(1/2), 1-(i/2)])-(1/(Sqrt[2]))((Zeta2[(1/2), 1-i])+(Zeta2[(1/2), 1+i]))≈-0.598158….

Proof

First evaluate (∫_( 0)^( 1))((cos(log x))/((1+x) (Sqrt[log x])))dx.

TIntegrate[((Cos[Log[x]])/((1+x) (Sqrt[Log[x]]))),{x,0,1}]

Expanding (1/(1+x)) in the preceding integrand,

(∑_(n=0)^∞)(((((-1))^n) (x^n) cos(log x))/(Sqrt[log x]))=((cos(log x))/((1+x) (Sqrt[log x]))).

Integrating both sides of this equation using the integral evaluation and simplifying yields the desired result. □

Proposition 6

(∑_(n=1)^∞)((cos((5/4) (cot^(-1))(n)))/((((n^2)+1))^(5/8)))=(1/2) ((Zeta2[(5/4), 1-i])+(Zeta2[(5/4), 1+i]))≈3.77106….

Proof

Evaluate (∫_( 0)^( 1))((((log x)^(1/4)) cos(log x))/(1-x))dx.

TIntegrate[((Cos[Log[x]] ((Log[x])^(1/4)))/(1-x)),{x,0,1}]

To evaluate the series, expand (1/(1-x)) in the integrand, integrate the resultant summand and simplify, and use the integral evaluation. □

Proposition 7

(∑_(n=1)^∞)(((-1))^n) (Sqrt[(((Sqrt[4 (n^2)+1])+2 n)/(4 (n^2)+1))])=(1/2) (-(Zeta2[(1/2), 1+(i/2)])-(Zeta2[(1/2), 1-(i/2)])+(Sqrt[2]) (Zeta2[(1/2), 1+(i/4)])+(Sqrt[2]) (Zeta2[(1/2), 1-(i/4)]))≈-0.537167….

Proof

Evaluate (∫_( 0)^( 1))((cos(((log x)/2)))/((x+1) (Sqrt[log x])))dx.

TIntegrate[((Cos[((Log[x])/2)])/((1+x) (Sqrt[Log[x]]))),{x,0,1}]

The series may then be evaluated like the others. □

4. Discussion

As discussed in Section , the TIntegrate function is based on the substitution of logarithmic functions into Maclaurin series. Our implementation is in many ways based on the use of string manipulation through Wolfram Language string operations such as StringCount. Given an integrand f[x] as input, the TIntegrate function converts the numerator of f[x] to a string and determines whether the numerator of f[x] contains trigonometric, hyperbolic or logarithmic expressions. If f[x] contains a suitable combination of functional expressions, such as a sine function and a logarithmic function, TIntegrate uses string manipulation to determine whether Mathematica 11.2 is able to evaluate a definite integral involving logarithmic powers that is needed to evaluate an infinite series, following the technique described in Section . If Mathematica 11.2 is able to compute a closed-form evaluation for this log-power integral, then the TIntegrate function uses such an evaluation to evaluate the infinite series.

The TIntegrate function is an extension of the Integrate function in terms of definite integrals, in the sense that if the Integrate function is able to evaluate a definite integral, then TIntegrate returns the same evaluation. However, TIntegrate does not extend Integrate with respect to indefinite integrals. Also, there are certain classes of definite integrals that neither the Integrate function nor TIntegrate can evaluate (as an infinite series or otherwise).

Integrate[((Log[1-x] (Log[x]-3 Sinh[((Log[x])/3)]))/(Log[x])),{x,0,1}]

TIntegrate[((Log[1-x] (Log[x]-3 Sinh[((Log[x])/3)]))/(Log[x])),{x,0,1}]

5. Summary

The TIntegrate function is able to directly compute new evaluations for a variety of integrals of the following forms that cannot be directly computed by state-of-the-art computer algebra systems (here c, (Subscript[a, 1]), (Subscript[a, 2]), etc. denote complex numbers).

(∫_( 0)^( 1))((sin(c log x))/(1±(x^h)))p(x) dx,

(∫_( 0)^( 1))((sin(c log x)-c log x)/(1±(x^h)))p(x)dx,

(∫_( 0)^( 1))((cos(c log x))/(1±(x^h)))p(x)dx,

(∫_( 0)^( 1))((cos(c log x)-1)/(1±(x^h)))p(x)dx,

(∫_( 0)^( 1))((sinh(c log x))/(1±(x^h)))p(x)dx,

(∫_( 0)^( 1))((sinh(c log x)-c log x)/(1±(x^h)))p(x)dx,

where

p(x)=((Subscript[a, 1])(x^(Subscript[α, 1]))+(Subscript[a, 2])(x^(Subscript[α, 2]))+…+(Subscript[a, n])(x^(Subscript[α, n])))((Subscript[b, 1])((log(x))^(Subscript[β, 1]))+(Subscript[b, 2])((log(x))^(Subscript[β, 2]))+…+(Subscript[b, m])((log(x))^(Subscript[β, m]))).

We have shown how TIntegrate may be used to construct new evaluations of a variety of interesting infinite series, such as series involving the inverse tangent function. TIntegrate is also able to directly compute closed-form evaluations of definite integrals involving products of trig-logarithmic and hyperbolic-logarithmic expressions.

6. Conclusion

We currently leave it as an open problem to generalize TIntegrate. There are many natural ways to generalize it. Many definite integrals have an integrand with a factor consisting of the composition of two elementary transcendental functions that may be evaluated using Maclaurin series, but that cannot be directly evaluated using state-of-the-art computer algebra systems. For example, Mathematica 11.2 is not able to compute the following integral.

Integrate[((((ArcSin[Sin[x]])^2) Sin[x])/x),{x,0,Infinity}]

Using the Maclaurin series for the square of the inverse sine, it is easily seen that

(∫_( 0)^( ∞))(((((sin^(-1))(sin(x)))^2) sin(x))/x)dx=((π^3)/24)≈1.29193….

Implementing a generalization of this strategy to evaluate (∫_( 0)^( ∞))(1/x)(((sin^(-1))(sin(x)))^2) sin(x)dx using Mathematica may be difficult, since Mathematica 11.2 is not able to compute integrals such as (∫_( 0)^∞)(((sin^(2 n+1))(x))/x)dx.

We currently leave it as an open problem to construct an analog of the TIntegrate function that is able to directly evaluate infinite series such as the summation (∑_( n=1)^( ∞))(1/(Sqrt[((n^2)+1) ((Sqrt[(n^2)+1])+n)])) evaluated in Section .

A natural way to generalize the TIntegrate function would be to construct a program for directly evaluating more general classes of logarithmic-power integrals. For example, these logarithmic-power integrals have simple closed-form evaluations, but Mathematica 11.2 is not able to directly evaluate general formulas for these integrals.

Integrate[(((Log[x])^n)/(((1+x))^2)),{x,0,1}]

Integrate[(((Log[x])^n)/(1+(x^I))),{x,0,1}]

The TIntegrate function is designed to evaluate definite integrals with an integrand with a factor in the form of a trig-logarithmic or hyperbolic-logarithmic function. However, it is clear that the general strategy outlined in the Section  may be applied more generally. That is, this technique may be applied to certain types of definite integrals with factors different than cos(log x) or sin(log x)-log x. We currently leave it as an open problem to generalize the TIntegrate function so as to be able to apply this Maclaurin series substitution technique to integrands without such factors.

Acknowledgments

The author would like to thank a reviewer for many useful comments and suggestions.

References

A. A. Adams, H. Gottliebsen, S. A. Linton and U. Martin, “VSDITLU: A Verifiable Symbolic Definite Integral Table Look-Up,” in CADE-16: Proceedings of the 16th International Conference on Automated Deduction: Automated Deduction, H. Ganzinger (ed.), Trento, Italy, July 7–10, 1999, London: Springer, 1999 pp. 112–126. doi:10.1007/3-540-48660-7_8.

D. Lichtblau, “Symbolic Definite Integration: Methods and Open Issues,” talk given at 2005 Wolfram Technology Conference, Champaign IL, 2005. library.wolfram.com/infocenter/Conferences/5832.

D. Stoutemyer, “Crimes and Misdemeanors in the Computer Algebra Trade,” Notices of the American Mathematical Society, 38(7), 1991 pp. 778–785. www.researchgate.net/publication/235941737_Crimes_and_Misdemeanors_in_the_Computer_Algebra_Trade.

B. Terelius, “Symbolic Integration,” Master’s thesis, Royal Institute of Technology, School of Computer Science and Communication, Stockholm, Sweden, 2009. www.nada.kth.se/utbildning/grukth/exjobb/rapportlistor/2009/rapporter09/terelius_bjorn_09095.pdf.

P. S.-H. Wang, Evaluation of Definite Integrals by Symbolic Manipulation, Technical report MIT/LCS/TR-92, Project MAC, Massachusetts Institute of Technology, Cambridge, MA, 1971. publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-092.pdf.

K. S. Adhav, A. S. Nimkar, V. G. Mete and M. V. Dawande, “Axially Symmetric Bianchi Type-I Model with Massless Scalar Field and Cosmic Strings in Barber’s Self-Creation Cosmology,” International Journal of Theoretical Physics, 49(5), 2010 pp. 1127–1132. doi.org/10.1007/s10773-010-0293-6.

D. D. Pawar, S. N. Bayaskar and A. G. Deshmukh, “String Cosmological Model in Presence of Massless Scalar Field in Modified Theory of General Relativity,” Romanian Journal of Physics, 56(5–6), 2011 pp. 842–848. www.nipne.ro/rjp/2011_56_5-6/0842_0848.pdf.

N. J. A. Sloane, “The On-Line Encyclopedia of Integer Sequences,” sequence A265011. oeis.org.

Namagiri, “A Closed Form for the Infinite Series (∑_( n=1)^( ∞))(((-1))^(n+1)) arctan ((1/n)).” Mathematics Stack Exchange. (Apr 30, 2014) math.stackexchange.com/questions/776182.

Additional electronic files:

TIntegratePackage.m

Available at: www.mathematica-journal.com/data/uploads/2017/10/TIntegratePackage.m