Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Trig integration rules sought

29 views
Skip to first unread message
Message has been deleted

clicl...@freenet.de

unread,
Nov 13, 2010, 7:14:10 AM11/13/10
to

Albert Rich schrieb:
>
> Rubi is a rule-based integrator available at http://www.apmaths.uwo.ca/RuleBasedMathematics.
> The forthcoming version 3 of Rubi is able to integrate expressions of
> the form
>
> (a+b*sin(c+d*x))^n
> (a+b*cos(c+d*x))^n
> (a+b*tan(c+d*x))^n
> (a+b*cot(c+d*x))^n
> (b*sec(c+d*x))^n
> (b*csc(c+d*x))^n
>
> where n is a half-integer (i.e. n-1/2 is an integer) and a, b, c and d
> are arbitrary values independent of x. Does anyone know, and would
> like to contribute, rules for integrating expressions of the form
>
> (a+b*sec(c+d*x))^n
> (a+b*csc(c+d*x))^n
>

This appears to be a tough problem for the formidable sci.math.symbolic
gurus! Usually, integrands like 1/SQRT(a + b*SEC(x))^(2*n + 1) would be
converted to algebraic functions and these subsequently reduced to
canonical elliptic integrals (here including the 3rd kind!), and Rubi
too will hopefully be able to do this soon in full generality. Thus,
special rules for the present integrands make sense only if they result
in more compact evaluations. I myself do not see yet why the algebraic
route has to be inferior and fear that the merit of special rules does
not justify the rule space occupied. How does Rubi integrate the first
six expressions?

A specialized treatment of f(n) := INT(1/SQRT(a + b*SEC(x))^(2*n+1), x)
could rely on the recursion relation

a*(b^2 - a^2)*(2*n+1) * f(n+1)
+ (a^2*(6*n+1) - b^2*(2*n+1)) * f(n)
+ a*(1-6*n) * f(n-1)
+ (2*n-1) * f(n-2)
+ (2*b^2) * TAN(x)/SQRT(a + b*SEC(x))^(2*n+1) = 0

to reduce exponents 2*n+1 > 3 or exponents 2*n+1 < -1 to 2*n+1 = 3,
2*n+1 = 1 and 2*n+1 = -1. The usefulness of this approach hinges on
finding optimal evalutions for the three reduced exponents. I am looking
into this matter now.

Note that the recursion simplifies for the case a^2 = b^2 (which was
discussed recently), its effect on this particular case should be looked
into as well.

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Nov 14, 2010, 6:16:05 AM11/14/10
to

Albert Rich schrieb:
>
> [...] So what I am looking for, analogous to the second rule above,
> is a rule that transforms integrands of the form
>
> (A+B*sec(c+d*x))*(a+b*sec(c+d*x))^n
>
> to ones of the form
>
> (C+D*sec(c+d*x))*(a+b*sec(c+d*x))^(n-1)
>
> when n>0. Then a rule for secants, analogous to the first rule above,
> is easily derived.

Thanks for the explanations. The SIN analogue of my recurrence relation
for 1/SQRT(a + b*SEC(x))^(2*n+1) is:

(b^2 - a^2)*(2*n+1) * f(n+1)

+ 4*a*n * f(n)
+ (1-2*n) * f(n-1)
+ 2*b*COS(x)/SQRT(a + b*SIN(x))^(2*n+1) = 0

where f(n) := INT(1/SQRT(a + b*SIN(x))^(2*n+1), x). This is one integral
"shorter" than the SEC rule, and reduces to two integrals in the case of
a^2 = b^2. I therefore suspect that SEC counterparts of all of your SIN
rules need to be be "longer" by one integral (the increased complexity
seems to be related to the involvement of elliptic integrals of the 3rd
kind).

On this basis, I easily obtained the following pair of recurrence
relations:

n * INT((c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT((n*c*a + ((2*n-1)*d*a + n*c*b)*SEC(x))*(a + b*SEC(x))^(n-1), x)
+ (n-1)*d*(a^2 - b^2) * INT(SEC(x)*(a + b*SEC(x))^(n-2), x)
- d*b*TAN(x)*(a + b*SEC(x))^(n-1) = 0

(n+1)*a*(a^2 - b^2) * INT((c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(((n+1)*c*(a^2 - b^2) + (2*n+3)*(d*a - c*b)*a*SEC(x))
*(a + b*SEC(x))^(n+1), x)
+ (n+2)*(d*a - c*b) * INT(SEC(x)*(a + b*SEC(x))^(n+2), x)
- (d*a - c*b)*b*TAN(x)*(a + b*SEC(x))^(n+1) = 0

>
> Yes, I have started work on elliptic integrals for Rubi 3.

Here is a 19th-century elliptic integration problem (1st and 2nd kind
only) on which Maple and Mathematica both seemed to fail:

<http://groups.google.com/group/sci.math.symbolic/browse_thread/thread/e59cf2faa31e1c1f>

Martin.

Nasser M. Abbasi

unread,
Nov 14, 2010, 6:48:47 AM11/14/10
to
Speaking of Integration:

Just noticed Rubi2 can't do this one:

In[25]:= Int[Cos[x+x^2]/x,x]
Out[25]= Int[Cos[x+x^2]/x,x]

(niether can Mathematica 7)

fyi, here is one below Rubi2 can do, _partially_ (above is part of the answer),

Sin[x](Sin[x^2] (Sin[x^2]+1/x)+1/x)

btw, I saw the above function in a video presentation from WRI web site.

--Nasser

Message has been deleted

clicl...@freenet.de

unread,
Nov 18, 2010, 3:47:43 AM11/18/10
to

Albert Rich schrieb:
>
> [...] However, there might still be room for improvement in the 3
> termination rules that result in elliptic integral functions. These
> rules obviously contain vestiges of the despised tangent theta/2
> substitution. For example, the antiderivative of sec(c+d*x)/sqrt(a
> +b*sec(c+d*x)) includes the "ugly" subexpression
>
> EllipticF[ArcSin[Tan[(c+d*x)/2]], (a-b)/(a+b)]
>
> involving the arcsine of a tangent. What I would like is a "nice"
> subexpression of the form
>
> EllipticF[f(x), c]
>
> where f is rational function and c is a constant. That this might be
> possible is by analogy with the antiderivative of 1/sqrt(a+b*cos(c
> +d*x)) which includes the "nice" subexpression
>
> EllipticF[(c+d*x)/2, 2*b/(a+b)]
>
> However, if the antiderivative of 1/sqrt(a+b*cos(c+d*x)) is obtained
> using the tangent theta/2 substitution, the result is the "ugly"
> subexpression
>
> EllipticF[I*ArcSinh[Tan[(1/2)*(c+d*x)]], (a-b)/(a+b)]
>
> strikingly similar to the above "ugly" subexpression for the secant.
>
> If someone can produce a nicer antiderivative for sec(c+d*x)/sqrt(a
> +b*sec(c+d*x)), they will be credited as its author in the Rubi 3
> source files.
>

My search for "nice" antiderivatives of the integrands (a + b*SEC(x))^n
where n is a half-integer has finally produced an unambiguous answer:

INT(1/SQRT(a + b*SEC(x)), x) =

- 2*SQRT(a+b)/a * COT(x) * SQRT(b*(1 - SEC(x))/(a+b)) * SQRT(b*(1 +
SEC(x))/(b-a)) * EL_PI(ASIN(SQRT(a + b*SEC(x))/SQRT(a+b)), (a+b)/a,
SQRT(a+b)/SQRT(a-b))

INT(SEC(x)/SQRT(a + b*SEC(x)), x) =

2*SQRT(a+b)/b * COT(x) * SQRT(b*(1 - SEC(x))/(a+b)) * SQRT(b*(1 +
SEC(x))/(b-a)) * EL_F(ASIN(SQRT(a + b*SEC(x))/SQRT(a+b)),
SQRT(a+b)/SQRT(a-b))

INT((SEC(x)^2 + SEC(x))/SQRT(a + b*SEC(x)), x) =

2*SQRT(a+b)*(b-a)/b^2 * COT(x) * SQRT(b*(1 - SEC(x))/(a+b)) * SQRT(b*(1
+ SEC(x))/(b-a)) * EL_E(ASIN(SQRT(a + b*SEC(x))/SQRT(a+b)),
SQRT(a+b)/SQRT(a-b))

Here the canonical elliptic integrals are defined as:

EL_F(phi, k) := INT(1/SQRT(1 - k^2*SIN(t)^2), t, 0, phi)

EL_E(phi, k) := INT(SQRT(1 - k^2*SIN(t)^2), t, 0, phi)

EL_PI(phi, n, k) :=
INT(1/((1 - n*SIN(t)^2) * SQRT(1 - k^2*SIN(t)^2)), t, 0, phi)

and the "integrating factor" is nicely symmetric:

SQRT(a+b)*SQRT(a-b)/b * COT(x) * SQRT(b*(1 - SEC(x))/(a+b)) * SQRT(b*(1
+ SEC(x))/(b-a))

Once Rubi is able to deal with elliptic integrands, it might be fun to
see if it can break down SEC^m / (a + b*SEC)^n for specific integer m
and half-integer n when this "integrating factor" (or its reciprocal) is
included with the SEC integrand, as it can in the case of a^2 = b^2. Can
Mathematica?

The present rule set for SEC^m / (a + b*SEC)^n with m integer, n
half-integer, and a^2 /= b^2 consists of:
<http://www.apmaths.uwo.ca/RuleBasedMathematics/IntegrationRulesForLinearFunctionsOfSecants.pdf>

- (^0 ^1/2) <- (^0+^1 ^-1/2), (^1 ^-1/2)
- (^0 ^-1/2) <- (^0+^1 ^-1/2), (^1 ^-1/2)
- if n > 1: (^0 ^n) <- (^0 ^n-1), (^1 ^n-1)
- if n < -1, n /= -2: (^0 ^n) <- (^0 ^n+1), (^1 ^n+1), (^1 ^n+2)
- (^1 ^1/2) <- (^1 ^-3/2)
- (^1 ^-1/2) <- EllipticF
- (^1 ^-3/2) <- (^1 ^-1/2) EllipticE
- if n < -2: (^1 ^n) <- (^1 ^n+1), (^1 ^n+2)
- if n > 0, n /= 1/2: (^1 ^n) <- (^1 ^n-1), (^1 ^n-2)
- (^0+^1 ^-1/2) <- EllipticPi
- if n < -2: (^0 ^n), (^1 ^n) <- (^0 ^n+1), (^1 ^n+1), (^1 ^n+2)
- if n > 0: (^0 ^n), (^1 ^n) <- (^0 ^n-1), (^1 ^n-1), (^1 ^n-2)

Rules 3,4 and 8,9 are special cases of 11,12. Rules 1,2,5 prepare for
the terminal 6,7,10.

For the above elliptic evaluations I propose to replace this set for m
integer, n half-integer, a^2 /= b^2 by:

- if m >= 1: (^m ^n) <- (^m-1 ^n), (^m-1 ^n-1)
- if n >= 2: (^0 ^n) <- (^0 ^n-1), (^0 ^n-2), (^0 ^n-3)
- if n < -1: (^0 ^n) <- (^0 ^n+1), (^0 ^n+2), (^0 ^n+3)
- (^0 ^3/2) <- (^0 ^-1/2), (^0 ^1/2), EllipticE
- (^0 ^1/2) <- (^0 ^-1/2), EllipticF
- (^0 ^-1/2) <- EllipticPi

The 4-term relation in rules 2,3 was given in an earlier post; rules
4,5,6 follow from the above elliptic integrals. Note that this set
should work for any integer m>0.

This thread has already covered recursion for integrands (a + b*SIN)^n.
Tangents can be dealt with in a similar manner, but I saw nothing of
this kind among the Rubi-2 rules. Here's the basic relation just in
case:

(2*n+1)*((a^2 + b^2) * f(n+1) - 2*a * f(n) + f(n-1))
+ 2*b/SQRT(a + b*TAN(x))^(2*n+1) = 0

where f(n) := INT(1/SQRT(a + b*TAN(x))^(2*n+1), x).

Martin.

clicl...@freenet.de

unread,
Nov 18, 2010, 6:00:18 AM11/18/10
to

clicl...@freenet.de schrieb:
>
> [...]

Here's an equivalent, and perhaps better, rule set:

- if m >= 3: (^m ^n) <- (^m-1 ^n), (^m-1 ^n-1)
- if n >= 0: (^0 ^n), (^1 ^n), (^2 ^n) <- (^0 ^n-1), (^1 ^n-1), (^2
^n-1)
- if n < -1: (^0 ^n), (^1 ^n), (^2 ^n) <- (^0 ^n+1), (^1 ^n+1), (^2
^n+1)
- (^2 ^-1/2) <- (^1 ^-1/2), EllipticE


- (^1 ^-1/2) <- EllipticF

- (^0 ^-1/2) <- EllipticPi

The 2-term recurrence relations for rules 2 and 3 are:

(n+1)*INT((c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
- INT(((n+1)*a*c + ((n+1)*(a*d + c*b) + n*b*e)*SEC(x)
+ (n*a*e + (n+1)*b*d)*SEC(x)^2)*(a + b*SEC(x))^(n-1), x)
- e*TAN(x)*(a + b*SEC(x))^n = 0

(n+1)*a*(b^2 - a^2)*INT((c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
+ INT(((n+1)*c*(a^2 - b^2) + (n+1)*a*(a*d - b*(c + e))*SEC(x)
+ (n+2)*(a^2*e - a*b*d + b^2*c)*SEC(x)^2)*(a + b*SEC(x))^(n+1), x)
- (a^2*e - a*b*d + b^2*c)*TAN(x)*(a + b*SEC(x))^(n+1) = 0

Martin.

Message has been deleted
Message has been deleted

clicl...@freenet.de

unread,
Nov 19, 2010, 9:36:57 PM11/19/10
to

Albert Rich schrieb:

>
> On Nov 18, 1:00 am, cliclic...@freenet.de wrote:
>
> > Here's an equivalent, and perhaps better, rule set:
> >
> > - if m >= 3:
> > (^m ^n) <- (^m-1 ^n), (^m-1 ^n-1)
> > - if n >= 0:
> > (^0 ^n), (^1 ^n), (^2 ^n) <- (^0 ^n-1), (^1 ^n-1), (^2 ^n-1)
> > - if n < -1:
> > (^0 ^n), (^1 ^n), (^2 ^n) <- (^0 ^n+1), (^1 ^n+1), (^2 ^n+1)
> > - (^2 ^-1/2) <- (^1 ^-1/2), EllipticE
> > - (^1 ^-1/2) <- EllipticF
> > - (^0 ^-1/2) <- EllipticPi
> >
> > The 2-term recurrence relations for rules 2 and 3 are:
> >
> > (n+1)*INT((c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
> > - INT(((n+1)*a*c + ((n+1)*(a*d + c*b) + n*b*e)*SEC(x)
> > + (n*a*e + (n+1)*b*d)*SEC(x)^2)*(a + b*SEC(x))^(n-1), x)
> > - e*TAN(x)*(a + b*SEC(x))^n = 0
> >
> > (n+1)*a*(b^2 - a^2)*INT((c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
> > + INT(((n+1)*c*(a^2 - b^2) + (n+1)*a*(a*d - b*(c + e))*SEC(x)
> > + (n+2)*(a^2*e - a*b*d + b^2*c)*SEC(x)^2)*(a + b*SEC(x))^(n+1), x)
> > - (a^2*e - a*b*d + b^2*c)*TAN(x)*(a + b*SEC(x))^(n+1) = 0
> >
>
> Congratulations! Both the new terminal rules and 2-term recurrence
> relations are most impressive. I too had tried to find 2-term
> recurrences for integrands of the form (c+d*sec(x)+e*sec(x)^2)*(a
> +b*sec(x))^n, but failed.

Looks like you should use Derive, not Mathematica!

>
> It's probably obvious, but I need some help deriving the recurrence
> for your rule 1 (i.e. integrands of the form sec(x)^m*(a+b*sec(x))^n
> where m is a positive integer).
>

I fear the last term in rule 1 above should have been (^m-1 ^n+1); I
never wrote this relation down. But since you show a preference for
2-term recurrences, I have cooked one up for this occasion too:

(m+n+1)*b*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m-1)*((m-1)*a*e + ((m+n)*e + (m+n+1)*c)*b*SEC(x)
- (m*a*e - (m+n+1)*b*d)*SEC(x)^2)*(a + b*SEC(x))^n, x)
- e*SEC(x)^(m-1)*TAN(x)*(a + b*SEC(x))^(n+1) = 0

The inverse iteration

m*a*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m+1)*(m*a*d - (m+n+1)*b*c + (m*a*e + (m+1)*a*c)*SEC(x)
+ (m+n+2)*b*c*SEC(x)^2)*(a + b*SEC(x))^n, x)
+ c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^(n+1) = 0

will allow Rubi to handle negative integer powers SEC^m as well. (Watch
out that multiple matches do not lead to endless iteration in either
case. And note that there will be no problem with m+n = -1 if m is
integer and n is non-integer, and no problem with m = 0 since you will
want to stop after m = -1.)

I suppose that "n >= 0" in rule 2 above should probably be changed to "n
> 0".

Finally, corresponding m-iteration rules should probably be added to the
sine, tangent, ..., rule-sets, too.

I expect the whole thing to be a good exercise for the general
(algebraic) elliptic case, where recurrences can serve to knock down
powers in the numerator and denominator too.

Martin.

PS: I am sending this as composed before your latest message. Occasional
silence merely reflects preoccupation with other matters!

clicl...@freenet.de

unread,
Nov 20, 2010, 5:19:45 AM11/20/10
to

Albert Rich schrieb:

>
> On Nov 18, 11:35 pm, Albert Rich <Albert_R...@msn.com> wrote:
>
> > It's probably obvious, but I need some help deriving the recurrence
> > for your rule 1 (i.e. integrands of the form sec(x)^m*(a+b*sec(x))^n
> > where m is a positive integer).
>
> Hello Martin,
>
> From your silence, perhaps the answer to my question was not so
> obvious... However while I wait, I have been keeping busy: The three
> terminal rules and two 2-term recurrence relations you contributed for
> integrating expressions of the form x^m*(a+b*sec(c+d*x))^n where a^2-
> b^2/=0 and m=0, 1 or 2 have been incorporated into Rubi 3 as shown in
> the pdf file
>
> http://www.apmaths.uwo.ca/RuleBasedMathematics/IntegrationRulesForRationalFunctionsOfSecants.pdf
>
> Not only are these rules useful when n is a half-integer, but for the
> far more common case when n is a negative integer. For example, it
> took 18 steps for Rubi 2 to integrate 1/(a+b*sec(x))^5; whereas Rubi 3
> produces a simpler antiderivative in just 7 steps!
>
> In your earlier post, you proposed replacing my 12 rules with your 6,
> since many of mine were just special cases of more general rules.
> Unfortunately, in the "real" world of computer algebra, as distinct
> from the platonic world of mathematics, things are a little messier.
>
> For example, the bottom-up simplification used by most systems means
> that evaluation of expressions such as 0*integrate(f(x),x) needlessly
> computes the integral, which can take a long time depending on f(x).
> Therefore, if the coefficient of an integral in a general rule can
> equal 0, there needs to be a rule for this special case.
>
> Also, Mathematica's pattern matcher is not able to match sums having
> missing terms (which is most understandable). For example,
> 3+4*sec(x)^2 does not match the pattern A+B*sec(x)+C*sec(x)^2, so
> there needs to be a rule for the special case A+C*sec(x)^2.
>

I have cautiously peeked at the new rules in the pdf file linked above.
The first one reads (^0 ^1/2) <- (^0+^1 ^-1/2), (^1 ^-1/2). Couldn't one
simply write (^0 ^1/2) <- (^0 ^-1/2), (^1 ^-1/2) here?

I have also briefly looked into the treatment of powers (SEC-p)^m: The
simple 3-term downward recurrence for this is:

INT((SEC(x) - p)^m*(a + b*SEC(x))^n, x) =
- (p + a/b) * INT((SEC(x) - p)^(m-1)*(a + b*SEC(x))^n, x)
+ 1/b * INT((SEC(x) - p)^(m-1)*(a + b*SEC(x))^(n+1), x)

I have tried to extend my 2-term recurrence for powers SEC^m to this
case, alas without success so far. Combined with a partial-fraction
decomposition with respect to SEC, an upward recurrence for this case
would allow to integrate any rational function R(SEC,SQRT(a+b*SEC)).
Could also be just pie in the sky.

Having seen the new rules, I fear that a reasonably complete Rubi 17
will have a total of the order of 10.000 rules, and that the rule file
will grow to a few Megabytes! Roughly how many integration rules (or
equivalent coding units) are believed to be in Maxima or in Mathematica
(Risch algorithms etc. excluded)? Or are these state secrets?

Martin.

Vladimir Bondarenko

unread,
Nov 20, 2010, 6:10:52 AM11/20/10
to
On Nov 20, 12:19 pm, cliclic...@freenet.de wrote:
> Albert Rich schrieb:
>
>
>
>
>
>
>
>
>
>
>
> > On Nov 18, 11:35 pm, Albert Rich <Albert_R...@msn.com> wrote:
>
> > > It's probably obvious, but I need some help deriving the recurrence
> > > for your rule 1 (i.e. integrands of the form sec(x)^m*(a+b*sec(x))^n
> > > where m is a positive integer).
>
> > Hello Martin,
>
> > From your silence, perhaps the answer to my question was not so
> > obvious...  However while I wait, I have been keeping busy:  The three
> > terminal rules and two 2-term recurrence relations you contributed for
> > integrating expressions of the form x^m*(a+b*sec(c+d*x))^n where a^2-
> > b^2/=0 and m=0, 1 or 2 have been incorporated into Rubi 3 as shown in
> > the pdf file
>
> >http://www.apmaths.uwo.ca/RuleBasedMathematics/IntegrationRulesForRat...

You write:

"Having seen the new rules, I fear that a reasonably complete
Rubi 17 will have a total of the order of 10.000 rules, and
that the rule file will grow to a few Megabytes!"

Please, not to worry much.

With human based Rubi QA, Rubi 100% dies in its infancy.

I mean it will become conspicuously useless/inefficient way
sooner than the 10000th rules is added.

My prediction is based on the VM Rubi/Rubi 2 bug lists.

Message has been deleted

clicl...@freenet.de

unread,
Nov 21, 2010, 3:50:35 AM11/21/10
to

Albert Rich schrieb:
>
> In your previous post, you gave a nice 2-term recurrence for
> integrands of the form
>
> sec(x)^m*(A+B*sec(x)+C*sec(x)^2)*(a+b*sec(x))^n
>
> which depends on m+n+1 not being 0. As I mentioned in my previous
> post, I would also like to integrate such expressions when n is a
> negative integer. So I wonder if you could "cook up" a recurrence for
> the special case when m+n+1=0.
>

This is a tough order for the Restaurant at the End of the Universe. I
have to consult with the chef first. Please wait and enjoy the view.

Martin.

Vladimir Bondarenko

unread,
Nov 21, 2010, 12:41:08 PM11/21/10
to


http://groups.google.com/group/sci.math.symbolic/msg/3d8412bdc8b90d86

"This is a tough order for the Restaurant at the End of
the Universe. I have to consult with the chef first.
Please wait and enjoy the view."

I like your wording beyond all limits...

As for Rubi expansion, I have seen such evolution about a
decade ago in MMA. Their worst release was MMA 3.

But they have enough resource to build and run an automated
QA system, and got, to an extent, out of the swamp...

Anyways, your Rubi and sci.math.symbolic drive is a godsent
for both.

Best wishes,

Vladimir

clicl...@freenet.de

unread,
Nov 21, 2010, 1:35:01 PM11/21/10
to

clicl...@freenet.de schrieb:

It took some convincing, but the chef has finally relented, and this is
his creation:

(n+1)*b*(a^2 - b^2)*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)
* (a + b*SEC(x))^n, x)
- INT(SEC(x)^(m-1)*((m-1)*(a^2*e - a*b*d + b^2*c)
+ (n+1)*b*(a*c + a*e - b*d)*SEC(x)
- (m*a^2*e + (n+1)*b^2*e - (m+n+1)*b*(a*d - b*c))*SEC(x)^2)
* (a + b*SEC(x))^(n+1), x)
- (a^2*e - a*b*d + b^2*c)*SEC(x)^(m-1)*TAN(x)
* (a + b*SEC(x))^(n+1) = 0

You may take bites as long as n /= -1. If you hit n = -1 before m = 0 is
reached you have to return to the old formula in order to reach m = 0.
Alternatively, you may start with the old formula and switch to the new
creation in case you hit m = -n-1 there.

The inverse iteration for the new formula is:

m*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m+1)*(m*a*d - n*b*c
+ (m*(a*e + b*d) + (m+1)*a*c)*SEC(x)
+ (m*e + (m+n+1)*c)*b*SEC(x)^2)*(a + b*SEC(x))^(n-1), x)
+ c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^n = 0

Bon appétit!

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Nov 22, 2010, 6:50:06 AM11/22/10
to

Albert Rich schrieb:
>
> I'm stuffed. I have digested the six 2-term recurrences you
> discovered, and transformed them into integration rules for Rubi. The
> results are pretty spectacular. Integration of expressions of the form
> sec(x)^m*(A+B*sec(x)+C*sec(x)^2)*(a+b*sec(x))^n is now a straight-
> forward and direct process. It only requires about |m|+|n| steps if m
> and n are of the same sign, and about max(|m|,|n|) steps if m and n
> are of opposite sign. The rules for integrating such rational
> functions of secants, expressed in both mathematical notation and
> program code, is in the file
>
> http://www.apmaths.uwo.ca/RuleBasedMathematics/IntegrationRulesForRationalFunctionsOfSecants.pdf

Rubi 3 would appear to be somewhat lopsided if it could efficiently
integrate these SEC functions but not their SIN and TAN equivalents.
Intuition informs me there must be equally good (actually simpler)
recipes for those creatures too. And they shouldn't be very hard to work
out now ...

>
> [...]
>
> In an earlier post you expressed concern about the growth in the size
> of Rubi. The program code for the 52 rules defined in the pdf file
> requires about 21 kilobytes. Rather than Rubi becoming obese, I am
> more concerned about the pattern matcher of the host CAS slowing down
> as the number of rules continues to increase. Rather than an order n
> linear list search, CASs should use an efficient order log(n) tree
> search for pattern matching.
>

Perhaps you could introduce one or two levels of "super-patterns" to go
a long way in this direction? This might increase the search speed by
one or two orders of magnitude. But I have no idea what the Mathematica
language permits in this regard, and what not.

Martin.

Message has been deleted

Waldek Hebisch

unread,
Nov 22, 2010, 3:06:25 PM11/22/10
to
clicl...@freenet.de wrote:
>
> Having seen the new rules, I fear that a reasonably complete Rubi 17
> will have a total of the order of 10.000 rules, and that the rule file
> will grow to a few Megabytes! Roughly how many integration rules (or
> equivalent coding units) are believed to be in Maxima or in Mathematica
> (Risch algorithms etc. excluded)? Or are these state secrets?
>

FriCAS uses of order of 10 rules. FriCAS first uses Risch algorithm
to separate parts which have elementary integral and then tries
to pattern-match the remainder with derivatives of known special
functions. Due to very small number of rules FriCAS fails on
many nonelementaty integrals (AFAICS FriCAS can do 100% elementary
integrals from Rubi testsuite and only small fraction of
nonelementary ones).

Concerning completeness, there is large class of integrals which
are relatively easy for Risch algoritm but very hard to handle
via rules. Risch algoritms effectively is doing pattern match
using a few very general patterns. It seems that trying to
replace general patterns by more specific ones leads to combinatorial
explosion in number of patterns. To be more concrete consider

h = \sum c_i log(f_i)

where c_i are constants. In "interesting" cases derivative of h
contains no syntactic trace of c_i and f_i (they combine to something
else).

So, I would say that rules are interesting for things which are
handled badly by algorithms, but I do not think that rule can
compete when there is simple algorithm.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

Message has been deleted

Nasser M. Abbasi

unread,
Nov 22, 2010, 8:15:58 PM11/22/10
to
On 11/22/2010 11:52 AM, Albert Rich wrote:

>
> In addition to DownValues, Mathematica allows rules to be defined as
> UpValues, which might provide a mechanism for dividing the rules into
> the "super-patterns" you suggested. I have avoided the use of UpValues
> thus far, preferring mathematical elegance over the compromises
> necessary for maximum efficiency.

It is good to do so also for the purpose of possible of porting Rubi.

Because using too much language specific features for patterns
might make Rubi harder to port to other systems, assuming one wants
to do direct porting. (source to source, by hand).

But, on the other hand, now that Mathematica 8 can generate C code
directly from Mathematica code, So here is an idea:

May be Rubi can be compiled to C code. one can take the C code,
and try to build it as a DLL (shared lib).

Then it can possibly be used by other CAS systems directly assuming
the other CAS system allows one to load or call functions
in external DLL.

This is a much faster way to make Rubi available to other CAS systems.

Of course, there are some details to fill in. Just an idea.

--Nasser

Richard Fateman

unread,
Nov 22, 2010, 8:45:46 PM11/22/10
to
Since mail sent to n...@12000.org from my email address is refused,
I cannot respond personally to Nasser, and so have a choice of
ignoring his comments or posting responses.


On 11/22/2010 5:15 PM, Nasser M. Abbasi wrote:
> On 11/22/2010 11:52 AM, Albert Rich wrote:
>
>>
>> In addition to DownValues, Mathematica allows rules to be defined as
>> UpValues, which might provide a mechanism for dividing the rules into
>> the "super-patterns" you suggested. I have avoided the use of UpValues
>> thus far, preferring mathematical elegance over the compromises
>> necessary for maximum efficiency.
>
> It is good to do so also for the purpose of possible of porting Rubi.

UpValues do not change the semantics.


>
> Because using too much language specific features for patterns
> might make Rubi harder to port to other systems, assuming one wants
> to do direct porting. (source to source, by hand).

It is not particularly sensible to rewrite Ruby by hand, at least
while it continues to change. Using a pattern matcher to mimic
Mathematica is easier, especially since it has already been written.

>
> But, on the other hand, now that Mathematica 8 can generate C code
> directly from Mathematica code,

Have you spent even 5 minutes looking at what kind of C code Mathematica
can generate? If you had, you would realize that the only code it
generates is evaluation of expressions, not pattern matching.
Not calls to transformation functions like FullSimplify.
Plus, it is not exactly stand-alone, since it uses some Wolfram library.
(This would clearly NOT include a pattern matcher, FullSimplify, etc.)

....

>
> Of course, there are some details to fill in. Just an idea.

Are you all alone at 12000.org? No one to talk to? No one to
kind of bounce ideas off? To see if they pass even the simplest
sanity check?

clicl...@freenet.de

unread,
Nov 23, 2010, 7:41:07 AM11/23/10
to

Albert Rich schrieb:
>
> In order to complete the symmetry between sec/csc and sin/cos, I need
> one more set of 2-term recurrences: In section 2.55 of Gradshteyn &
> Ryzhik, recurrences are given for integrating (A+B*sin(x))/(a
> +b*sin(x))^n and (A+B*cos(x))/(A+B*cos(x))^n analogous to the ones we
> now have for (A+B*sec(x))/(a+b*sec(x))^n and (A+B*csc(x))/(a
> +b*csc(x))^n. Also in section 2.55 is a recurrence for (A+B*cos(x)
> +C*sin(x))/(a+b*cos(x)+c*sin(x))^n, so my intuition informs me there
> must be an equally good recurrence for (A+B*csc(x)+C*sec(x))/(a
> +b*csc(x)+c*sec(x))^n...

I will probably try my luck, but I have many things to take care of
these days. All our SEC recurrences can be converted to equivalent COS
recurrences through multiplication by some COS power. However, the
corresponding multiplication by SIN and COS powers will turn
(a+b*SEC+c*CSC)^n into (a*SIN*COS+b*SIN+c*COS)^n. We thus end up with a
special quadratic form in SIN and COS, and we haven't started to open
this box yet.

I expect that the G&R recurrence for (A+B*SIN) / (a+b*SIN)^n can be
extended to SIN^m * (c+d*SIN+???) * (a+b*SIN)^n and similarly the COS
equivalent. I also expect there to be efficient recurrences for COS^m *
(c+d*COS+???) * (a+b*SIN)^n and SIN^m * (c+d*SIN+???) * (a+b*COS)^n, and
presumably also for COS^p * SIN^q * (c+d*COS+e*SIN+???) * (a+b*SIN)^n
and COS^p * SIN^q * (c+d*COS+e*SIN+???) * (a+b*COS)^n. I have doubts
that the G&R recurrence for (A+B*COS+C*SIN) / (a+b*COS+c*SIN)^n can be
profitably generalized to COS^p * SIN^q * (d+e*COS+f*SIN+???) *
(a+b*COS+c*SIN)^n because the last factor derives from a+b*COS or
a+b*SIN via a simple argument shift which however screws up the powers
COS^p and SIN^q. Such a generalization should be tried nonetheless.

>
> In addition to DownValues, Mathematica allows rules to be defined as
> UpValues, which might provide a mechanism for dividing the rules into
> the "super-patterns" you suggested. I have avoided the use of UpValues
> thus far, preferring mathematical elegance over the compromises

> necessary for maximum efficiency. I feel efficient pattern matching is
> the responsibility of the host CAS.

I agree that it is the reponsibility of the host language to provide
efficient implementations of its programming constructs. It looks like
the WRI programmers didn't foresee that someone might want to look for
matches among thousands of patterns treated on an equal footing.

>
> P.S. Did you receive the private correspondence I sent several days
> ago?

No, because I never check the address given in my posts; I hope it looks
goofy enough to keep people from trying to use it. Years ago, it was a
real address, but I believe I was told that messages have started to
bounce. Rather than trying to retrieve your message, I am therefore
providing you with a working e-mail address at your msn mailbox.

Martin.

clicl...@freenet.de

unread,
Nov 23, 2010, 1:06:16 PM11/23/10
to

clicl...@freenet.de schrieb:

What should also be examined are recurrences for the pattern COS^p *
SIN^q * (e+f*COS+g*SIN+???) * (a+b*COS)^m * (c+d*SIN)^n. For m=n that's
very close to what you were looking for. Any volunteers?

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Dec 12, 2010, 5:51:44 AM12/12/10
to

Albert Rich schrieb:
>
> On Nov 18, 1:00 am, cliclic...@freenet.de wrote:
>
> > (n+1)*a*(b^2 - a^2)*INT((c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
> > + INT(((n+1)*c*(a^2 - b^2) + (n+1)*a*(a*d - b*(c + e))*SEC(x)
> > + (n+2)*(a^2*e - a*b*d + b^2*c)*SEC(x)^2)*(a + b*SEC(x))^(n+1), x)
> > - (a^2*e - a*b*d + b^2*c)*TAN(x)*(a + b*SEC(x))^(n+1) = 0
>
> Using the above 2-term recurrence and others you contributed, Rubi 3
> is able to efficiently integrate expressions of the form
>
> (c+d*sec(x)+e*sec(x)^2)*(a+b*sec(x))^n
>
> where n is an integer or half-integer and a^2-b^2 is nonzero. However
> when a^2-b^2 is zero and n<-1, Rubi is forced to resort to partial
> fraction expansion or the tangent theta/2 substitution, both of which
> are ugly and inefficient. So for desert, any chance of cooking up a 2-
> term recurrence for this special case?
>

According to an earlier post in this thread, the master recursion
relation for f(n) = INT((a+b*SEC(x))^n, x) involves 4 terms,

a*(b^2 - a^2)*n * f(n-1)
+ (a^2*(3*n+1) - b^2*n) * f(n)
- a*(3*n+2) * f(n+1)
+ (n+1) * f(n+2)
- b^2 * TAN(x)*(a + b*SEC(x))^n = 0

which for a^2 = b^2 reduce to 3 terms

a^2*(2*n+1) * f(n)
- a*(3*n+2) * f(n+1)
+ (n+1) * f(n+2)
- a^2 * TAN(x)*(a + b*SEC(x))^n = 0

It is not hard to see that this 3-term recurrence can be telescoped into
a 2-term relation involving integrands of the type (c+d*SEC) *
(a+b*SEC)^n where a^2 = b^2:

(2*n+1)*a^2*INT((c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(((2*n+1)*a*c + (n+1)*(a*d - b*c)*SEC(x))*(a + b*SEC(x))^(n+1), x)
+ b*(a*d - b*c)*TAN(x)*(a + b*SEC(x))^n = 0

The inverse recurrence is:

n*INT((c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT((n*a*c + ((2*n-1)*a*d + n*b*c)*SEC(x))*(a + b*SEC(x))^(n-1), x)
- b*d*TAN(x)*(a + b*SEC(x))^(n-1) = 0

Similar recurrence relations should follow for integrands of the type
SEC^m * (c+d*SEC) * (a+b*SEC)^n where a^2 = b^2.

Martin.

clicl...@freenet.de

unread,
Dec 16, 2010, 9:49:10 PM12/16/10
to

clicl...@freenet.de schrieb:

And here they are:

(m+n)*a*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m-1)*((m-1)*a*d + ((m+n)*a*c + n*b*d)*SEC(x))
*(a + b*SEC(x))^n, x)
- a*d*SEC(x)^(m-1)*TAN(x)*(a + b*SEC(x))^n = 0

m*a*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m+1)*((m*a*d - n*b*c) + (m+n+1)*a*c*SEC(x))
*(a + b*SEC(x))^n, x)
+ a*c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^n = 0

(2*n+1)*a^2*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m-1)*((m-1)*(a*d - b*c) + ((m+n)*a*c - (m-n-1)*b*d)
*SEC(x))*(a + b*SEC(x))^(n+1), x)
- a*(a*d - b*c)*SEC(x)^(m-1)*TAN(x)*(a + b*SEC(x))^n = 0

m*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^(m+1)*(m*a*d + (m-n+1)*b*c + ((m+n)*a*c + m*b*d)
*SEC(x))*(a + b*SEC(x))^(n-1), x)
+ a*c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^(n-1) = 0

Now you even got two courses of desert, and with second helpings!

Martin.

Nasser M. Abbasi

unread,
Dec 17, 2010, 2:20:15 AM12/17/10
to
On Dec 16, 6:49 pm, cliclic...@freenet.de wrote:
> cliclic...@freenet.de schrieb:

>
> > Albert Rich schrieb:
>


I tried to verify the above, but found out quickly it is hopeless
as both Mathematica V8 and Rubi 2, can't even integrate this form

Integrate[ (a+Sec[x])^n,x]

Adding assumptions does not help. even for specific 'a' value:

Assuming[Element[n,Integers]&&n>0,Integrate[ (2+Sec[x])^n,x]]

it looks like a rule is needed for Integrate[ (a+Sec[x])^n , x] ?

ps. it only worked for a=1, and no other value, but with Mathematica
8:

In[55]:= Integrate[ (1+Sec[x])^n,x]

Out[55]= (3 AppellF1[1/2,n,1,3/2,Tan[x/2]^2,-Tan[x/2]^2] (1+Sec[x])^n
Sin[x])/(3 AppellF1[1/2,n,1,3/2,Tan[x/2]^2,-Tan[x/2]^2]-2
(AppellF1[3/2,n,2,5/2,Tan[x/2]^2,-Tan[x/2]^2]-n AppellF1[3/2,1+n,
1,5/2,Tan[x/2]^2,-Tan[x/2]^2]) Tan[x/2]^2)

--Nasser

clicl...@freenet.de

unread,
Dec 17, 2010, 6:07:46 AM12/17/10
to

"Nasser M. Abbasi" schrieb:

> On Dec 16, 6:49 pm, cliclic...@freenet.de wrote:
> > cliclic...@freenet.de schrieb:
> > >
> > > [...]

> > >
> > > Similar recurrence relations should follow for integrands of the type
> > > SEC^m * (c+d*SEC) * (a+b*SEC)^n where a^2 = b^2.
> >
> >
> > And here they are:
> >
> > (m+n)*a*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
> > - INT(SEC(x)^(m-1)*((m-1)*a*d + ((m+n)*a*c + n*b*d)*SEC(x))
> > *(a + b*SEC(x))^n, x)
> > - a*d*SEC(x)^(m-1)*TAN(x)*(a + b*SEC(x))^n = 0
> >
> > m*a*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
> > - INT(SEC(x)^(m+1)*((m*a*d - n*b*c) + (m+n+1)*a*c*SEC(x))
> > *(a + b*SEC(x))^n, x)
> > + a*c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^n = 0
> >
> > (2*n+1)*a^2*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
> > - INT(SEC(x)^(m-1)*((m-1)*(a*d - b*c) + ((m+n)*a*c - (m-n-1)*b*d)
> > *SEC(x))*(a + b*SEC(x))^(n+1), x)
> > - a*(a*d - b*c)*SEC(x)^(m-1)*TAN(x)*(a + b*SEC(x))^n = 0
> >
> > m*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
> > - INT(SEC(x)^(m+1)*(m*a*d + (m-n+1)*b*c + ((m+n)*a*c + m*b*d)
> > *SEC(x))*(a + b*SEC(x))^(n-1), x)
> > + a*c*SEC(x)^m*TAN(x)*(a + b*SEC(x))^(n-1) = 0
> >
> > Now you even got two courses of desert, and with second helpings!
> >
>
> I tried to verify the above, but found out quickly it is hopeless
> as both Mathematica V8 and Rubi 2, can't even integrate this form
>
> Integrate[ (a+Sec[x])^n,x]
>
> Adding assumptions does not help. even for specific 'a' value:
>
> Assuming[Element[n,Integers]&&n>0,Integrate[ (2+Sec[x])^n,x]]
>
> it looks like a rule is needed for Integrate[ (a+Sec[x])^n , x] ?
>
> ps. it only worked for a=1, and no other value, but with Mathematica
> 8:
>
> In[55]:= Integrate[ (1+Sec[x])^n,x]
>
> Out[55]= (3 AppellF1[1/2,n,1,3/2,Tan[x/2]^2,-Tan[x/2]^2] (1+Sec[x])^n
> Sin[x])/(3 AppellF1[1/2,n,1,3/2,Tan[x/2]^2,-Tan[x/2]^2]-2
> (AppellF1[3/2,n,2,5/2,Tan[x/2]^2,-Tan[x/2]^2]-n AppellF1[3/2,1+n,
> 1,5/2,Tan[x/2]^2,-Tan[x/2]^2]) Tan[x/2]^2)
>

Verification by differentiation should be no problem - at least that's
how I did it. For the first recurrence one above:

DIF((m+n)*a*INT(SEC(x)^m*(c+d*SEC(x))*(a+b*SEC(x))^n,x)-INT(SEC(~
x)^(m-1)*((m-1)*a*d+((m+n)*a*c+n*b*d)*SEC(x))*(a+b*SEC(x))^n,x)-~
a*d*SEC(x)^(m-1)*TAN(x)*(a+b*SEC(x))^n,x)

d*n*(a^2-b^2)*(1/COS(x))^m*((a*COS(x)+b)/COS(x))^n/(a*COS(x)+b)

And for the last one:

DIF(m*INT(SEC(x)^m*(c+d*SEC(x))*(a+b*SEC(x))^n,x)-INT(SEC(x)^(m+~
1)*(m*a*d+(m-n+1)*b*c+((m+n)*a*c+m*b*d)*SEC(x))*(a+b*SEC(x))^(n-~
1),x)+a*c*SEC(x)^m*TAN(x)*(a+b*SEC(x))^(n-1),x)

c*(1-n)*(a^2-b^2)*(1/COS(x))^m*((a*COS(x)+b)/COS(x))^n/(a*COS(x)~
+b)^2

Both results vanish for a^2 = b^2 on account of the factor a^2-b^2.

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Dec 19, 2010, 7:39:13 AM12/19/10
to

clicl...@freenet.de schrieb:

>
> According to an earlier post in this thread, the master recursion
> relation for f(n) = INT((a+b*SEC(x))^n, x) involves 4 terms,
>
> a*(b^2 - a^2)*n * f(n-1)
> + (a^2*(3*n+1) - b^2*n) * f(n)
> - a*(3*n+2) * f(n+1)
> + (n+1) * f(n+2)
> - b^2 * TAN(x)*(a + b*SEC(x))^n = 0
>
> which for a^2 = b^2 reduce to 3 terms
>
> a^2*(2*n+1) * f(n)
> - a*(3*n+2) * f(n+1)
> + (n+1) * f(n+2)
> - a^2 * TAN(x)*(a + b*SEC(x))^n = 0
>

This master recurrence can be generalized by including factors SEC^m:

n*a*(b^2 - a^2) * f(m, n-1)
+ ((m+3*n+1)*a^2 - (m+n)*b^2) * f(m, n)
- (2*m+3*n+2)*a * f(m, n+1)
+ (m+n+1) * f(m, n+2)
- b^2*TAN(x) * SEC(x)^m*(a + b*SEC(x))^n = 0

where f(m, n) := INT(SEC(x)^m*(a+b*SEC(x))^n, x). The generalized
relation telescopes into the following two-term recurrence:

(n+1)*a*(b^2 - a^2)*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)
*(a + b*SEC(x))^n, x)
+ INT(SEC(x)^m*(((n+1)*c - m*e)*a^2 + m*a*b*d - (m+n+1)*b^2*c
- (n+1)*a*(b*(c + e) - a*d)*SEC(x)
+ (m+n+2)*(a^2*e - a*b*d + b^2*c)*SEC(x)^2)*(a + b*SEC(x))^(n+1), x)
- (a^2*e - a*b*d + b^2*c)*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n+1) = 0

The inverse recurrence is:

(m+n+1)*INT(SEC(x)^m*(c + d*SEC(x) + e*SEC(x)^2)*(a + b*SEC(x))^n, x)
- INT(SEC(x)^m*(((m+n+1)*c + m*e)*a
+ ((m+n+1)*a*d + ((m+n+1)*c + (m+n)*e)*b)*SEC(x)
+ (n*a*e + (m+n+1)*b*d)*SEC(x)^2)*(a + b*SEC(x))^(n-1), x)
- e*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

For m=0 these should reduce to relations given earlier in this thread.
Again, somewhat simpler two-term recurrences follow in the case of a^2 =
b^2:

(2*n+1)*a^2*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^m*((m+2*n+1)*a*c - m*b*d + (m+n+1)*(a*d - b*c)*SEC(x))
*(a + b*SEC(x))^(n+1), x)
+ b*(a*d - b*c)*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

(m+n)*INT(SEC(x)^m*(c + d*SEC(x))*(a + b*SEC(x))^n, x)
- INT(SEC(x)^m*((m+n)*a*c + m*b*d + ((m+2*n-1)*a*d + (m+n)*b*c)*SEC(x))
*(a + b*SEC(x))^(n-1), x)
- b*d*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n-1) = 0

Perhaps the generalized rules could enable Rubi to handle integrands
f(m, n) involving SEC^m with half-integer exponents m?

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Dec 22, 2010, 6:00:50 PM12/22/10
to

Albert Rich schrieb:
>
> [...]
>
> Now with no restrictions on the exponents m and n, do you consider
> this collection of 6 pairs of recurrences complete so I can safely use
> them as the basis for integration rules without concern there may be
> more generalizations coming?
>

I tend to share this hope. With respect to the present topic I am
beginning to feel like a blinkered boffin myself. A related note of
caution may be in order:

The expanded relations corresponding to the two-term recurrences listed
in the file

<http://www.apmaths.uwo.ca/RuleBasedMathematics/RecurrencesForRationalFunctionsOfSecants.pdf>

read:

n*a*(b^2 - a^2) * f(m, n-1)
+ ((m+3*n+1)*a^2 - (m+n)*b^2) * f(m, n)
- (2*m+3*n+2)*a * f(m, n+1)
+ (m+n+1) * f(m, n+2)
- b^2*TAN(x) * SEC(x)^m*(a + b*SEC(x))^n = 0

m*a * f(m, n)
+ (m+n+1)*b * f(m+1, n)
- (m+1)*a * f(m+2, n)
- (m+n+2)*b * f(m+3, n)
+ TAN(x) * SEC(x)^m*(a + b*SEC(x))^(n+1) = 0

n*b*(b^2 - a^2) * f(m+3, n-1)
+ ((m-2*n)*b^2 - (m+1)*a^2) * f(m+2, n)
- (2*m-n)*b * f(m+1, n+1)
+ m * f(m, n+2)
+ a^2*TAN(x) * SEC(x)^m*(a + b*SEC(x))^n = 0

where f(m, n) := INT(SEC(x)^m*(a+b*SEC(x))^n, x). It is obvious how the
first and third of these recurrences simplify for a^2 = b^2. The
possibility of simplifying the second relation for a^2 = b^2 is much
less obvious, but expanding recurrence T5.2b from the file gives:

m*a * f(m, n)
+ n*b * f(m+1, n)
- (m+n+1)*a * f(m+2, n)
+ a*TAN(x) * SEC(x)^m*(a + b*SEC(x))^n = 0

So, the second relation can be simplified too.

On the other hand, conversion of the three expanded (as well as all the
telescoped) relations to cosine recurrences (and thence to sine
recurrences) is clearly a trivial matter. Thus, for m = -n-2 the third
recurrence may be written:

n*b*(b^2 - a^2) * g(n-1)
- ((3*n+2)*b^2 - (n+1)*a^2) * g(n)
+ (3*n+4)*b * g(n+1)
- (n+2) * g(n+2)
+ a^2*SIN(x)*COS(x) * (a*COS(x) + b)^n = 0

where g(n) := INT((a*COS(x) + b)^n, x). (Note the reversed rôles of a
and b.) Simplification of this relation is again not obvious, although a
simpler version follows by expanding recurrence 2.554(1) from Gradshteyn
and Ryzhik:

n*(b^2 - a^2) * g(n-1)
- (2*n+1)*b * g(n)
+ (n+1) * g(n+1)
- a*SIN(x) * (a*COS(x) + b)^n = 0

where the rôles of a and b are again reversed.

Thus the possibility of simpler rules should always be examined in
detail and be excluded explicitly. In this light, I expect Rubi's new
rules for the corresponding SIN and TAN integrands to be interesting.

Martin.

PS: I will be off-line for most of the holiday season.

Message has been deleted

clicl...@freenet.de

unread,
Jan 10, 2011, 8:18:49 PM1/10/11
to

clicl...@freenet.de schrieb:

>
> Albert Rich schrieb:
> >
> > [...]
> >
> > Now with no restrictions on the exponents m and n, do you consider
> > this collection of 6 pairs of recurrences complete so I can safely
> > use them as the basis for integration rules without concern there
> > may be more generalizations coming?
> >
>
> I tend to share this hope. With respect to the present topic I am
> beginning to feel like a blinkered boffin myself. [...]
>

My hope has already been shattered and my feeling been confirmed.
Consider the following generalization of the expanded recurrences
corresponding to the two-term relations in the file

<http://www.apmaths.uwo.ca/RuleBasedMathematics/RecurrencesForRationalFunctionsOfCosines.pdf>:

(l+m+n+1)*b * f(l, m+1, n)
+ (l+m)*a * f(l, m, n)
- (m+n)*b * f(l, m-1, n)
- (m-1)*a * f(l, m-2, n)
- SIN(x)^(l+1)*COS(x)^(m-1)*(a + b*COS(x))^(n+1) = 0

n*b*(b^2 - a^2) * f(l, m+1, n-1)
- ((l+m)*a^2 - (m-2*n-1)*b^2) * f(l, m, n)
- (2*m-n-2)*b * f(l, m-1, n+1)
+ (m-1) * f(l, m-2, n+2)
+ a^2 * SIN(x)^(l+1)*COS(x)^(m-1)*(a + b*COS(x))^n = 0

n*a*(b^2 - a^2) * f(l, m, n-1)
+ ((l+m+3*n+2)*a^2 - (m+n+1)*b^2) * f(l, m, n)
- (2*l+2*m+3*n+4)*a * f(l, m, n+1)
+ (l+m+n+2) * f(l, m, n+2)
- b^2 * SIN(x)^(l+1)*COS(x)^(m+1)*(a + b*COS(x))^n = 0

where f(l, m, n) := INT(SIN(x)^l*COS(x)^m*(a+b*COS(x))^n, x). Obviously,
an arbitrary power of SIN(x) can be included here without increasing the
complexity of the recurrences. I expect the same to hold true for the
telescoped two-term relations listed in the file.

For a^2 = b^2 the first relation simplifies to:

(l+m+n+1)*b * f(l, m+1, n)
- n*a * f(l, m, n)
- m*b * f(l, m-1, n)
- b * SIN(x)^(l+1)*COS(x)^m*(a + b*COS(x))^n = 0

For n = 0 the first relation simplifies to (cf. GR 2.510):

(l+m) * f(l, m, 0)
- (m-1) * f(l, m-2, 0)
- SIN(x)^(l+1)*COS(x)^(m-1) = 0

For m = 0 the third relation simplifies to:

n*(b^2 - a^2) * f(l, 0, n-1)
+ (l+2*n+1)*a * f(l, 0, n)
- (l+n+1) * f(l, 0, n+1)
+ b * SIN(x)^(l+1)*(a + b*COS(x))^n = 0

Note that the index l of f(l, m, n) can be decreased in steps of two by
writing SIN(x)^2 = 1 - COS(x)^2. Applying the telescoped m recurrence
twice thus yields a general two-term relation for decreasing l by two. A
two-term formula for increasing l by two should follow by inversion of
this result.

Martin.

PS: I propose not to delay Rubi 3 even if the above looks useful!

Message has been deleted

clicl...@freenet.de

unread,
Jan 15, 2011, 2:14:07 AM1/15/11
to

clicl...@freenet.de schrieb:
>
> [...] Consider the following generalization of the expanded

> recurrences corresponding to the two-term relations in the file
>
> <http://www.apmaths.uwo.ca/RuleBasedMathematics/RecurrencesForRationalFunctionsOfCosines.pdf>:
>
> [...] Obviously, an arbitrary power of SIN(x) can be included here
> without increasing the complexity of the recurrences. [...]
>

... and these results can be generalized further. With f(l, m, n) :=
INT(SIN(x)^l * (a+b*COS(x))^m * (c+d*COS(x))^n, x) one has:

(l+m+n+1)*d * f(l, m+1, n)
- ((2*l+3*m+2*n+1)*a*d - (l+m)*b*c) * f(l, m, n)
+ ((l+3*m+n-1)*a^2*d - (l+2*m-1)*a*b*c - (m+n)*b^2*d) * f(l, m-1, n)
+ (m-1)*(b^2 - a^2)*(a*d - b*c) * f(l, m-2, n)
- b^2 * SIN(x)^(l+1)*(a+b*COS(x))^(m-1)*(c+d*COS(x))^(n+1) = 0

n*d*(d^2 - c^2) * f(l, m+1, n-1)
- ((l+m)*b*c^2 - (l+2*n+1)*a*c*d - (m-2*n-1)*b*d^2) * f(l, m, n)
- ((l+n+1)*a^2*d - (l+2*m-1)*a*b*c + (2*m-n-2)*b^2*d) * f(l, m-1, n+1)
+ b*(m-1)*(b^2 - a^2) * f(l, m-2, n+2)
+ (a*d - b*c)^2 * SIN(x)^(l+1)*(a+b*COS(x))^(m-1)*(c+d*COS(x))^n = 0

The first recurrence for c^2 = d^2:

(l+m+n+1)*d * f(l, m+1, n)
- ((l+2*m+n+1)*a*d + n*b*c) * f(l, m, n)
- m*d*(b^2 - a^2) * f(l, m-1, n)
- b*d * SIN(x)^(l+1)*(a+b*COS(x))^m*(c+d*COS(x))^n = 0

The first recurrence for n = 0:

(l+m+1) * f(l, m+1, 0)
- (l+2*m+1)*a * f(l, m, 0)
- m*(b^2 - a^2) * f(l, m-1, 0)
- b * SIN(x)^(l+1)*(a+b*COS(x))^m = 0

Note that the number of formulae could be reduced here because of the
extra symmetry (a,b,m) <-> (c,d,n).

I was inspired to try this generalization by the four-term recurrences
2.592(1) and (6) in Gradshteyn-Ryzhik (I remember that I failed when I
attempted something similar in the SEC case; indeed the present
recurrences cannot be converted to equivalent SEC relations). As no
reference is given for GR 2.592, these formulae were apparently worked
out by Iosif Moiseevich Ryzhik himself.

There are even five-term recurrences like 2.585(1) etc. in GR; for these
I expect a Rubi implementation of telescoped versions to be nearly
forbidding as this would require pattern matching of factors like A +
B*SIN + C*SIN^2 + D*SIN^3 where any combination of coefficients A,B,C,D
may vanish. Fortunately these five-term recurrences can be avoided
since splitting integrands like R(SIN) / SQRT(a+b*SIN^2) into their even
and odd parts, i.e. into R1(SIN^2) / SQRT(a+b*SIN^2) + SIN*R2(SIN^2) /
SQRT(a+b*SIN^2), serves to simplify the problem. Here R, R1, R2 are
rational functions, and this decomposition of R into its even and odd
parts proves useful for algebraic elliptic integrals as well.


Albert Rich schrieb:
>
> [...] However the concise and comprehensible antiderivatives that
> result are truly spectacular as compared to those produced by other
> systems.
>

Does this apply to FriCAS too, which presumably doesn't rely on a
TAN(x/2) variable transformation? For example, INT(COS(x)^3 /
(2-COS(x))^2, x) on Derive 6.10 simplifies to

40*SQRT(3)*ATAN(SIN(x)/(COS(x)-SQRT(3)-2))/9
+ (3*COS(x)*(SIN(x)+4*x)-2*(7*SIN(x)+12*x))/(3*(COS(x)-2))
- 20*SQRT(3)*x/9

This antiderivative is correct and continuous on the real axis. Are the
Rubi 3 and FriCAS results simpler and less ugly?

Martin.

Message has been deleted

clicl...@freenet.de

unread,
Jan 16, 2011, 4:01:13 AM1/16/11
to

Albert Rich schrieb:
>
> Rules for when f is the cosine function are pretty much complete. Now
> I have to replicate that work for the other 5 trig functions and 6
> hyperbolic functions. Hopefully Rubi 3 will be available in a month or
> so...
>

I have looked into tangent recurrences, but found nothing useful beyond
the result of telescoping a three-term recurrence given earlier in this
thread for integrands (a+b*TAN)^n. The resulting two-term recurrence and
its inverse are:

n*INT((c + d*TAN(x))*(a + b*TAN(x))^n, x)
- n*INT(((a*c - b*d) + (a*d + b*c)*TAN(x))*(a + b*TAN(x))^(n-1), x)
- d*(a + b*TAN(x))^n = 0

(n+1)*(a^2 + b^2)*INT((c + d*TAN(x))*(a + b*TAN(x))^n, x)
- (n+1)*INT(((a*c + b*d) + (a*d - b*c)*TAN(x))
*(a + b*TAN(x))^(n+1), x)
- (b*c - a*d)*(a + b*TAN(x))^(n+1) = 0

For a^2 + b^2 = 0 one simply has:

n*INT((a + b*TAN(x))^(n+1), x)
- 2*n*a*INT((a + b*TAN(x))^n, x)
- b*(a + b*TAN(x))^n = 0

These results are structurally equivalent to the sine formula GR
2.551(1) and the cosine formula GR 2.554(1). Equivalent cotangent
relations follow via COT(x) = TAN(pi/2-x).

For the antiderivative of TAN(x)^3 / (2-TAN(x))^2 = 8/(TAN(x)-2)^2 +
12/(TAN(x)-2) + TAN(x) + 4, Derive 6.10 already gives

28*LN(2*COS(x) - SIN(x))/25 - LN(COS(x)) + 4*(2*(x + 5)*COS(x) -
x*SIN(x))/(25*(2*COS(x) - SIN(x)))

which appears to be optimal. So the above recurrences may actually be of
little value. By the way, Derive 6.10 simplifies the second recurrence
in full generality to 0 = 0; there is no need to resort to
differentiation here.

Martin.

clicl...@freenet.de

unread,
Jan 17, 2011, 3:06:22 AM1/17/11
to

clicl...@freenet.de schrieb:
>
> [...] The resulting two-term recurrence and its inverse are:

>
> n*INT((c + d*TAN(x))*(a + b*TAN(x))^n, x)
> - n*INT(((a*c - b*d) + (a*d + b*c)*TAN(x))*(a + b*TAN(x))^(n-1), x)
> - d*(a + b*TAN(x))^n = 0
>
> (n+1)*(a^2 + b^2)*INT((c + d*TAN(x))*(a + b*TAN(x))^n, x)
> - (n+1)*INT(((a*c + b*d) + (a*d - b*c)*TAN(x))
> *(a + b*TAN(x))^(n+1), x)
> - (b*c - a*d)*(a + b*TAN(x))^(n+1) = 0
>
> For a^2 + b^2 = 0 one simply has:
>
> n*INT((a + b*TAN(x))^(n+1), x)
> - 2*n*a*INT((a + b*TAN(x))^n, x)
> - b*(a + b*TAN(x))^n = 0
>

The corresponding expanded relation can be generalized by including a
power COS^m:

n*(a^2 + b^2) * f(m, n-1)
+ (m-2*n)*a * f(m, n)
- (m-n) * f(m, n+1)
- b * COS(x)^m*(a + b*TAN(x))^n = 0

where f(m, n) := INT(COS(x)^m * (a+b*TAN(x))^n, x). I expect the
telescoped relations to admit the same generalization.

Martin.

Waldek Hebisch

unread,
Jan 18, 2011, 11:11:08 AM1/18/11
to
clicl...@freenet.de wrote:
>
> Does this apply to FriCAS too, which presumably doesn't rely on a
> TAN(x/2) variable transformation? For example, INT(COS(x)^3 /
> (2-COS(x))^2, x) on Derive 6.10 simplifies to
>
> 40*SQRT(3)*ATAN(SIN(x)/(COS(x)-SQRT(3)-2))/9
> + (3*COS(x)*(SIN(x)+4*x)-2*(7*SIN(x)+12*x))/(3*(COS(x)-2))
> - 20*SQRT(3)*x/9
>
> This antiderivative is correct and continuous on the real axis. Are the
> Rubi 3 and FriCAS results simpler and less ugly?
>

FriCAS gives:

(1) -> integrate(cos(x)^3/(2-cos(x))^2, x)

(1)
+-+
\|3 sin(x) +-+ +-+
(- 40cos(x) + 80)atan(----------) + (3\|3 cos(x) - 14\|3 )sin(x)
cos(x) + 1
+
+-+ +-+
12x\|3 cos(x) - 24x\|3
/
+-+ +-+
3\|3 cos(x) - 6\|3


I am not sure why you think that FriCAS "presumably doesn't rely on a
TAN(x/2) variable transformation": Risch algorithm does not directly
apply to sin(x) or cos(x). FriCAS has special algorithm to directly
handle some integrals involving tangents, in more complicated cases
FriCAS converts integrals to exponential form. Concerning
"discontinuous" atan: it is discontinuous only if you insit
that you want single valued functions (as multivalued funtion
it is continuous). Of course, it would be nice to have
single valued function, but I am not sure if it is always
possible (without introducing ugly things like uwinding
number or similar).


--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
Jan 19, 2011, 11:46:34 AM1/19/11
to

I am in the process of collecting two-term recurrences for
antiderivatives of trigonometric functions, where I am limiting myself
to integrands involving no more than three independent terms in the
numerator, or equivalently to expanded recurrences involving no more
than four independent integrals. Evidently a restriction of this kind is
needed to keep the task finite. While elliptic integrals cannot be
covered in full generality below this level of complexity, pattern
matching on this level appears to be feasible, if difficult, in a
Rubi-type symbolic integrator (higher levels, as exemplified by the
five-term recurrences 2.585 - 2.591 in Gradshteyn and Ryzhik, might
simplify calculations though, or lead to better results). My summary
begins with two-term recurrences of the type listed in section 2.55 -
2.56 of Gradshteyn and Ryzhik.

1. A Rubi-friendly version of the recurrence 2.558(1) is:

(n + 1)*(a^2 - b^2 - c^2)*INT((A + B*COS(x) + C*SIN(x))
*(a + b*COS(x) + c*SIN(x))^n, x)
- INT(((n + 1)*(A*a - B*b - C*c) - (n + 2)*((A*b - B*a)*COS(x)
+ (A*c - C*a)*SIN(x)))*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
+ ((B*c - C*b) + (A*c - C*a)*COS(x) - (A*b - B*a)*SIN(x))
*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

where I have corrected one sign. The inverse recurrence reads:

(n + 1)*a*INT((A + B*COS(x) + C*SIN(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- INT((a*((n + 1)*a*A + n*(b*B + c*C)) + ((n + 1)*a*b*A
+ n*(a^2*B + b*c*C - c^2*B))*COS(x) + ((n + 1)*a*c*A + n*(a^2*C
- b^2*C + b*c*B))*SIN(x))*(a + b*COS(x) + c*SIN(x))^(n - 1), x)
+ (b*C - c*B + a*C*COS(x) - a*B*SIN(x))*(a + b*COS(x) + c*SIN(x))^n = 0

For a^2 = b^2 + c^2 one simply has:

(2*n + 1)*a*INT((a + b*COS(x) + c*SIN(x))^n, x)
- (n + 1)*INT((a + b*COS(x) + c*SIN(x))^(n + 1), x)
- (c*COS(x) - b*SIN(x))*(a + b*COS(x) + c*SIN(x))^n = 0

which can be read both ways. Integrands with nonzero B and/or C can be
handled via the reduction formula:

(n + 1)*a*INT((A + B*COS(x) + C*SIN(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- ((n + 1)*A*a + n*(B*b + C*c))*INT((a + b*COS(x) + c*SIN(x))^n, x)
- (B*c - C*b - C*a*COS(x) + B*a*SIN(x))*(a + b*COS(x) + c*SIN(x))^n = 0

where again a^2 = b^2 + c^2. Some terminal rules for half-integer n can
be found in Gradshteyn-Ryzhik under 2.617.

2. By setting B = b = 0 and then renaming C and c, the above may be
specialized to sine recurrences corresponding to 2.551(1) and 2.555(1).
One finds:

(n + 1)*(a^2 - b^2)*INT((A + B*SIN(x))*(a + b*SIN(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (n + 2)*(A*b - B*a)*SIN(x))
*(a + b*SIN(x))^(n + 1), x)
+ (A*b - B*a)*COS(x)*(a + b*SIN(x))^(n + 1) = 0

and the inverse:

(n + 1)*INT((A + B*SIN(x))*(a + b*SIN(x))^n, x)
- INT((((n + 1)*A*a + n*B*b) + ((n + 1)*A*b + n*B*a)*SIN(x))
*(a + b*SIN(x))^(n - 1), x)
+ B*COS(x)*(a + b*SIN(x))^n = 0

For a^2 = b^2 one obtains the recurrence:

(2*n + 1)*a*INT((a + b*SIN(x))^n, x)
- (n + 1)*INT((a + b*SIN(x))^(n + 1), x)
- b*COS(x)*(a + b*SIN(x))^n = 0

and the reduction formula:

(n + 1)*a*INT((A + B*SIN(x))*(a + b*SIN(x))^n, x)
- ((n + 1)*A*a + n*B*b)*INT((a + b*SIN(x))^n, x)
+ B*a*COS(x)*(a + b*SIN(x))^n = 0

In these relations I have ignored that the integrands may contain an
arbitrary constant power of COS(x).

3. In the same way one obtains cosine recurrences that correspond to
2.554(1) and 2.555(2) in Gradshteyn-Ryzhik:

(n + 1)*(a^2 - b^2)*INT((A + B*COS(x))*(a + b*COS(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (n + 2)*(A*b - B*a)*COS(x))
*(a + b*COS(x))^(n + 1), x)
- (A*b - B*a)*SIN(x)*(a + b*COS(x))^(n + 1) = 0

(n + 1)*INT((A + B*COS(x))*(a + b*COS(x))^n, x)
- INT((((n + 1)*A*a + n*B*b) + ((n + 1)*A*b + n*B*a)*COS(x))
*(a + b*COS(x))^(n - 1), x)
- B*SIN(x)*(a + b*COS(x))^n = 0

For a^2 = b^2:

(2*n + 1)*a*INT((a + b*COS(x))^n, x)
- (n + 1)*INT((a + b*COS(x))^(n + 1), x)
+ b*SIN(x)*(a + b*COS(x))^n = 0

(n + 1)*a*INT((A + B*COS(x))*(a + b*COS(x))^n, x)
- ((n + 1)*A*a + n*B*b)*INT((a + b*COS(x))^n, x)
- B*a*SIN(x)*(a + b*COS(x))^n = 0

Here, the integrands may contain an arbitrary constant power of SIN(x).

4. Although they are missing in Gradshteyn-Ryzhik, I am including here
equivalent tangent recurrences from an earlier post, augmented by a
reduction formula for a^2 + b^2 = 0:

(n + 1)*(a^2 + b^2)*INTZ((A + B*TAN(x))*(a + b*TAN(x))^n, x)
- (n + 1)*INT(((A*a + B*b) - (A*b - B*a)*TAN(x))
*(a + b*TAN(x))^(n + 1), x)
- (A*b - B*a)*(a + b*TAN(x))^(n + 1) = 0

n*INT((A + B*TAN(x))*(a + b*TAN(x))^n, x)
- n*INT(((A*a - B*b) + (A*b + B*a)*TAN(x))*(a + b*TAN(x))^(n - 1), x)
- B*(a + b*TAN(x))^n = 0

For a^2 + b^2 = 0:

2*n*a*INT((a + b*TAN(x))^n, x)
- n*INT((a + b*TAN(x))^(n + 1), x)
+ b*(a + b*TAN(x))^n = 0

n*a*INT((A + B*TAN(x))*(a + b*TAN(x))^n, x)
- n*(A*a - B*b)*INT((a + b*TAN(x))^n, x)
- B*a*(a + b*TAN(x))^n = 0

In these relations I have ignored that the integrands may contain an
arbitrary constant power of COS(x).

5. The equivalent cotangent recurrences are:

(n + 1)*(a^2 + b^2)*INT((A + B*COT(x))*(a + b*COT(x))^n, x)
- (n + 1)*INT(((A*a + B*b) - (A*b - B*a)*COT(x))
*(a + b*COT(x))^(n + 1), x)
+ (A*b - B*a)*(a + b*COT(x))^(n + 1) = 0

n*INT((A + B*COT(x))*(a + b*COT(x))^n, x)
- n*INT(((A*a - B*b) + (A*b + B*a)*COT(x))*(a + b*COT(x))^(n - 1), x)
+ B*(a + b*COT(x))^n = 0

For a^2 + b^2 = 0:

2*n*a*INT((a + b*COT(x))^n, x)
- n*INT((a + b*COT(x))^(n + 1), x)
- b*(a + b*COT(x))^n = 0

n*a*INT((A + B*COT(x))*(a + b*COT(x))^n, x)
- n*(A*a - B*b)*INT((a + b*COT(x))^n, x)
+ B*a*(a + b*COT(x))^n = 0

The above integrands may contain an arbitrary constant power of SIN(x).

The second instalment of my summary is to cover recurrences involving
two powers of linear functions of either SIN(x) or COS(x).

Martin.

clicl...@freenet.de

unread,
Jan 20, 2011, 3:30:11 AM1/20/11
to

Waldek Hebisch schrieb:

The FriCAS antiderivative is trivially equivalent to

- 40*SQRT(3)*ATAN(SQRT(3)*TAN(x/2))/9
- 8*SIN(x)/(3*(COS(x) - 2)) + SIN(x) + 4*x

while the Derive antiderivative is trivially equivalent to

40*SQRT(3)*ATAN(SIN(x)/(COS(x) - SQRT(3) - 2))/9 - 20*SQRT(3)*x/9
- 8*SIN(x)/(3*(COS(x) - 2)) + SIN(x) + 4*x

A TAN(x/2) substitution, as represented by the Derive rule

" INT(F(SIN(a*x+b),COS(a*x+b)),x) -> 2/a*SUBST(INT(F(2*x/(1+x^2),
(1-x^2)/(1+x^2))*(1/(1+x^2)),x),x,TAN((a*x+b)/2)) "

turns the expanded integrand

8*INT(1/(COS(x) - 2)^2, x) + 12*INT(1/(COS(x) - 2), x)
+ INT(COS(x), x) + INT(4, x)

into

16*SUBST(INT((x^2 + 1)^2/((x^2 + 1)*(3*x^2 + 1)^2), x),
x, SIN(x)/(COS(x) + 1))
+ 24*SUBST(INT(- (x^2 + 1)/((x^2 + 1)*(3*x^2 + 1)), x),
x, SIN(x)/(COS(x) + 1))
+ INT(COS(x), x) + INT(4, x)

and then standard textbook integration recipes for rational functions
lead precisely to the FriCAS result.

This makes me suspect that the Risch integrator of FriCAS either uses
the TAN(x/2) substitution explicitly, or that the Risch procedure is at
least implicitly equivalent to it. Explicit use would make sense because
the standard reduction of rational functions is of course a part of the
Risch procedure, and because FriCAS then wouldn't have to deal with the
much more involved "transcendental exponential case" here.

Is such an explicit TAN(x/2) transformation implemented in the FriCAS
Risch integrator? I thought that the standard Risch procedure would be
to convert trigonometric functions to exponentials and to handle the
resulting integrand as a "transcendental exponential case".

In science and engineering as well as in math education, the vast
majority of functions and their antiderivatives are of interest only
along the real axis. I consider it an important mark of quality if a
symbolic integrator manages to return an antiderivative that is
continuous along the real axis when it is fed a function that is
integrable along the real axis. (In addition, the antiderivative should
be real if the integrand is real.)

Of course my integrand above exhibits two chains of poles at x = 2*pi*k
+- #i*LN(SQRT(3)+2), which give rise to equivalent chains poles with
logarithmic contributions in the antiderivative. Each logarithmic pole
must be the starting point or the end point of a branch cut; the task
then is to keep the branch cuts in the antiderivative away from the real
axis.

Martin.

PS: My knowledge of Risch integration is based on Bronstein's "Symbolic
Integration Tutorial", which I read a few years ago (but without working
through all the details).

Waldek Hebisch

unread,
Jan 20, 2011, 2:02:14 PM1/20/11
to

As I wrote FriCAS rewrites sin(x) and cos(x) by functions of tan(x/2) before
using Risch algoritm. This applies to all trigonometric functions,
so for example sin(x^3+x) is rewritten as

3
x + x
2tan(------)
2
(1) ----------------
3 2
x + x
tan(------) + 1
2

There is special variant of Risch algorithm which handles tangents
directly. In other words FriCAS does _not_ perform substitution to
get rational function. OTOH, there is essentally unique "simplest"
form of integral when written in terms of tan(x/2) and Risch algorithm
finds this form, so the result is equivalent to the one obtained
by substitution.

The algorithm to handle tangents is quite complicated and currently
implemented part works only if tangent is the only transcendental
in the integrand, otherwise FriCAS converts trigonometric functions
to complex exponentials. Let me add that I am not sure of merits
of having special routine for tangets, because version using
complex exponentials should produce the same results or simpler.
OTOH it is likely that handling tangents directly is more efficient.



> In science and engineering as well as in math education, the vast
> majority of functions and their antiderivatives are of interest only
> along the real axis. I consider it an important mark of quality if a
> symbolic integrator manages to return an antiderivative that is
> continuous along the real axis when it is fed a function that is
> integrable along the real axis. (In addition, the antiderivative should
> be real if the integrand is real.)
>

I agree that real functions are important, but for example in
electrical engineering the is a lot of use of complex functions.
So, I want methods which correcly handle complex functions
(unfortunatly, currently FriCAS in few places assumes that
functions are real and mishandles complex ones). Of course
avoiding spurious branch cuts is good, but I would not put
this above other qualities like introducing no extra singularites
and regularity of results (trivial variation of input should
give trivial variation on output).

> Of course my integrand above exhibits two chains of poles at x = 2*pi*k
> +- #i*LN(SQRT(3)+2), which give rise to equivalent chains poles with
> logarithmic contributions in the antiderivative. Each logarithmic pole
> must be the starting point or the end point of a branch cut; the task
> then is to keep the branch cuts in the antiderivative away from the real
> axis.
>

I am not sure if this is possible in general. OTOH handling few
popular special cases is good for publicity, but not very
satisfying.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
Jan 25, 2011, 4:28:18 AM1/25/11
to

The second part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions proposes a replacement for
recurrence 2.558(1) in Gradshteyn and Ryzhik and then moves on to
include a second power in the integrand.

6. Hidden in the general case of recurrence 2.558(1) is one degree of
freedom which can be exploited to eliminate either the sine term or the
cosine term from the numerator of the integrand. While the pleasing
symmetry between SIN(x) and COS(x) is sacrificed, the pattern-matching
burden of a Rubi-type integrator can thus be eased a bit. The
recurrences without a sine term require that b /= 0:

(n + 1)*b*(a^2 - b^2 - c^2)*INT((A + B*COS(x))


*(a + b*COS(x) + c*SIN(x))^n, x)

- INT(((n + 1)*b*(A*a - B*b) - (n + 2)*(A*(b^2 + c^2)
- B*a*b)*COS(x))*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
- (c*(A*a - B*b) + (A*(b^2 + c^2) - B*a*b)*SIN(x))


*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

n*(n + 1)*b*INT((A + B*COS(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- n*INT((((n + 1)*A*a + n*B*b)*b + ((n + 1)*A*(b^2 + c^2)
+ n*B*a*b)*COS(x))*(a + b*COS(x) + c*SIN(x))^(n - 1), x)
+ ((n + 1)*A*c - n*B*b*SIN(x))*(a + b*COS(x) + c*SIN(x))^n = 0

Integrals with C /= 0 here need first to be reduced via:

(n + 1)*b*INT((A + B*COS(x) + C*SIN(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- (n + 1)*INT((A*b + (B*b + C*c)*COS(x))


*(a + b*COS(x) + c*SIN(x))^n, x)

+ C*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

The special case a^2 = b^2 + c^2 of 2.558(1) is not affected by this
modification.

7. The equivalent recurrences without a cosine term require c /= 0:

(n + 1)*c*(a^2 - b^2 - c^2)*INT((A + C*SIN(x))


*(a + b*COS(x) + c*SIN(x))^n, x)

- INT(((n + 1)*c*(A*a - C*c) - (n + 2)*(A*(b^2 + c^2)
- C*a*c)*SIN(x))*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
+ (b*(A*a - C*c) + (A*(b^2 + c^2) - C*a*c)*COS(x))


*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

n*(n + 1)*c*INT((A + C*SIN(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- n*INT((((n + 1)*A*a + n*C*c)*c + ((n + 1)*A*(b^2 + c^2)
+ n*C*a*c)*SIN(x))*(a + b*COS(x) + c*SIN(x))^(n - 1), x)
- ((n + 1)*A*b - n*C*c*COS(x))*(a + b*COS(x) + c*SIN(x))^n = 0

The corresponding reduction formula is:

(n + 1)*c*INT((A + B*COS(x) + C*SIN(x))*(a + b*COS(x) + c*SIN(x))^n, x)
- (n + 1)*INT((A*c + (B*b + C*c)*SIN(x))


*(a + b*COS(x) + c*SIN(x))^n, x)

- B*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

An integrator should of course implement only one of the two equivalent
sets of recurrences.

8. A recent post gave four-term recurrences for integrals involving two
cosine powers of the type (a + b*COS(x))^m * (c + d*COS(x))^n. The sine
equivalents of these can be telescoped into the following two-term
relations:

(m + 1)*(a^2 - b^2)*(a*d - b*c)*INT((A + B*SIN(x) + C*SIN(x)^2)
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
+ INT((A*((m + n + 2)*b^2*d - (m + 1)*a*(a*d - b*c)) - ((m + 1)
*b*c + (n + 1)*a*d)*(B*b - C*a) + (((m + 1)*(a*d - b*c) - b*c)
*(A*b - B*a + C*b) - C*(a^2 - b^2)*c)*SIN(x)
- (m + n + 3)*(A*b^2 - (B*b - C*a)*a)*d*SIN(x)^2)
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^n, x)
- (A*b^2 - (B*b - C*a)*a)*COS(x)
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^(n + 1) = 0

(m + n + 2)*d*INT((A + B*SIN(x) + C*SIN(x)^2)
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)
+ ((m + n + 2)*(A*b + B*a + C*b)*d - C*(a*c + b*d))*SIN(x)
+ ((m + n + 2)*B*b*d - C*((m + 1)*b*c - m*a*d))*SIN(x)^2)
*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^n, x)
+ C*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^(n + 1) = 0

(m + 1)*b*(a^2 - b^2)*INT((A + B*SIN(x) + C*SIN(x)^2)
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT(((m + 1)*(A*a - B*b + C*a)*b*c + n*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*(a*d - b*c) + B*(a*c - b*d))*b
- (A*b^2 - (B*b - C*a)*a)*c)*SIN(x) - ((m + n + 2)
*(A*b - B*a)*b + C*((m + 1)*b^2 + (n + 1)*a^2))*d*SIN(x)^2)
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^(n - 1), x)
+ (A*b^2 - (B*b - C*a)*a)*COS(x)
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^n = 0

Three more relations are obtained upon interchanging the symbols (a,b,m)
in the above with (c,d,n). Simpler recurrences result for the special


case of a^2 = b^2:

(2*m + 1)*a*(a*d - b*c)*INT((A + B*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT((m*(A*d - B*c)*a + (m + 1)*A*(a*d - b*c)
+ (n + 1)*(A*a - B*b)*d - (m + n + 2)*(A*b - B*a)*d*SIN(x))
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^n, x)
+ (A*a - B*b)*a*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*SIN(x))*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT(((m*A*d + (m - 1)*B*c)*a + (n + 1)*(A*a + B*b)*d
+ ((m + n + 1)*(A*b + B*a)*d + B*((m - 1)*a*d - m*b*c))*SIN(x))
*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^n, x)
+ B*b*COS(x)*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^(n + 1) = 0

(n + 1)*a*(c^2 - d^2)*INT((A + B*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT((m*(A*d - B*c)*b + (n + 1)*(A*c - B*d)*a
- (m + n + 2)*(A*d - B*c)*a*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^(n + 1), x)
+ (A*d - B*c)*a*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^(n + 1) = 0

(m + n + 1)*a*INT((A + B*SIN(x))*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT((m*(A*a + B*b)*c + ((n + 1)*A*c + n*B*d)*a
+ (m*(A*a + B*b)*d + ((n + 1)*A*d + n*B*c)*a)*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^(n - 1), x)
+ B*a*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^n = 0

(2*m + 1)*a^2*INT((A + B*SIN(x))*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT((((m + 1)*A*a + m*B*b)*c - n*(A*b - B*a)*d
+ ((m + n + 1)*A*a + (m - n)*B*b)*d*SIN(x))
*(a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^(n - 1), x)
- (A*b - B*a)*a*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
+ INT((((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d)*a
- (m*(A*d - B*c)*b + (n + 1)*(A*b + B*a)*d)*b*SIN(x))
*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^(n + 1), x)
- a^2*(A*d - B*c)*COS(x)
*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^(n + 1) = 0

where twice as many relations appear because the constraint breaks the
symmetry between the two powers in the integrand; the mutual replacement
(a,b,m) <-> (c,d,n) thus produces recurrences for c^2 = d^2. Finally,
when a^2 = b^2 and c^2 = d^2 hold simultaneously one finds:

((2*m + n + 1)*a*d + n*b*c)*INT((a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- (m + n + 1)*d*INT((a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^n, x)
- b*d*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^n = 0

((2*m + n)*a*d + (n - 1)*b*c)*b
*INT((a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- ((m + 2*n - 1)*b*c + m*a*d)*d
*INT((a + b*SIN(x))^(m + 1)*(c + d*SIN(x))^(n - 1), x)
+ (a*d - b*c)*b*d*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^(n - 1) = 0

each of which can be read forward as well as backward, and may also be
submitted to the operation (a,b,m) <-> (c,d,n). As in the case of a
single sine power, the recurrences in this section may be extended by
including an arbitrary constant power of COS(x) in the integrands.

9. The two-term recurrences for the corresponding cosine integrals are:

(m + 1)*(a^2 - b^2)*(a*d - b*c)*INT((A + B*COS(x) + C*COS(x)^2)
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
+ INT((A*((m + n + 2)*b^2*d - (m + 1)*a*(a*d - b*c)) - ((m + 1)
*b*c + (n + 1)*a*d)*(B*b - C*a) + (((m + 1)*(a*d - b*c) - b*c)
*(A*b - B*a + C*b) - C*(a^2 - b^2)*c)*COS(x)
- (m + n + 3)*(A*b^2 - (B*b - C*a)*a)*d*COS(x)^2)
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^n, x)
+ (A*b^2 - (B*b - C*a)*a)*SIN(x)
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^(n + 1) = 0

(m + n + 2)*d*INT((A + B*COS(x) + C*COS(x)^2)
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)
+ ((m + n + 2)*(A*b + B*a + C*b)*d - C*(a*c + b*d))*COS(x)
+ ((m + n + 2)*B*b*d - C*((m + 1)*b*c - m*a*d))*COS(x)^2)
*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^n, x)
- C*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^(n + 1) = 0

(m + 1)*b*(a^2 - b^2)*INT((A + B*COS(x) + C*COS(x)^2)
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT(((m + 1)*(A*a - B*b + C*a)*b*c + n*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*(a*d - b*c) + B*(a*c - b*d))*b
- (A*b^2 - (B*b - C*a)*a)*c)*COS(x) - ((m + n + 2)
*(A*b - B*a)*b + C*((m + 1)*b^2 + (n + 1)*a^2))*d*COS(x)^2)
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^(n - 1), x)
- (A*b^2 - (B*b - C*a)*a)*SIN(x)
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^n = 0

For a^2 = b^2 one obtains the simpler relations:

(2*m + 1)*a*(a*d - b*c)*INT((A + B*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT((m*(A*d - B*c)*a + (m + 1)*A*(a*d - b*c)
+ (n + 1)*(A*a - B*b)*d - (m + n + 2)*(A*b - B*a)*d*COS(x))
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^n, x)
- (A*a - B*b)*a*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*COS(x))*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT(((m*A*d + (m - 1)*B*c)*a + (n + 1)*(A*a + B*b)*d
+ ((m + n + 1)*(A*b + B*a)*d + B*((m - 1)*a*d - m*b*c))*COS(x))
*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^n, x)
- B*b*SIN(x)*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^(n + 1) = 0

(n + 1)*a*(c^2 - d^2)*INT((A + B*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT((m*(A*d - B*c)*b + (n + 1)*(A*c - B*d)*a
- (m + n + 2)*(A*d - B*c)*a*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^(n + 1), x)
- (A*d - B*c)*a*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^(n + 1) = 0

(m + n + 1)*a*INT((A + B*COS(x))*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT((m*(A*a + B*b)*c + ((n + 1)*A*c + n*B*d)*a
+ (m*(A*a + B*b)*d + ((n + 1)*A*d + n*B*c)*a)*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^(n - 1), x)
- B*a*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^n = 0

(2*m + 1)*a^2*INT((A + B*COS(x))*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT((((m + 1)*A*a + m*B*b)*c - n*(A*b - B*a)*d
+ ((m + n + 1)*A*a + (m - n)*B*b)*d*COS(x))
*(a + b*COS(x))^(m + 1)*(c + d*COS(x))^(n - 1), x)
+ (A*b - B*a)*a*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
+ INT((((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d)*a
- (m*(A*d - B*c)*b + (n + 1)*(A*b + B*a)*d)*b*COS(x))
*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^(n + 1), x)
+ a^2*(A*d - B*c)*SIN(x)
*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^(n + 1) = 0

and if both a^2 = b^2 and c^2 = d^2 one finally has:

((2*m + n + 1)*a*d + n*b*c)*INT((a + b*COS(x))^m*(c + d*COS(x))^n, x)
- (m + n + 1)*d*INT((a + b*COS(x))^(m + 1)*(c + d*COS(x))^n, x)
+ b*d*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^n = 0

((2*m + n)*a*d + (n - 1)*b*c)*b
*INT((a + b*COS(x))^m*(c + d*COS(x))^n, x)
- ((m + 2*n - 1)*b*c + m*a*d)*d
*INT((a + b*COS(x))^(m + 1)*(c + d*COS(x))^(n - 1), x)
- (a*d - b*c)*b*d*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^(n - 1) = 0

All cosine recurrences in this section may be extended by including an
arbitrary constant power of SIN(x) in the integrands.

The third instalment of my summary is to cover two-term recurrences for
integrals involving two powers of the remaining trigonometric functions
TAN(x), COT(x), SEC(x), and CSC(x).

Martin.

clicl...@freenet.de

unread,
Jan 26, 2011, 8:25:17 AM1/26/11
to

We had slightly different concepts of a "TAN(x/2)" variable substituion
(or transformation), but the essential point is the same. Once SIN(x)
and COS(x) in an integrand have been replaced by 2*TAN(x/2) / (1 +
TAN(x/2)^2) and (1 - TAN(x/2)^2) / (1 + TAN(x/2)^2), respectively, it is
(in a sense) already too late: As the original variable saunters along
the real axis, the transformed variable skips along the same axis from
minus infinity to zero to plus infinity, jumps back to minus infinity
and retraces the same path again and again. If the antiderivative
involves logarithmic terms (that is LN or ATAN functions), all of their
sheets (i.e. an infinite number) are traversed, and discontinuities
appear to be guaranteed.

Indeed, if the integration variable doesn't additionally occur outside
the tangent function, a subsequent variable substitution as prescribed
by the (pseudo-)Derive rule
"INT(F(TAN(a*x+b)),x) -> 1/a*SUBST(INT(F(x)/(1+x^2),x),x,TAN(a*x+b))"
reduces the integrand to a rational function as before, and in this case
your special Risch procedure for tangents is likely to be equivalent to
this reduction.

While complex-valued functions are not so uncommon in science and
engineering, the integration of real or complex functions along paths
that traverse the complex plane away from the real axis are much rarer
in practice. But since the continuous Derive antiderivative is as valid
over the entire complex plane as the discontinuous FriCAS result,
nothing is lost by using it for the latter purpose too.

In the case of my integrand COS(x)^3 / (2-COS(x))^2, the relocation of
branch cuts comes at the cost of an extra term, and as long as Risch
integration is trimmed to produce a minimum number of terms it must
necessarily miss it. Often, however, such a relocation simply means a
splitting or fusing of logarithms, as in LN(a(x)+b(x)) = LN(a(x)) +
LN(b(x)), or of arc tangents, without relevant change in overall
complexity. Although I have sometimes given up on trying to remove the
discontinuities from a particular antiderivative, I consider it natural
to assume that this is always possible in terms of the familiar
functions and their given (occasionally system-dependent) definitions.
Do you think there is any proof to the contrary?

In the Risch integrator of FriCAS, one could perhaps raise a "TAN(x/2)
warning" flag, and try to repair the LNs and ATANs of affected
antiderivatives in a special postprocessing pass. For a rule-based
integrator like Rubi, it is natural to sidestep the TAN(x/2)
substitution by adding rules that handle relevant trigonometric
integrands directly. Naturally, this adaptation of rules for rational
and algebraic integrands to trigonometric functions means a duplication
of effort, but it may in principle cover all the integrals that are
within the reach of a rule-based integrator - not merely a few special
cases.

Unfortunately, this is not just an academic question, or a publicity
stunt: such problems regularly baffle CAS users. The last related
message appeared on this newsgroup no farther back than December, under
the heading "Integrals":

"Allamarein" wrote:
> I have this function:
> y = 1 / (1+ e*cos(x))
> This function is continuous from 0 to 2*pi and e is less than 1.
> Therefore I can integrate that in this interval. Really it is
> integrable in any interval.
> The integral of this function, provided by Mathematica software is:
> Y = (2 ArcTanh[((-1 + e) Tan[x/2])/Sqrt[-1 + e^2]])/Sqrt[-1 + e^2]
> Thus, the integral from 0 to 2*pi, with e can be any value:
> I = Y(2*pi)-Y(0) = 0 but it doesn't seem the correct result.
> The integral is wrong?

Martin.

Message has been deleted

Waldek Hebisch

unread,
Feb 2, 2011, 2:44:25 PM2/2/11
to

I do not think so: we have different expression but the same function.
Moreover, the transformation is "almost reversible". More precisely
one can convert back from 'tan(x/2)' to trigonometic function and
the only thing which may change is that some 'cos(x)^2' gets
replaced by '1 - sin(x)^2'. If you generate log terms directly
in terms of 'sin(x)' and 'cos(x)' you will still have the
same problem, because 'sin(x)' and 'cos(x)' are equvalent to
'tan(x/2)'.



> Indeed, if the integration variable doesn't additionally occur outside
> the tangent function, a subsequent variable substitution as prescribed
> by the (pseudo-)Derive rule
> "INT(F(TAN(a*x+b)),x) -> 1/a*SUBST(INT(F(x)/(1+x^2),x),x,TAN(a*x+b))"
> reduces the integrand to a rational function as before, and in this case
> your special Risch procedure for tangents is likely to be equivalent to
> this reduction.
>
> While complex-valued functions are not so uncommon in science and
> engineering, the integration of real or complex functions along paths
> that traverse the complex plane away from the real axis are much rarer
> in practice. But since the continuous Derive antiderivative is as valid
> over the entire complex plane as the discontinuous FriCAS result,
> nothing is lost by using it for the latter purpose too.
>

Sure, it is good if you can easily avoid crossing branch cut when variable
is on real line.

> In the case of my integrand COS(x)^3 / (2-COS(x))^2, the relocation of
> branch cuts comes at the cost of an extra term, and as long as Risch
> integration is trimmed to produce a minimum number of terms it must
> necessarily miss it. Often, however, such a relocation simply means a
> splitting or fusing of logarithms, as in LN(a(x)+b(x)) = LN(a(x)) +
> LN(b(x)), or of arc tangents, without relevant change in overall
> complexity. Although I have sometimes given up on trying to remove the
> discontinuities from a particular antiderivative, I consider it natural
> to assume that this is always possible in terms of the familiar
> functions and their given (occasionally system-dependent) definitions.
> Do you think there is any proof to the contrary?

There are theorems which says that if some irreducible factor
appears in denominator of the integrand than it must appear
in one on the logarithms. You can avoid such theorem by
extending your field so that you loose unique factorization
for "polynomials" (say by adding extra algebraics) or by adding
extra elements so that given factor of denominator is no longer
irreducible. But those tend to produce worse singularities
than branch cuts you want to avoid. So, as long as you
write anwer in terms of functions which appear in the
integrand and logarithms of such functions there are
logarithmic terms which must appear in each answer. Of
course, you may try to combine such term with other
terms, but this is unlikely to help with branch cuts.
Splitting terms tend to help, but if terms is irreducible,
then it is not an option. Note that if you have constant
coefficients and work over C, than the only irreducible
terms are degree 1 and there is good chance that such
terms are OK with respect to branch cuts. But if you
works over Q (that is want to avoid algebraic coefficients)
or have parameters than you may get irreducible
factors of arbitrary complexity. And once you have function
that changes phase more than 2pi on the real line and you
can not split it you will get spurious branch cut in the
log.

BTW, in most examples I saw on the net there is deep reason
for branch cuts: the integral is non-periodic (because integral
over period is nonzero) while the answer is in terms of
logarithms of periodic functions. I believe that this
reason may be elliminated with reasonable effort, one basically
have to compute integral over the period and I think that
this is relatively easy thing for periodic functions with
constant coefficients. But there is second possiblity, when
you have logaritmic term which is periodic, but the phase
changes more than 2pi, and I think that this second case
is unavoidable.

The problem is real. But my poit is that in simple cases
users can realize that the answer from program does not match
their and adjust their expectations. OTOH program which
avoids branch cuts in simple cases will look good, but if
the program can not avoid cuts in more complicated cases,
than user may get wrong results without any warning.

--
Waldek Hebisch
heb...@math.uni.wroc.pl

clicl...@freenet.de

unread,
Feb 3, 2011, 5:22:57 AM2/3/11
to

The third part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions supplies some missing
reduction formulae and, after a brief look at the algebraic origin of
the recurrences, presents relations involving two tangent powers or two
cotangent powers. First, however, a small oversight in part two should
be repaired: In the last of the six sine or cosine recurrences for the
case a^2 = b^2, a constant factor can be pulled out of the second
integral. The simplified versions read:

(n + 1)*(a*d + b*c)*d*INT((A + B*SIN(x))
*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
- (m*(A*d - B*c)*a + (n + 1)*(A*a + B*b)*d)*SIN(x))


*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^(n + 1), x)

- (A*d - B*c)*a^2*COS(x)


*(a + b*SIN(x))^(m - 1)*(c + d*SIN(x))^(n + 1) = 0

for the sine recurrence, and:

(n + 1)*(a*d + b*c)*d*INT((A + B*COS(x))
*(a + b*COS(x))^m*(c + d*COS(x))^n, x)

+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
- (m*(A*d - B*c)*a + (n + 1)*(A*a + B*b)*d)*COS(x))


*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^(n + 1), x)

+ (A*d - B*c)*a^2*SIN(x)


*(a + b*COS(x))^(m - 1)*(c + d*COS(x))^(n + 1) = 0

for the cosine recurrence.

10. The recurrences given in part two for integrands involving two sine
or two cosine powers require C = 0 when a^2 = b^2, and B = C = 0 when
both a^2 = b^2 and c^2 = d^2. If this requirement is not fulfilled, the
following reduction formula may be used when a^2 = b^2 in the sine case:

(m + n + 2)*a*d*INT((A + B*SIN(x) + C*SIN(x)^2)


*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)
- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*B*a*d - C*((m + 1)*a*c - m*b*d))*SIN(x))


*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

+ C*a*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^(n + 1) = 0

and the following formula applies if both a^2 = b^2 and c^2 = d^2:

(m + n + 1)*(m + n + 2)*a*d*INT((A + B*SIN(x) + C*SIN(x)^2)


*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

- ((m + n + 2)*((m + n + 1)*A*a*d + B*(n*a*c + m*b*d))
+ C*((m^2 + m + n^2 + n + 1)*a*d + 2*m*n*b*c))


*INT((a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

+ ((m + n + 2)*B*a*d + C*(m*b*d + n*a*c) + (m + n + 1)*C*a*d*SIN(x))


*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^n = 0

The cosine equivalents of these formulae are:

(m + n + 2)*a*d*INT((A + B*COS(x) + C*COS(x)^2)


*(a + b*COS(x))^m*(c + d*COS(x))^n, x)
- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*B*a*d - C*((m + 1)*a*c - m*b*d))*COS(x))


*(a + b*COS(x))^m*(c + d*COS(x))^n, x)

- C*a*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^(n + 1) = 0

where a^2 = b^2, and

(m + n + 1)*(m + n + 2)*a*d*INT((A + B*COS(x) + C*COS(x)^2)


*(a + b*COS(x))^m*(c + d*COS(x))^n, x)

- ((m + n + 2)*((m + n + 1)*A*a*d + B*(n*a*c + m*b*d))
+ C*((m^2 + m + n^2 + n + 1)*a*d + 2*m*n*b*c))


*INT((a + b*COS(x))^m*(c + d*COS(x))^n, x)

- ((m + n + 2)*B*a*d + C*(m*b*d + n*a*c) + (m + n + 1)*C*a*d*COS(x))


*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^n = 0

where both a^2 = b^2 and c^2 = d^2.

11. When the recurrences for sine integrands are transformed to the new
variable s = SIN(x), with ds = SQRT(1-s^2) dx, they become recurrences
for integrals of algebraic functions. For the single-power integrands
given in the first part, one thus arrives at recurrences of the type
listed in Gradshteyn-Ryzhik under 2.18, while the two-power formulae in
paart two turn into recurrences for algebraic integrands of the type
(a+b*x)^m * (c+d*x)^n * (e+f*x+g*x^2)^p. Whereas the ambiguous sign of
SQRT(1-s) makes this transformation of sine relations unattractive, a
rational nature of the corresponding extra factor for tangent relations,
dt = (1+t^2) dx where t = TAN(x), permits a painless conversion to the
same types of algebraic integrands. For a rule-based integrator, such a
conversion of tangent (as well as cotangent) integrals along with the
implementation of the required algebraic recurrences appears to be the
most profitable route.

Recurrences for integrals involving two tangent powers thus call for a
compilation of recurrence formulae for algebraic integrands beyond
Gradshteyn-Ryzhik, up to the complexity level used to limit the present
summary (see the introduction to part one). As such a compilation is
unlikely to materialize overnight, the corresponding two-power tangent
relations have to be given here instead:

(m + 1)*(a^2 + b^2)*(a*d - b*c)*INT((A + B*TAN(x) + C*TAN(x)^2)
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT((A*((m + n + 2)*b^2*d + (m + 1)*(a*d - b*c)*a)
- (B*b - C*a)*((m + 1)*b*c + (n + 1)*a*d)
- (m + 1)*((A - C)*b - B*a)*(a*d - b*c)*TAN(x)
+ (m + n + 2)*(A*b^2 - (B*b - C*a)*a)*d*TAN(x)^2)
*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^n, x)


+ (A*b^2 - (B*b - C*a)*a)

*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*TAN(x) + C*TAN(x)^2)
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT(((m + n + 1)*A*a*d - C*((n + 1)*a*d + m*b*c)
+ (m + n + 1)*((A - C)*b + B*a)*d*TAN(x)
+ ((m + n + 1)*B*b*d + m*C*(a*d - b*c))*TAN(x)^2)
*(a + b*TAN(x))^(m - 1)*(c + d*TAN(x))^n, x)
- C*(a + b*TAN(x))^m*(c + d*TAN(x))^(n + 1) = 0

(m + 1)*b*(a^2 + b^2)*INT((A + B*TAN(x) + C*TAN(x)^2)
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT(((m + 1)*((A - C)*a + B*b)*b*c - n*(A*b^2 - (B*b - C*a)*a)*d
+ (m + 1)*((A - C)*(a*d - b*c) + B*(a*c + b*d))*b*TAN(x)
- ((m + n + 1)*(A*b - B*a)*b - C*((m + 1)*b^2 - n*a^2))*d*TAN(x)^2)
*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^(n - 1), x)
- (A*b^2 - (B*b - C*a)*a)*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^n = 0

Three more recurrences follow when the symbols (a,b,m) in the above are
interchanged with (c,d,n). For a^2 + b^2 = 0 one arrives at the simpler
recurrences:

2*m*a*(a*d - b*c)*INT((A + B*TAN(x))
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT((((2*m + n + 1)*A*a + (n + 1)*B*b)*d - m*(A*b + B*a)*c
- (m + n + 1)*(A*b - B*a)*d*TAN(x))
*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^n, x)
+ (A*a + B*b)*a*(a + b*TAN(x))^m*(c + d*TAN(x))^(n + 1) = 0

(m + n)*d*INT((A + B*TAN(x))*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT(((m + n)*A*a*d + B*((m - 1)*a*c - (n + 1)*b*d)
+ ((m + n)*(A*b + B*a)*d + (m - 1)*B*(a*d - b*c))*TAN(x))
*(a + b*TAN(x))^(m - 1)*(c + d*TAN(x))^n, x)
- B*b*(a + b*TAN(x))^(m - 1)*(c + d*TAN(x))^(n + 1) = 0

(n + 1)*a*(c^2 + d^2)*INT((A + B*TAN(x))
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
+ INT((m*(A*d - B*c)*b - (n + 1)*(A*c + B*d)*a
+ (m + n + 1)*(A*d - B*c)*a*TAN(x))
*(a + b*TAN(x))^m*(c + d*TAN(x))^(n + 1), x)
- (A*d - B*c)*a*(a + b*TAN(x))^m*(c + d*TAN(x))^(n + 1) = 0

(m + n)*a*INT((A + B*TAN(x))*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT((m*(A*a - B*b)*c + n*(A*c - B*d)*a + (m*(A*a - b*B)*d
+ n*(A*d + B*c)*a)*TAN(x))
*(a + b*TAN(x))^m*(c + d*TAN(x))^(n - 1), x)
- B*a*(a + b*TAN(x))^m*(c + d*TAN(x))^n = 0

2*m*a^2*INT((A + B*TAN(x))*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- INT((m*(A*a - B*b)*c + n*(A*b - B*a)*d
+ ((m + n)*A*a - (m - n)*B*b)*d*TAN(x))
*(a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^(n - 1), x)
+ (A*b - B*a)*a*(a + b*TAN(x))^m*(c + d*TAN(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*TAN(x))
*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
+ ((m + n)*A*a*d - B*((m - 1)*a*c + (n + 1)*b*d))*TAN(x))
*(a + b*TAN(x))^(m - 1)*(c + d*TAN(x))^(n + 1), x)
- (A*d - B*c)*a^2*(a + b*TAN(x))^(m - 1)*(c + d*TAN(x))^(n + 1) = 0

where the mutual replacement (a,b,m) <-> (c,d,n) results in relations
for c^2 + d^2 = 0. For a^2 + b^2 = c^2 + d^2 = 0 one finally finds:

((2*m + n)*a*d + n*b*c)*INT((a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- (m + n)*d*INT((a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^n, x)
+ b*d*(a + b*TAN(x))^m*(c + d*TAN(x))^n = 0

((2*m + n - 1)*a*d + (n - 1)*b*c)*b
*INT((a + b*TAN(x))^m*(c + d*TAN(x))^n, x)
- ((m + 2*n - 2)*b*c + m*a*d)*d
*INT((a + b*TAN(x))^(m + 1)*(c + d*TAN(x))^(n - 1), x)
- (a*d - b*c)*b*d*(a + b*TAN(x))^m*(c + d*TAN(x))^(n - 1) = 0

Either relation works both ways and remains valid under the symmetry
operation (a,b,m) <-> (c,d,n). As in the case of a single tangent power,
the integrands in these recurrences may additionally contain an
arbitrary constant power of COS(x).

12. Two-term recurrences for the equivalent cotangent integrals are:

(m + 1)*(a^2 + b^2)*(a*d - b*c)*INT((A + B*COT(x) + C*COT(x)^2)
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT((A*((m + n + 2)*b^2*d + (m + 1)*(a*d - b*c)*a)
- (B*b - C*a)*((m + 1)*b*c + (n + 1)*a*d)
- (m + 1)*((A - C)*b - B*a)*(a*d - b*c)*COT(x)
+ (m + n + 2)*(A*b^2 - (B*b - C*a)*a)*d*COT(x)^2)
*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^n, x)


- (A*b^2 - (B*b - C*a)*a)

*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*COT(x) + C*COT(x)^2)
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT(((m + n + 1)*A*a*d - C*((n + 1)*a*d + m*b*c)
+ (m + n + 1)*((A - C)*b + B*a)*d*COT(x)
+ ((m + n + 1)*B*b*d + m*C*(a*d - b*c))*COT(x)^2)
*(a + b*COT(x))^(m - 1)*(c + d*COT(x))^n, x)
+ C*(a + b*COT(x))^m*(c + d*COT(x))^(n + 1) = 0

(m + 1)*b*(a^2 + b^2)*INT((A + B*COT(x) + C*COT(x)^2)
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT(((m + 1)*((A - C)*a + B*b)*b*c - n*(A*b^2 - (B*b - C*a)*a)*d
+ (m + 1)*((A - C)*(a*d - b*c) + B*(a*c + b*d))*b*COT(x)
- ((m + n + 1)*(A*b - B*a)*b - C*((m + 1)*b^2 - n*a^2))*d*COT(x)^2)
*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^(n - 1), x)
+ (A*b^2 - (B*b - C*a)*a)*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^n = 0

For a^2 + b^2 = 0 one has the simpler relations:

2*m*a*(a*d - b*c)*INT((A + B*COT(x))
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT((((2*m + n + 1)*A*a + (n + 1)*B*b)*d - m*(A*b + B*a)*c
- (m + n + 1)*(A*b - B*a)*d*COT(x))
*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^n, x)
- (A*a + B*b)*a*(a + b*COT(x))^m*(c + d*COT(x))^(n + 1) = 0

(m + n)*d*INT((A + B*COT(x))*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT(((m + n)*A*a*d + B*((m - 1)*a*c - (n + 1)*b*d)
+ ((m + n)*(A*b + B*a)*d + (m - 1)*B*(a*d - b*c))*COT(x))
*(a + b*COT(x))^(m - 1)*(c + d*COT(x))^n, x)
+ B*b*(a + b*COT(x))^(m - 1)*(c + d*COT(x))^(n + 1) = 0

(n + 1)*a*(c^2 + d^2)*INT((A + B*COT(x))
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
+ INT((m*(A*d - B*c)*b - (n + 1)*(A*c + B*d)*a
+ (m + n + 1)*(A*d - B*c)*a*COT(x))
*(a + b*COT(x))^m*(c + d*COT(x))^(n + 1), x)
+ (A*d - B*c)*a*(a + b*COT(x))^m*(c + d*COT(x))^(n + 1) = 0

(m + n)*a*INT((A + B*COT(x))*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT((m*(A*a - B*b)*c + n*(A*c - B*d)*a
+ (m*(A*a - b*B)*d + n*(A*d + B*c)*a)*COT(x))
*(a + b*COT(x))^m*(c + d*COT(x))^(n - 1), x)
+ B*a*(a + b*COT(x))^m*(c + d*COT(x))^n = 0

2*m*a^2*INT((A + B*COT(x))*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
- INT((m*(A*a - B*b)*c + n*(A*b - B*a)*d
+ ((m + n)*A*a - (m - n)*B*b)*d*COT(x))
*(a + b*COT(x))^(m + 1)*(c + d*COT(x))^(n - 1), x)
- (A*b - B*a)*a*(a + b*COT(x))^m*(c + d*COT(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*COT(x))
*(a + b*COT(x))^m*(c + d*COT(x))^n, x)
+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
+ ((m + n)*A*a*d - B*((m - 1)*a*c + (n + 1)*b*d))*COT(x))
*(a + b*COT(x))^(m - 1)*(c + d*COT(x))^(n + 1), x)
+ (A*d - B*c)*a^2*(a + b*COT(x))^(m - 1)*(c + d*COT(x))^(n + 1) = 0

and for a^2 + b^2 = c^2 + d^2 = 0 one finally obtains:

((2*m + n)*a*d + n*b*c)*INT((a + b*COT(x))^m*(c + d*COT(x))^n, x)
- (m + n)*d*INT((a + b*COT(x))^(m + 1)*(c + d*COT(x))^n, x)
- b*d*(a + b*COT(x))^m*(c + d*COT(x))^n = 0

((2*m + n - 1)*a*d + (n - 1)*b*c)*b
*INT((a + b*COT(x))^m*(c + d*COT(x))^n, x)
- ((m + 2*n - 2)*b*c + m*a*d)*d
*INT((a + b*COT(x))^(m + 1)*(c + d*COT(x))^(n - 1), x)
+ (a*d - b*c)*b*d*(a + b*COT(x))^m*(c + d*COT(x))^(n - 1) = 0

The cotangent recurrences in this section may be extended by including


an arbitrary constant power of SIN(x) in the integrands.

The recurrences for two-power tangent and cotangent integrals have taken
up a lot of space; their secant and cosecant relatives are therefore
kindly requested to queue for the fourth instalment of this formula
collection.

Martin.

clicl...@freenet.de

unread,
Feb 3, 2011, 4:53:36 PM2/3/11
to

Albert Rich schrieb:
>
> This amazing collection of two-term recurrence equations you have
> discovered should be published in a mathematical journal to get the
> recognition it deserves. Such discoveries are just the sort that
> invariably seem to arise when implementing rule-based systems.
>
> It's interesting that the output of your research (i.e. coherent sets
> of two-term recurrences) is precisely the input I need for my work
> (i.e. generating integration rules from such recurrences). Apparently
> you have devised an at least informal procedure for generating two-
> term recurrences from a "master recursion relation" for integrands of
> a given form. Similarly, I have devised an informal procedure for
> generating a comprehensive set of integration rules from those
> recurrences.
>
> Perhaps our two informal procedures could be combined into a formal
> algorithm. Think of the possibilities. Using that algorithm, a CAS
> could generate just the rules it needs in order to integrate a given
> expression. Instead of us having to manually define and debug
> thousands of rules, a symbolic integrator could be implemented simply
> by providing it with a few master recursion relations. Then it can
> generate the rules required to integrate an expression "on the fly"
> without having to store and search through a library of thousands of
> rules. And given my conjecture that much of mathematical analysis is
> amenable to a rule-based approach, it should be possible to implement
> an entire CAS in such a high-level manner...
>
> So based on your experience, do you think there exists an algorithm
> that generates all possible two-term recurrences from a master
> recursion relation?
>

Yours is definitely the right spirit! As I expect my small series to run
up to about ten instalments, high spirits will be needed on your side as
well as mine, if we are to last through. At present I can afford to
spend about one hour per day on this project; this is why I prefer to
get the next batch of recurrences out the door before I turn to
answering other posts. My apologies for that.

The inclusion of a particular recurrence in the series means that it
falls below the preset maximum complexity; it should not be taken as a
strong recommendation of its implementation in Rubi. You are in a much
better position to judge the merits of that in each individual case. I
have doubts in particular about the wisdom of implementing all those
bulky two-power recurrences, as they hardly come across as convincing
elementary integration rules. (Some recurrences in later instalments
will be less complex again, though.)

As an alternative, possibilities of repairing TAN(x/2)-damaged
antiderivatives may be looked into. I wonder what would be the effect of
jiggling affected results as follows: Select the terms that give rise to
logarithmic poles (that is, all the terms involving logarithms, inverse
trigonometric or hyperbolic functions, and also elliptic integrals),
differentiate each of them separately, simplify the result in terms of
SIN(x) and COS(x), and let Rubi process it once again. This would be
unpleasant to automate in the present Rubi framework, I suspect, but it
might be left to the dissatisfied user to apply Jiggle[] to a result.

The mathematical background of my formula collection is fairly trivial:
the results rely on is the systematic nature of the algebraic
recurrences to which they can be reduced. Those recurrences can be given
for any number of factors where each factor may be of any degree; with
the help of a CAS it is no problem to extend them beyond Gradshteyn and
Ryzhik, and to dress them up as (i.e. telescope them into) two-term
recurrences. (The latter step should to be applied to the original
Gradshteyn-Ryzhik recurrences as well.) And an algebraic recurrence with
a sufficeint number of factors of sufficient individual degrees can be
used as a master relation to generate all simpler ones.

The varied nature of the trigonometric recurrences huddling into my
low-complexity corner makes their automatic generation look unpromising.
Any investment in this direction would probably mean more work than
churning them out directly and individually. In my view, the main point
of the resulting compilation is that it will tell at a glance what
two-term recurrences exist below a certain complexity threshold; I
imagine this is what an integrator implementer would like to know
without having to spend days on analyzing the problem.

By the way, one doesn't really have much choice when fixing the maximum
complexity level: raising it to relations involving five integrals or,
equivalently, to four independent numerator terms already means
admitting recurrences that take many pages to write down. Details of
such a case should appear in the fifth part of my series. Additionally,
I expect pattern-matching of rules involving four independent numerator
terms to be hardly practicable in the present Rubi framework if such
rules become numerous.

I am perfectly willing to turn my compilation of two-term recurrences
for antiderivatives of trigonometric functions into a TeX formatted
paper, and to upload a preprint to arxiv at least. Apart from the need
to add a descriptive title and a more informative introduction, the
repetition of SIN (or TAN, or SEC) relations as COS (or COT, or CSC)
ones should be removed for this. Ten instalments of the present size may
then amount to something like 30 printed pages. Editors and other people
in the know are invited to comment on the prospects of getting such a
compilation printed, and if so, in which journal.

Martin.

clicl...@freenet.de

unread,
Feb 17, 2011, 1:48:37 PM2/17/11
to

The fourth part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions supplies some reduction
formulae for two-power tangent and cotangent integrals and then parades
two-term recurrences for two-power secant and cosecant integrals, along
with some pertaining reduction formulae.

It should have been pointed out in section 10 of part three that the
reduction formulae for two-power sine integrals fail for certain
combinations of exponents m,n. The missing cases could handled by other
(less elegant) formulae that can be derived by fusing those given with
suitable recurrence steps; such results have been omitted, however,
because larger numerators can also quite generally be reduced by
algebraic expansion into two (or more) integrals.

Additionally, to emphasize the symmetry (a,b,m) <-> (c,d,n), the doubly
degenerate reduction formulae in section 10 should better have been
written as:

(m + n + 1)*(m + n + 2)*a*c*INT((A + B*SIN(x) + C*SIN(x)^2)


*(a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

- ((m + n + 2)*((m + n + 1)*A*a*c + B*(n*a*d + m*b*c))
+ C*((m^2 + m + n^2 + n + 1)*a*c + 2*m*n*b*d))


*INT((a + b*SIN(x))^m*(c + d*SIN(x))^n, x)

+ ((m + n + 2)*B*a*c + C*(m*b*c + n*a*d) + (m + n + 1)*C*a*c*SIN(x))


*COS(x)*(a + b*SIN(x))^m*(c + d*SIN(x))^n = 0

in the sine case, and as:

(m + n + 1)*(m + n + 2)*a*c*INT((A + B*COS(x) + C*COS(x)^2)


*(a + b*COS(x))^m*(c + d*COS(x))^n, x)

- ((m + n + 2)*((m + n + 1)*A*a*c + B*(n*a*d + m*b*c))
+ C*((m^2 + m + n^2 + n + 1)*a*c + 2*m*n*b*d))


*INT((a + b*COS(x))^m*(c + d*COS(x))^n, x)

- ((m + n + 2)*B*a*c + C*(m*b*c + n*a*d) + (m + n + 1)*C*a*c*COS(x))


*SIN(x)*(a + b*COS(x))^m*(c + d*COS(x))^n = 0

in the cosine case.

13. For the recurrences invoving two-power tangent or cotangent
integrals in part three to apply, the numerator must have C = 0 if a^2 +
b^2 = 0, and B = C = 0 if a^2 + b^2 = c^2 + d^2 = 0. In the tangent
case, the following reduction formula may be used if a^2 + b^2 = 0:

(m + n + 1)*a*d*INT((A + B*TAN(x) + C*TAN(x)^2)


*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)

- INT((m*(A*a*d - C*b*c) + (n + 1)*(A - C)*a*d
+ ((m + n + 1)*B*a*d - m*C*(a*c + b*d))*TAN(x))


*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)

- C*a*(a + b*TAN(x))^m*(c + d*TAN(x))^(n + 1) = 0

and the following holds if a^2 + b^2 = c^2 + d^2 = 0:

(m + n)*(m + n + 1)*a*c*INT((A + B*TAN(x) + C*TAN(x)^2)


*(a + b*TAN(x))^m*(c + d*TAN(x))^n, x)

- ((m + n + 1)*((m + n)*A*a*c - B*(m*b*c + n*a*d))
- C*((m^2 + m + n^2 + n)*a*c - 2*m*n*b*d))


*INT((a + b*TAN(x))^m*(c + d*TAN(x))^n, x)

- ((m + n + 1)*B*a*c - C*(m*b*c + n*a*d) + (m + n)*C*a*c*TAN(x))


*(a + b*TAN(x))^m*(c + d*TAN(x))^n = 0

The cotangent equivalents of these are:

(m + n + 1)*a*d*INT((A + B*COT(x) + C*COT(x)^2)


*(a + b*COT(x))^m*(c + d*COT(x))^n, x)

- INT((m*(A*a*d - C*b*c) + (n + 1)*(A - C)*a*d
+ ((m + n + 1)*B*a*d - m*C*(a*c + b*d))*COT(x))


*(a + b*COT(x))^m*(c + d*COT(x))^n, x)

+ C*a*(a + b*COT(x))^m*(c + d*COT(x))^(n + 1) = 0

where a^2 + b^2 = 0, and:

(m + n)*(m + n + 1)*a*c*INT((A + B*COT(x) + C*COT(x)^2)


*(a + b*COT(x))^m*(c + d*COT(x))^n, x)

- ((m + n + 1)*((m + n)*A*a*c - B*(m*b*c + n*a*d))
- C*((m^2 + m + n^2 + n)*a*c - 2*m*n*b*d))


*INT((a + b*COT(x))^m*(c + d*COT(x))^n, x)

+ ((m + n + 1)*B*a*c - C*(m*b*c + n*a*d) + (m + n)*C*a*c*COT(x))


*(a + b*COT(x))^m*(c + d*COT(x))^n = 0

where a^2 + b^2 = c^2 + d^2 = 0. Again these formulae do not cover all
combinations of exponents m,n. As before, the necessary alternatives are
omitted for their lack of elegance; in their place, algebraic expansion
of the integrands into two or more terms may be resorted to.

14. The transformation of secant integrals to algebraic ones via the
substitution s = SEC(x), ds = s*SQRT(s^2-1) dx is as unattractive as
that of sine integrals because the sign of the extra factor SQRT(s^2-1)
is ambiguous. Moreover, since a second extra factor s appears here,
integrands involving two powers of the type (a+b*SEC(x))^n cannot be
accomodated within the present complexity limit unless the second power
occurs in the form SEC(x)^m. For the same reason, substantially simpler
relations for single-power secant integrals do not exist.

Two-term recurrence relations for integrals involving the secant power
combination SEC(x)^m * (a+b*SEC(x))^n were already given in various
earlier posts, where they were derived ab initio. Equivalent results may
be obtained from the two-power cosine recurrences in part three by means
of the replacements (a,b) <- (0,1), (c,d) <- (b,a), (A,B,C) <- (C,B,A),
m <- -m-n-2, and a regrouping of factors. Suitably ordered and
formatted, the secant recurrences are:

m*a*INT((A + B*SEC(x) + C*SEC(x)^2)*SEC(x)^m*(a + b*SEC(x))^n, x)
+ INT(((m + n + 1)*A*b - m*B*a - ((m + 1)*A + m*C)*a*SEC(x)
- (m + n + 2)*A*b*SEC(x)^2)*SEC(x)^(m + 1)*(a + b*SEC(x))^n, x)
+ A*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n + 1) = 0

(m + n + 1)*b*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m - 1)*C*a + ((m + n + 1)*A + (m + n)*C)*b*SEC(x)
+ ((m + n + 1)*B*b - m*C*a)*SEC(x)^2)
*SEC(x)^(m - 1)*(a + b*SEC(x))^n, x)
- C*TAN(x)*SEC(x)^(m - 1)*(a + b*SEC(x))^(n + 1) = 0

(n + 1)*a*(a^2 - b^2)*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^n, x)
+ INT(((m + n + 1)*A*b^2 - (m*(B*b - C*a) + (n + 1)*A*a)*a
+ (n + 1)*((A + C)*b - B*a)*a*SEC(x)
- (m + n + 2)*(A*b^2 - (B*b - C*a)*a)*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^(n + 1), x)
+ (A*b^2 - (B*b - C*a)*a)*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n + 1) = 0

(m + n + 1)*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT((((m + n + 1)*A + m*C)*a
+ ((m + n + 1)*(A*b + B*a) + (m + n)*C*b)*SEC(x)
+ ((m + n + 1)*B*b + n*C*a)*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^(n - 1), x)
- C*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

m*INT((A + B*SEC(x) + C*SEC(x)^2)*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT((m*a*B - n*b*A + ((m + 1)*A*a + m*(B*b + C*a))*SEC(x)
+ ((m + n + 1)*A + m*C)*b*SEC(x)^2)
*SEC(x)^(m + 1)*(a + b*SEC(x))^(n - 1), x)
+ A*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

(n + 1)*b*(a^2 - b^2)*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m - 1)*(A*b^2 - (B*b - C*a)*a)
+ (n + 1)*((A + C)*a - b*B)*b*SEC(x)
- ((m + n + 1)*(A*b - B*a)*b + (m*a^2 + (n + 1)*b^2)*C)*SEC(x)^2)
*SEC(x)^(m - 1)*(a + b*SEC(x))^(n + 1), x)
- (A*b^2 - (B*b - C*a)*a)*TAN(x)
*SEC(x)^(m - 1)*(a + b*SEC(x))^(n + 1) = 0

By contrast with the cosine case, six relations appear here because the
symmetry between the two powers in the integrand is lost. The somewhat
simpler results for the degenerate case of a^2 = b^2 may be expressed
as:

m*a*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m*B*a - n*A*b) + (m + n + 1)*A*a*SEC(x))
*SEC(x)^(m + 1)*(a + b*SEC(x))^n, x)
+ A*a*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

(m + n)*a*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m - 1)*B*a + ((m + n)*A*a + n*B*b)*SEC(x))
*SEC(x)^(m - 1)*(a + b*SEC(x))^n, x)
- B*a*TAN(x)*SEC(x)^(m - 1)*(a + b*SEC(x))^n = 0

(2*n + 1)*a^2*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m + 2*n + 1)*A*a - m*B*b - (m + n + 1)*(A*b - B*a)*SEC(x))
*SEC(x)^m*(a + b*SEC(x))^(n + 1), x)
- (A*b - B*a)*b*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

(m + n)*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m + n)*A*a + m*B*b + ((m + 2*n - 1)*B*a + (m + n)*A*b)*SEC(x))
*SEC(x)^m*(a + b*SEC(x))^(n - 1), x)
- B*b*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n - 1) = 0

m*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT(((m - n + 1)*A*b + m*B*a + ((m + n)*A*a + m*B*b)*SEC(x))
*SEC(x)^(m + 1)*(a + b*SEC(x))^(n - 1), x)
+ A*a*TAN(x)*SEC(x)^m*(a + b*SEC(x))^(n - 1) = 0

(2*n + 1)*a^2*INT((A + B*SEC(x))*SEC(x)^m*(a + b*SEC(x))^n, x)
+ INT(((m - 1)*(A*b - B*a) - ((m + n)*A*a - (m - n - 1)*B*b)*SEC(x))
*SEC(x)^(m - 1)*(a + b*SEC(x))^(n + 1), x)
+ (A*b - B*a)*a*TAN(x)*SEC(x)^(m - 1)*(a + b*SEC(x))^n = 0

In all recurrences of this section, the integrands may be extended by
including an arbitrary constant power of CSC(x).

15. The two-term recurrence relations for the corresponding cosecant
integrals are:

m*a*INT((A + B*CSC(x) + C*CSC(x)^2)*CSC(x)^m*(a + b*CSC(x))^n, x)
+ INT(((m + n + 1)*A*b - m*B*a - ((m + 1)*A + m*C)*a*CSC(x)
- (m + n + 2)*A*b*CSC(x)^2)*CSC(x)^(m + 1)*(a + b*CSC(x))^n, x)
- A*COT(x)*CSC(x)^m*(a + b*CSC(x))^(n + 1) = 0

(m + n + 1)*b*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m - 1)*C*a + ((m + n + 1)*A + (m + n)*C)*b*CSC(x)
+ ((m + n + 1)*B*b - m*C*a)*CSC(x)^2)
*CSC(x)^(m - 1)*(a + b*CSC(x))^n, x)
+ C*COT(x)*CSC(x)^(m - 1)*(a + b*CSC(x))^(n + 1) = 0

(n + 1)*a*(a^2 - b^2)*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^n, x)
+ INT(((m + n + 1)*A*b^2 - (m*(B*b - C*a) + (n + 1)*A*a)*a
+ (n + 1)*((A + C)*b - B*a)*a*CSC(x)
- (m + n + 2)*(A*b^2 - (B*b - C*a)*a)*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^(n + 1), x)
- (A*b^2 - (B*b - C*a)*a)*COT(x)*CSC(x)^m*(a + b*CSC(x))^(n + 1) = 0

(m + n + 1)*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT((((m + n + 1)*A + m*C)*a
+ ((m + n + 1)*(A*b + B*a) + (m + n)*C*b)*CSC(x)
+ ((m + n + 1)*B*b + n*C*a)*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^(n - 1), x)
+ C*COT(x)*CSC(x)^m*(a + b*CSC(x))^n = 0

m*INT((A + B*CSC(x) + C*CSC(x)^2)*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT((m*a*B - n*b*A + ((m + 1)*A*a + m*(B*b + C*a))*CSC(x)
+ ((m + n + 1)*A + m*C)*b*CSC(x)^2)
*CSC(x)^(m + 1)*(a + b*CSC(x))^(n - 1), x)
- A*COT(x)*CSC(x)^m*(a + b*CSC(x))^n = 0

(n + 1)*b*(a^2 - b^2)*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m - 1)*(A*b^2 - (B*b - C*a)*a)
+ (n + 1)*((A + C)*a - b*B)*b*CSC(x)
- ((m + n + 1)*(A*b - B*a)*b + (m*a^2 + (n + 1)*b^2)*C)*CSC(x)^2)
*CSC(x)^(m - 1)*(a + b*CSC(x))^(n + 1), x)
+ (A*b^2 - (B*b - C*a)*a)*COT(x)
*CSC(x)^(m - 1)*(a + b*CSC(x))^(n + 1) = 0

For a^2 = b^2 one has the simpler relations:

m*a*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m*B*a - n*A*b) + (m + n + 1)*A*a*CSC(x))
*CSC(x)^(m + 1)*(a + b*CSC(x))^n, x)
- A*a*COT(x)*CSC(x)^m*(a + b*CSC(x))^n = 0

(m + n)*a*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m - 1)*B*a + ((m + n)*A*a + n*B*b)*CSC(x))
*CSC(x)^(m - 1)*(a + b*CSC(x))^n, x)
+ B*a*COT(x)*CSC(x)^(m - 1)*(a + b*CSC(x))^n = 0

(2*n + 1)*a^2*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m + 2*n + 1)*A*a - m*B*b - (m + n + 1)*(A*b - B*a)*CSC(x))
*CSC(x)^m*(a + b*CSC(x))^(n + 1), x)
+ (A*b - B*a)*b*COT(x)*CSC(x)^m*(a + b*CSC(x))^n = 0

(m + n)*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m + n)*A*a + m*B*b + ((m + 2*n - 1)*B*a + (m + n)*A*b)*CSC(x))
*CSC(x)^m*(a + b*CSC(x))^(n - 1), x)
+ B*b*COT(x)*CSC(x)^m*(a + b*CSC(x))^(n - 1) = 0

m*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT(((m - n + 1)*A*b + m*B*a + ((m + n)*A*a + m*B*b)*CSC(x))
*CSC(x)^(m + 1)*(a + b*CSC(x))^(n - 1), x)
- A*a*COT(x)*CSC(x)^m*(a + b*CSC(x))^(n - 1) = 0

(2*n + 1)*a^2*INT((A + B*CSC(x))*CSC(x)^m*(a + b*CSC(x))^n, x)
+ INT(((m - 1)*(A*b - B*a) - ((m + n)*A*a - (m - n - 1)*B*b)*CSC(x))
*CSC(x)^(m - 1)*(a + b*CSC(x))^(n + 1), x)
- (A*b - B*a)*a*COT(x)*CSC(x)^(m - 1)*(a + b*CSC(x))^n = 0

The integrands of all cosecant recurrences may be extended by including
an arbitrary constant power of SEC(x).

16. In the degenerate case a^2 = b^2 of the secant or cosecant
recurrence relations, numerators with C /= 0 may be reduced by means of
the following formulae:

(m + n + 1)*a*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)^m*(a + b*SEC(x))^n, x)
- INT((((m + n + 1)*A + m*C)*a + ((m + n + 1)*B*a + n*C*b)*SEC(x))
*SEC(x)^m*(a + b*SEC(x))^n, x)
- C*a*TAN(x)*SEC(x)^m*(a + b*SEC(x))^n = 0

(m + n + 1)*a*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)^m*(a + b*CSC(x))^n, x)
- INT((((m + n + 1)*A + m*C)*a + ((m + n + 1)*B*a + n*C*b)*CSC(x))
*CSC(x)^m*(a + b*CSC(x))^n, x)
+ C*a*COT(x)*CSC(x)^m*(a + b*CSC(x))^n = 0

Once more, these two do not work for all combinations of exponents m,n.
A full set of reduction formulae can be derived by fusing the above with
suitable recurrence steps. Alternatively, algebraic expansion of the
integrands into multiple terms may be employed.

The fifth instalment of this compilation is to cover two-term
recurrences for integrals involving powers of linear combinations of
different trigonometric functions, in particular combinations of SIN(x)
with COS(x).

Martin.

clicl...@freenet.de

unread,
Mar 10, 2011, 12:17:26 PM3/10/11
to

I found that for a^2 = b^2 one has INT(1/SQRT(a + b*SEC(x)), x) =

2/SQRT(a) * ATAN(SQRT(a)*TAN(x)/SQRT(a + b*SEC(x))) -
SQRT(2)/SQRT(a) * ATAN(SQRT(a)*TAN(x)/(SQRT(2)*SQRT(a + b*SEC(x))))

which improves on the (Mathematica?) result in the Rubi 2 rule file.

Martin.

PS: The fifth part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions is to appear very soon!

clicl...@freenet.de

unread,
Mar 11, 2011, 4:24:22 AM3/11/11
to

clicl...@freenet.de schrieb:

>
> I found that for a^2 = b^2 one has INT(1/SQRT(a + b*SEC(x)), x) =
>
> 2/SQRT(a) * ATAN(SQRT(a)*TAN(x)/SQRT(a + b*SEC(x))) -
> SQRT(2)/SQRT(a) * ATAN(SQRT(a)*TAN(x)/(SQRT(2)*SQRT(a + b*SEC(x))))
>
> which improves on the (Mathematica?) result in the Rubi 2 rule file.
>

A Rubi-type integrator may actually implement the much simpler rules

INT(SEC(x)/SQRT(a + b*SEC(x)), x) =
SQRT(2*a)/b*ATAN(SQRT(a/2)*TAN(x)/SQRT(a + b*SEC(x))))

where a^2 = b^2, and

INT(SQRT(a + b*SEC(x)), x) =
2*SQRT(a)*ATAN(SQRT(a)*TAN(x)/SQRT(a + b*SEC(x)))

where a^2 = b^2.

Martin.

clicl...@freenet.de

unread,
Mar 16, 2011, 2:47:18 PM3/16/11
to

The fifth part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions lays down the law as to which
function pairings are uncouth and employs just such examples to unravel
the mystery of constant extra powers that can be included with most
integrands. However, all uncouth relations are then quickly converted to
impeccable sine-plus-cosine ones.

One erratum must be reported: In section 14 of part four read "from the
two-power cosine recurrences in part two" for "... in part three".

16. My focus now shifts to combinations of different trigonometric
functions, which will be considered irrespective of their integrability
in elementary terms. To keep the compilation manageable, pairings other
than of SIN(x) with COS(x), TAN(x) with COT(x), or SEC(x) with CSC(x)
must be ignored as a rule, where a trigonometric pair may appear either
in linear combination or spread over different factors. Also ignored
will be the mixing of integer multiples of the trigonometric argument x
that arises when factors like a + b*COS(2*x) are rewritten as a-b +
2*b*COS(x)^2, etc. However, a degenerate case of sine-cosine pairing,
the exponential factor (COS(x) + #i*SIN(x))^m = EXP(#i*m*x) = COS(m*x) +
#i*SIN(m*x) introduces the argument m*x with arbitrary complex m, and
this factor will be allowed in any otherwise admissible integrand
(integrals where other factors carry half-integer or negative integer
exponents are thereby usually rendered non-elementary though).

For most of the recurrences listed so far, a claim that the integrands
may include certain extra factors with constant exponent has already
implied combinations of different trigonometric functions. The extra
factors invoked are nothing but extra powers of factors introduced
anyway by the transformation to algebraic integrands on which all the
relations rely (cf. section 11 in part two). As the results will prove
useful (if uncouth), this generalization is here carried out for the
single-power tangent recurrences of section 4 in part one: with dx =
COS(x)^2 dt for t = TAN(x), the tangent integrals acquire an invisible
fixed cosine power which may be modified to show up as an arbitrary
constant power in the integrands. The generalized tangent recurrences
differ only in that the new exponent enters the coefficient prefactors:

(n + 1)*(a^2 + b^2)*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT(((n + 1)*(A*a + B*b) + (m - n - 1)*(A*b - B*a)*TAN(x))
*COS(x)^m*(a + b*TAN(x))^(n + 1), x)
- (A*b - B*a)*COS(x)^m*(a + b*TAN(x))^(n + 1) = 0

(m - n)*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT(((m - n)*A*a + n*B*b + ((m - n)*A*b - n*B*a)*TAN(x))
*COS(x)^m*(a + b*TAN(x))^(n - 1), x)
+ B*COS(x)^m*(a + b*TAN(x))^n = 0

The two-way recurrence for a^2 + b^2 = 0 and the accompanying reduction
formula from section 4 generalize to:

(m - 2*n)*a*INT(COS(x)^m*(a + b*TAN(x))^n, x)
- (m - n)*INT(COS(x)^m*(a + b*TAN(x))^(n + 1), x)
- b*COS(x)^m*(a + b*TAN(x))^n = 0

(m - n)*a*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- ((m - n)*A*a + n*B*b)*INT(COS(x)^m*(a + b*TAN(x))^n, x)
+ B*a*COS(x)^m*(a + b*TAN(x))^n = 0

Note that such general cosine powers spoil a painless conversion to
algebraic integrands since the SQRT sign in COS(x) = 1/SQRT(1+TAN(x)^2)
is ambiguous.

17. For each unity step of the corresponding exponent in the equivalent
algebraic relations, the new cosine exponent in the tangent recurrences
takes an (inverted) double step because a (reciprocal) square root
enters COS(x) = 1/SQRT(1 + TAN(x)^2). Moreover, since the stepped
exponent is here carried by a second-degree polynomial in TAN(x), a
separate first-degree polynomial appears in the integrated term of the
recurrences. The results obtained for stepping the cosine exponent m
in the single-power tangent recurrences are:

(m - n)*(m - n + 1)*b^2*INT((A + B*TAN(x))
*COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*INT((((m - n)*A*b - n*B*a)*b
- ((m - n)*A*a*b - B*((m + 1)*a^2 + (m - n + 1)*b^2))*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^n, x)
+ ((m - n)*A*b - (m + 1)*B*a + (m - n + 1)*B*b*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1) = 0

m*(a^2 + b^2)*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT((A*((m - 1)*a^2 + (m - n - 1)*b^2) + n*B*a*b
+ (m - n - 2)*(A*a + B*b)*b*TAN(x))
*COS(x)^(m - 2)*(a + b*TAN(x))^n, x)
- (A*b - B*a + (A*a + B*b)*TAN(x))*COS(x)^m*(a + b*TAN(x))^(n + 1) = 0

(m - n)*(n + 1)*b^2*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*INT(((n + 1)*B*b + ((m - n)*A*b - (m + 1)*B*a)*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1), x)
- ((m - n)*A*b - (m + 1)*B*a - (n + 1)*B*b*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1) = 0

m*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT(((m - 1)*A*a + n*B*b + (m - n - 1)*A*b*TAN(x))
*COS(x)^(m - 2)*(a + b*TAN(x))^(n - 1), x)
+ (B - A*TAN(x))*COS(x)^m*(a + b*TAN(x))^n = 0

where the last two relations represent combinations of the first two
with the recurrences for constant m. Two other pairs of combined
relations whose integrated terms possess the same structure will prove
useful:

(n + 1)*(n + 2)*(a^2 + b^2)*b^2*INT((A + B*TAN(x))
*COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*INT(((n + 2)*(A*b - B*a)*b
+ (B*((m + 1)*a^2 + (n + 1)*b^2) - (m - n)*A*a*b)*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 2), x)
+ (A*((m - n)*a^2 - (n + 2)*b^2)*b - B*((m + 1)*a^2 - b^2)*a
+ ((m + 2)*A*a*b - B*((m + n + 3)*a^2 + (n + 1)*b^2))*b*TAN(x))
*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1) = 0

m*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT((A*((m - 1)*a^2 + (n - 1)*b^2) + n*B*a*b
+ ((m - n)*A*a + n*B*b)*b*TAN(x))
*COS(x)^(m - 2)*(a + b*TAN(x))^(n - 2), x)
+ (A*b + B*a - (A*a - B*b)*TAN(x))*COS(x)^m*(a + b*TAN(x))^(n - 1) = 0

(n + 1)*(n + 2)*(a^2 + b^2)^2*INT((A + B*TAN(x))
*COS(x)^m*(a + b*TAN(x))^n, x)
- INT(((n + 2)*((m - n - 1)*(A*b - B*a)*b + (n + 1)*(A*a + B*b)*a)
- (m - n - 2)*((m - n - 1)*(A*b - B*a)*a - (n + 1)*(A*a + B*b)*b)
*TAN(x))*COS(x)^m*(a + b*TAN(x))^(n + 2), x)
+ ((A*b - B*a)*((m - 2*n - 3)*a^2 - b^2) - (n + 1)*A*(a^2 + b^2)*b
+ ((m - n - 1)*(A*b - B*a)*a - (n + 1)*(A*a + B*b)*b)*b*TAN(x))
*COS(x)^m*(a + b*TAN(x))^(n + 1) = 0

(m - n)*(m - n + 1)*INT((A + B*TAN(x))*COS(x)^m*(a + b*TAN(x))^n, x)
- INT(((m - n)*A*((m - n + 1)*a^2 - b^2)
+ n*((m - n)*A*b + (m - 2*n + 2)*B*a)*b
+ ((m - n)*((m - 2*n + 2)*A*a + n*B*b)*b
+ n*B*((n - 1)*a^2 + b^2))*TAN(x))
*COS(x)^m*(a + b*TAN(x))^(n - 2), x)
+ ((m - n)*A*b + (m - 2*n + 1)*B*a + (m - n + 1)*B*b*TAN(x))
*COS(x)^m*(a + b*TAN(x))^(n - 1) = 0

of which the first pair once more combines the preceding pair with the
recurrences for constant m, while the last pair merely iterates the
recurrences for constant m. For stepping the cosine exponent m in the
degenerate case of a^2 + b^2 = 0 one obtains the simpler recurrences:

(m - n + 1)*(m - n + 2)*a*INT(COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*(m - 2*n + 2)*a*INT(COS(x)^(m + 2)*(a + b*TAN(x))^n, x)
+ (n*b + (m - n + 2)*a*TAN(x))*COS(x)^(m + 2)*(a + b*TAN(x))^n = 0

(m - n + 1)*a^2*INT(COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*a*INT(COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1), x)
- b*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1) = 0

and in correspondence with the non-degenerate case arrives at the useful
combinations:

(m - 2*n)*a^2*INT(COS(x)^m*(a + b*TAN(x))^n, x)
- (m + 2)*INT(COS(x)^(m + 2)*(a + b*TAN(x))^(n + 2), x)
- 2*b*COS(x)^(m + 2)*(a + b*TAN(x))^(n + 1) = 0

(m - 2*n)*(m - 2*n - 2)*a^2*INT(COS(x)^m*(a + b*TAN(x))^n, x)
- (m - n)*(m - n - 1)*INT(COS(x)^m*(a + b*TAN(x))^(n + 2), x)
- ((2*m - 3*n - 2)*b - (m - n)*a*TAN(x))*a
*COS(x)^m*(a + b*TAN(x))^n = 0

These four recurrences for degenerate integrands can be read forward and
backward; for two of them, the polynomial in the integrated term
vanishes.

18. Similarly putting a sine factor with constant exponent into the
single-power cotangent integrands of section 5 in part one gives the
(equally uncouth) recurrences:

(n + 1)*(a^2 + b^2)*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT(((n + 1)*(A*a + B*b) + (m - n - 1)*(A*b - B*a)*COT(x))
*SIN(x)^m*(a + b*COT(x))^(n + 1), x)
+ (A*b - B*a)*SIN(x)^m*(a + b*COT(x))^(n + 1) = 0

(m - n)*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT(((m - n)*A*a + n*B*b + ((m - n)*A*b - n*B*a)*COT(x))
*SIN(x)^m*(a + b*COT(x))^(n - 1), x)
- B*SIN(x)^m*(a + b*COT(x))^n = 0

The two-way relation and reduction formula for a^2 + b^2 = 0 here are:

(m - 2*n)*a*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- (m - n)*INT(SIN(x)^m*(a + b*COT(x))^(n + 1), x)
+ b*SIN(x)^m*(a + b*COT(x))^n = 0

(m - n)*a*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- ((m - n)*A*a + n*B*b)*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- B*a*SIN(x)^m*(a + b*COT(x))^n = 0

19. The results for stepping the sine exponent in the single-power
cotangent recurrences read:

(m - n)*(m - n + 1)*b^2*INT((A + B*COT(x))
*SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*INT((((m - n)*A*b - n*B*a)*b
- ((m - n)*A*a*b - B*((m + 1)*a^2 + (m - n + 1)*b^2))*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^n, x)
- ((m - n)*A*b - (m + 1)*B*a + (m - n + 1)*B*b*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1) = 0

m*(a^2 + b^2)*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT((A*((m - 1)*a^2 + (m - n - 1)*b^2) + n*B*a*b
+ (m - n - 2)*(A*a + B*b)*b*COT(x))
*SIN(x)^(m - 2)*(a + b*COT(x))^n, x)
+ (A*b - B*a + (A*a + B*b)*COT(x))*SIN(x)^m*(a + b*COT(x))^(n + 1) = 0

(m - n)*(n + 1)*b^2*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*INT(((n + 1)*B*b + ((m - n)*A*b - (m + 1)*B*a)*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1), x)
+ ((m - n)*A*b - (m + 1)*B*a - (n + 1)*B*b*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1) = 0

m*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT(((m - 1)*A*a + n*B*b + (m - n - 1)*A*b*COT(x))
*SIN(x)^(m - 2)*(a + b*COT(x))^(n - 1), x)
- (B - A*COT(x))*SIN(x)^m*(a + b*COT(x))^n = 0

Combined relations with the same type of integrated term are:

(n + 1)*(n + 2)*(a^2 + b^2)*b^2*INT((A + B*COT(x))
*SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*INT(((n + 2)*(A*b - B*a)*b
+ (B*((m + 1)*a^2 + (n + 1)*b^2) - (m - n)*A*a*b)*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 2), x)
- (A*((m - n)*a^2 - (n + 2)*b^2)*b - B*((m + 1)*a^2 - b^2)*a
+ ((m + 2)*A*a*b - B*((m + n + 3)*a^2 + (n + 1)*b^2))*b*COT(x))
*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1) = 0

m*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT((A*((m - 1)*a^2 + (n - 1)*b^2) + n*B*a*b
+ ((m - n)*A*a + n*B*b)*b*COT(x))
*SIN(x)^(m - 2)*(a + b*COT(x))^(n - 2), x)
- (A*b + B*a - (A*a - B*b)*COT(x))*SIN(x)^m*(a + b*COT(x))^(n - 1) = 0

(n + 1)*(n + 2)*(a^2 + b^2)^2*INT((A + B*COT(x))
*SIN(x)^m*(a + b*COT(x))^n, x)
- INT(((n + 2)*((m - n - 1)*(A*b - B*a)*b + (n + 1)*(A*a + B*b)*a)
- (m - n - 2)*((m - n - 1)*(A*b - B*a)*a - (n + 1)*(A*a + B*b)*b)
*COT(x))*SIN(x)^m*(a + b*COT(x))^(n + 2), x)
- ((A*b - B*a)*((m - 2*n - 3)*a^2 - b^2) - (n + 1)*A*(a^2 + b^2)*b
+ ((m - n - 1)*(A*b - B*a)*a - (n + 1)*(A*a + B*b)*b)*b*COT(x))
*SIN(x)^m*(a + b*COT(x))^(n + 1) = 0

(m - n)*(m - n + 1)*INT((A + B*COT(x))*SIN(x)^m*(a + b*COT(x))^n, x)
- INT(((m - n)*A*((m - n + 1)*a^2 - b^2)
+ n*((m - n)*A*b + (m - 2*n + 2)*B*a)*b
+ ((m - n)*((m - 2*n + 2)*A*a + n*B*b)*b
+ n*B*((n - 1)*a^2 + b^2))*COT(x))
*SIN(x)^m*(a + b*COT(x))^(n - 2), x)
- ((m - n)*A*b + (m - 2*n + 1)*B*a + (m - n + 1)*B*b*COT(x))
*SIN(x)^m*(a + b*COT(x))^(n - 1) = 0

For a^2 + b^2 = 0 one has:

(m - n + 1)*(m - n + 2)*a*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*(m - 2*n + 2)*a*INT(SIN(x)^(m + 2)*(a + b*COT(x))^n, x)
- (n*b + (m - n + 2)*a*COT(x))*SIN(x)^(m + 2)*(a + b*COT(x))^n = 0

(m - n + 1)*a^2*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*a*INT(SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1), x)
+ b*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1) = 0

and the combined recurrences:

(m - 2*n)*a^2*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- (m + 2)*INT(SIN(x)^(m + 2)*(a + b*COT(x))^(n + 2), x)
+ 2*b*SIN(x)^(m + 2)*(a + b*COT(x))^(n + 1) = 0

(m - 2*n)*(m - 2*n - 2)*a^2*INT(SIN(x)^m*(a + b*COT(x))^n, x)
- (m - n)*(m - n - 1)*INT(SIN(x)^m*(a + b*COT(x))^(n + 2), x)
+ ((2*m - 3*n - 2)*b - (m - n)*a*COT(x))*a
*SIN(x)^m*(a + b*COT(x))^n = 0

all four of which work both ways.

20. Fortunately, all of the above integrands with uncouth cosine-tangent
or sine-cotangent pairings can be converted and fused into integrands
that involve two powers of the common type (a*SIN(x)+b*COS(x))^n. The
conversion is made possible by the invariant form of this factor under
additive shifts of the argument x. Thus, with the replacements m <-
m+n+1, n <- m and a regrouping of factors, and with a shift of c*COS(x)
(or of d*SIN(x)) into an arbitrary linear combination with new
coefficients (c,d) and the corresponding mixing of coefficients (a,b),
the generalized tangent (or cotangent) recurrences become:

(m + 1)*(a^2 + b^2)*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- INT((((m + 1)*(A*a + B*b)*c - n*(A*b - B*a)*d)*COS(x)
+ ((m + 1)*(A*a + B*b)*d + n*(A*b - B*a)*c)*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n - 1), x)
- (A*b - B*a)
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^n = 0

(m + 1)*(n + 1)*(a*d - b*c)^2*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
+ (m + n + 3)
*INT((((m + 1)*(A*d - B*c)*b + (n + 1)*(A*b - B*a)*d)*COS(x)
- ((m + 1)*(A*d - B*c)*a + (n + 1)*(A*b - B*a)*c)*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1), x)
- (((m + 1)*(A*d - B*c)*a + (n + 1)*(A*b - B*a)*c)*COS(x)
+ ((m + 1)*(A*d - B*c)*b + (n + 1)*(A*b - B*a)*d)*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m + n + 1)*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- INT(((m*(A*a + B*b)*c + n*(A*c + B*d)*a)*COS(x)
+ (m*(A*a + B*b)*d + n*(A*c + B*d)*b)*SIN(x))
*(a*COS(x) + b*SIN(x))^(m - 1)*(c*COS(x) + d*SIN(x))^(n - 1), x)
+ (B*COS(x) - A*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n = 0

(m + 1)*(m + 2)*(a^2 + b^2)*(a*d - b*c)^2*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- (m + n + 3)*INT((((m + 1)*(A*((a*d - b*c)*a*d + b^2*(c^2 + d^2))
- B*(a*c + b*d)*b*c)
+ (A*b - B*a)*(n*(a*c + b*d)*d + b*(c^2 + d^2)))*COS(x)
- ((m + 1)*(A*(a*c + b*d)*a*d
- B*(a^2*(c^2 + d^2) - (a*d - b*c)*b*c))
+ (A*b - B*a)*(n*(a*c + b*d)*c + a*(c^2 + d^2)))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 2)*(c*COS(x) + d*SIN(x))^n, x)
+ (((m + 1)*(A*(a^3*d + 2*a*b^2*d - b^3*c) - B*a^2*(a*c + b*d))
+ (A*b - B*a)*((n + 2)*a*(a*c + b*d) - (a^2 + b^2)*c))*COS(x)
+ ((m + 1)*(A*(a*c + b*d)*b^2 + B*(a^3*d - 2*a^2*b*c - b^3*c))
+ (A*b - B*a)*((n + 2)*(a*c + b*d)*b - (a^2 + b^2)*d))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m + n + 1)*(c^2 + d^2)*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- INT(((m*(A*((a^2 + b^2)*c^2 + (a*d - b*c)*a*d) + B*(a*c + b*d)*b*c)
+ (A*c + B*d)*(n*a*(a*c + b*d) + (a*d - b*c)*b))*COS(x)
+ (m*(A*(a*c + b*d)*a*d + B*((a^2 + b^2)*d^2 - (a*d - b*c)*b*c))
+ (A*c + B*d)*(n*(a*c + b*d)*b - a*(a*d - b*c)))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m - 2)*(c*COS(x) + d*SIN(x))^n, x)
- ((A*(a*d - b*c) - B*(a*c + b*d))*COS(x)
+ (A*(a*c + b*d) + B*(a*d - b*c))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m - 1)*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m + 1)*(m + 2)*(a^2 + b^2)^2*INT((A*COS(x) + B*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- INT((((m + 1)*((A*a + B*b)*((m + 2)*(a*c + b*d)*c - (a*d - b*c)*d)
+ n*(A*(a*d - b*c) + B*(a*c + b*d))*(a*d - b*c))
+ n*(A*b - B*a)*((n - 1)*(a*c + b*d)*d - (a*d - b*c)*c))*COS(x)
+ ((m + 1)*((A*a + B*b)*((m + 2)*(a*c + b*d)*d + (a*d - b*c)*c)
- n*(A*(a*c + b*d) + B*(b*c - a*d))*(a*d - b*c))
+ n*(B*a - A*b)*((n - 1)*(a*c + b*d)*c + (a*d - b*c)*d))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 2)*(c*COS(x) + d*SIN(x))^(n - 2), x)
+ (((m + 1)*(A*(a^3*d - 2*a^2*b*c - b^3*c) + B*a^2*(a*c + b*d))
+ (A*b - B*a)*(n*a*(a*c + b*d) - (a^2 + b^2)*c))*COS(x)
- ((m + 1)*(A*b^2*(a*c + b*d) - B*(a^3*d + 2*a*b^2*d - b^3*c))
- (A*b - B*a)*(n*(a*c + b*d)*b - (a^2 + b^2)*d))*SIN(x))
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n - 1) = 0

Exponents undergo single steps in the first three, and double steps in
the last three relations; the latter represent combinations among the
former, but do not introduce integrated terms more complex than already
present in two of them. Interchanging the symbols (a,b,m) in the above
with (c,d,n) reproduces two of the relations, and introduces four new
ones, bringing the total to ten.

In the same way, but now making the replacement m <- m+n, the simpler
recurrences for a^2 + b^2 = 0 become:

(m - n)*a*b*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
+ n*(a*d + b*c)
*INT((a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n - 1), x)
- a^2*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n = 0

(n + 1)*a*(a*d - b*c)
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
+ (m + n + 2)*b
*INT((a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1), x)
- a*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m - n)*a^2*(a*d - b*c)
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- (m + n + 2)*(a*d + b*c)
*INT((a*COS(x) + b*SIN(x))^(m + 2)*(c*COS(x) + d*SIN(x))^n, x)
+ 2*a^2
*(a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(n + 1)*(n + 2)*a*(c^2 + d^2)
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
+ (m + n + 2)*(m - n - 2)*a
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 2), x)
+ ((m*b*c - (n + 2)*a*d)*COS(x) + (m*b*d + (n + 2)*a*c)*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m - n)*(m - n + 2)*a^3
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
+ n*(n - 1)*(a*(d^2 - c^2) + 2*b*c*d)
*INT((a*COS(x) + b*SIN(x))^(m + 2)*(c*COS(x) + d*SIN(x))^(n - 2), x)
+ (((m - 2*n + 2)*b*c - n*(a*d))*COS(x)
+ ((m - 2*n + 2)*b*d + n*a*c)*SIN(x))
*a^2*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n - 1) = 0

each of which can be read forward as well as backward. Again, the three
relations where exponents undergo double steps represent combinations
among the two that involve single steps; just two of the double-step
ones here possess integrated terms of increased complexity though. Also
note that a mutual replacement of (a,b,m) with (c,d,n) produces
recurrences for the constraint c^2 + d^2 = 0 here.

In the doubly degenerate case of a^2 + b^2 = c^2 + d^2 = 0 one finally
has the explicit evaluation:

(m*b*c + n*a*d)*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)
- a*c*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n = 0

which remains unchanged under the symmetry operation (a,b,m) <->
(c,d,n). It is worth emphasizing that just two numerator terms suffice
to reduce the non-degenerate two-power integrands in this section.

The saga of sine-cosine pairings in two-term recurrences for integrals
involving powers of trigonometric functions is to continue with the
sixth instalment of this compilation, where some real snorters await
presentation.

Martin.

clicl...@freenet.de

unread,
Mar 31, 2011, 1:04:32 PM3/31/11
to

The sixth part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions celebrates two firsts: After
reduction formulae have been provided for the recent two-power
sine-plus-cosine recurrences, exponential factors make their debut in a
specialized subset of these recurrences. And after possibilities of
further specialization of this subset have been exhausted, a new
condition is invoked to curb three-power extensions of the recent
cosine-tangent, sine-cotangent, and sine-plus-cosine recurrences.

In part five, section 16, second paragraph please read "(cf. section 11
in part three)" for "(... in part two)", and at the beginning of section
20 please read "the common type (a*COS(x)+b*SIN(x))^n" in place of "...
(a*SIN(x)+b*COS(x))^n" for reasons of consistency.

21. The recurrence relations for two-power sine-plus-cosine integrands
that were listed in section 20 of part five vary the total exponent m+n
in steps of either zero or two, thus keeping integrands whose total
exponents differ by an odd integer forever apart. A reduction of
integrands involving the full numerator A+B*COS(x)+C*SIN(x) consequently
results in two integrals. The recipe for non-degenerate integrands is
quite obvious and involves no integrated term:

INT((A + B*COS(x) + C*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- A*INT((a*COS(x) + b*SIN(x))
*(a*COS(x) + b*SIN(x))^(m - 1)*(c*COS(x) + d*SIN(x))^n, x)
- INT((B*COS(x) + C*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x) = 0

An equally valid version follows on interchanging (a,b,m) with (c,d,n).
For singly degenerate integrands with a^2 + b^2 = 0, three formulae can
be given without introducing a separate polynomial into the integrated
term:

(n + 1)*a*(c^2 + d^2)*INT((A + B*COS(x) + C*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- (n + 1)*A*a*(c^2 + d^2)


*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

+ (m*(B*d - C*c)*b - (n + 1)*(B*c + C*d)*a)
*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 1), x)
- (B*d - C*c)*a


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m - n - 1)*a*(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- (m - n - 1)*A*a*(a*d - b*c)


*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- (m*(B*d - C*c)*a + (n + 1)*(B*c + C*d)*b)
*INT((a*COS(x) + b*SIN(x))^(m + 1)*(c*COS(x) + d*SIN(x))^n, x)
+ (B*a + C*b)*a


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 1) = 0

(m + n + 1)*(a*d + b*c)*INT((A + B*COS(x) + C*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- (m + n + 1)*A*(a*d + b*c)


*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- (m*(B*d - C*c)*a + (n + 1)*(B*c + C*d)*b)*a
*INT((a*COS(x) + b*SIN(x))^(m - 1)*(c*COS(x) + d*SIN(x))^n, x)
- (B*a - C*b)


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^(n + 1) = 0

These cover all situations since a*d +- b*c /= 0 if c^2 + d^2 /= 0 (i.e.
if the second factor is non-degenerate); the mutual replacement of
(a,b,m) with (c,d,n) here produces formulae for c^2 + d^2 = 0. In the


doubly degenerate case of a^2 + b^2 = c^2 + d^2 = 0 one finally has the

more direct result:

((m^2 + n^2 - 1)*a*c - 2*m*n*b*d)*INT((A + B*COS(x) + C*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- ((m^2 + n^2 - 1)*a*c - 2*m*n*b*d)*A


*INT((a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

+ ((B*(m*b*c + n*a*d) - C*a*c)*COS(x)
+ (B*a*c + C*(m*b*c + n*a*d))*SIN(x))


*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n = 0

which remains unchanged under the symmetry operation (a,b,m) <->
(c,d,n). The formula becomes singular at m +- n = +- 1, where constant
contributions arise in the integrand which require a different kind of
integrated term.

The recurrence relations for two-power sine-plus-cosine integrands in
combination with these reduction formulae generalize the relations under
2.510 in Gradshteyn and Ryzhik.

22. The degenerate subset of the two-power sine-plus-cosine recurrences
listed in section 20 can be specialized to exponential integrands by
substituting (COS(x)+#i*SIN(x))^m = EXP(#i*m*x) for the degenerate
power. Further replacement of m with -#i*m leads to the real factor
EXP(m*x), whose exponent m can no longer be recurred on since feasible
steps would have to be imaginary numbers now; the transformed m
therefore does not count as an exponent here. The following two-way
recurrence results when the coefficients of the other factor are renamed
to (a,b):

(n + 1)*(n + 2)*(a^2 + b^2)*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 + (n + 2)^2)*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^(n + 2), x)
+ ((m*a - (n + 2)*b)*COS(x) + ((n + 2)*a + m*b)*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^(n + 1) = 0

In the same manner one obtains an explicit evaluation for a^2 + b^2 = 0:

(m*a + n*b)*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- a*EXP(m*x)*(a*COS(x) + b*SIN(x))^n = 0

Numerators of the type A+B*COS(x)+C*SIN(x) can be reduced by means of
the formulae:

(n + 1)*(a^2 + b^2)
*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*A*(a^2 + b^2)*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ (m*(B*b - C*a) - (n + 1)*(B*a + C*b))
*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^(n + 1), x)
- (B*b - C*a)*EXP(m*x)*(a*COS(x) + b*SIN(x))^(n + 1) = 0

(m^2 + (n + 1)^2)
*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 + (n + 1)^2)*A*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ n*(m*(B*b - C*a) - (n + 1)*(B*a + C*b))
*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^(n - 1), x)
- ((B*m - C*(n + 1))*COS(x) + (C*m + B*(n + 1))*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n = 0

which cover all situations; for a^2 + b^2 = 0 one can use:

((m^2 - n^2 + 1)*a + 2*m*n*b)
*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- ((m^2 - n^2 + 1)*a + 2*m*n*b)*A
*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- ((B*(m*a + n*b) - C*a)*COS(x) + (B*a + C*(m*a + n*b))*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n = 0

23. Corresponding relations involving sine or cosine functions of the
argument m*x follow by splitting EXP(#i*m*x) into real and imaginary
parts. One finds the two-way recurrences:

(n + 1)*(n + 2)*(a^2 + b^2)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)


+ (m + n + 2)*(m - n - 2)

*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^(n + 2), x)
+ (m*(a*COS(x) + b*SIN(x))*COS(m*x)
- (n + 2)*(b*COS(x) - a*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^(n + 1) = 0

(n + 1)*(n + 2)*(a^2 + b^2)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)


+ (m + n + 2)*(m - n - 2)

*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^(n + 2), x)
- ((n + 2)*(b*COS(x) - a*SIN(x))*COS(m*x)
+ m*(a*COS(x) + b*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^(n + 1) = 0

and for a^2 + b^2 = 0 the explicit evaluations:

(m + n)*(m - n)*a^2*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ a*(m*a*COS(m*x) - n*b*SIN(m*x))*(a*COS(x) + b*SIN(x))^n = 0

(m + n)*(m - n)*a^2*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- a*(n*b*COS(m*x) + m*a*SIN(m*x))*(a*COS(x) + b*SIN(x))^n = 0

Numerators of the type A+B*COS(x)+C*SIN(x) yield to:

(n + 1)*(a^2 + b^2)
*INT((A + B*COS(x) + C*SIN(x))*SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*A*(a^2 + b^2)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*(B*a + C*b)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^(n + 1), x)
+ m*(B*b - C*a)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^(n + 1), x)
- (B*b - C*a)*SIN(m*x)*(a*COS(x) + b*SIN(x))^(n + 1) = 0

(m^2 - (n + 1)^2)
*INT((A + B*COS(x) + C*SIN(x))*SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 - (n + 1)^2)*A*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ n*(n + 1)*(B*a + C*b)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^(n - 1), x)
- m*n*(B*b - C*a)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^(n - 1), x)
+ (m*(B*COS(x) + C*SIN(x))*COS(m*x)
- (n + 1)*(C*COS(x) - B*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^n = 0

(n + 1)*(a^2 + b^2)

*INT((A + B*COS(x) + C*SIN(x))*COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*A*(a^2 + b^2)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*(B*a + C*b)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^(n + 1), x)
- m*(B*b - C*a)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^(n + 1), x)
- (B*b - C*a)*COS(m*x)*(a*COS(x) + b*SIN(x))^(n + 1) = 0

(m^2 - (n + 1)^2)
*INT((A + B*COS(x) + C*SIN(x))*COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 - (n + 1)^2)*A*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ n*(n + 1)*(B*a + C*b)*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^(n - 1), x)
+ m*n*(B*b - C*a)*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^(n - 1), x)
- ((n + 1)*(C*COS(x) - B*SIN(x))*COS(m*x)
+ m*(B*COS(x) + C*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^n = 0

and for a^2 + b^2 = 0 to:

(m^2 - (n + 1)^2)*(m^2 - (n - 1)^2)*a
*INT((A + B*COS(x) + C*SIN(x))*SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 - (n + 1)^2)*(m^2 - (n - 1)^2)*A*a
*INT(SIN(m*x)*(a*COS(x) + b*SIN(x))^n, x)
+ (m*(((m^2 - n^2 - 1)*B*a - 2*n*C*b)*COS(x)
+ (2*n*B*b + (m^2 - n^2 - 1)*C*a)*SIN(x))*COS(m*x)
- (((m^2 - n^2 + 1)*n*B*b + (m^2 + n^2 - 1)*C*a)*COS(x)
- ((m^2 + n^2 - 1)*B*a - (m^2 - n^2 + 1)*n*C*b)*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^n = 0

(m^2 - (n + 1)^2)*(m^2 - (n - 1)^2)*a
*INT((A + B*COS(x) + C*SIN(x))*COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- (m^2 - (n + 1)^2)*(m^2 - (n - 1)^2)*A*a
*INT(COS(m*x)*(a*COS(x) + b*SIN(x))^n, x)
- ((((m^2 - n^2 + 1)*n*B*b + (m^2 + n^2 - 1)*C*a)*COS(x)
- ((m^2 + n^2 - 1)*B*a - (m^2 - n^2 + 1)*n*C*b)*SIN(x))*COS(m*x)
+ m*(((m^2 - n^2 - 1)*B*a - 2*n*C*b)*COS(x)
+ (2*n*B*b + (m^2 - n^2 - 1)*C*a)*SIN(x))*SIN(m*x))
*(a*COS(x) + b*SIN(x))^n = 0

Alternatively, a rule-based integrator could here decompose COS(m*x) and
SIN(m,x) into complex exponentials and then apply the recurrences from
the previous section with complex values of m.

24. The single-power integrand (a*COS(x)+b*SIN(x))^n is not covered
satisfactorily in the Gradshteyn-Ryzhik tables since formula 2.557(1)
holds for b > 0 only. Specializing the exponential relations in section
22 to m = 0, one obtains the more generally valid two-way recurrence:

(n + 1)*(a^2 + b^2)*INT((a*COS(x) + b*SIN(x))^n, x)
- (n + 2)*INT((a*COS(x) + b*SIN(x))^(n + 2), x)
- (b*COS(x) - a*SIN(x))*(a*COS(x) + b*SIN(x))^(n + 1) = 0

and for a^2 + b^2 = 0 the explicit evaluation:

n*a*INT((a*COS(x) + b*SIN(x))^n, x) + b*(a*COS(x) + b*SIN(x))^n = 0

The two reduction formulae become:

(n + 1)*(a^2 + b^2)
*INT((A + B*COS(x) + C*SIN(x))*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*A*(a^2 + b^2)*INT((a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*(B*a + C*b)*INT((a*COS(x) + b*SIN(x))^(n + 1), x)
- (B*b - C*a)*(a*COS(x) + b*SIN(x))^(n + 1) = 0

(n + 1)*INT((A + B*COS(x) + C*SIN(x))*(a*COS(x) + b*SIN(x))^n, x)
- (n + 1)*A*INT((a*COS(x) + b*SIN(x))^n, x)
- n*(B*a + C*b)*INT((a*COS(x) + b*SIN(x))^(n - 1), x)
+ (C*COS(x) - B*SIN(x))*(a*COS(x) + b*SIN(x))^n = 0

while for a^2 + b^2 = 0 one has more directly:

(n^2 - 1)*a*INT((A + B*COS(x) + C*SIN(x))*(a*COS(x) + b*SIN(x))^n, x)
- (n^2 - 1)*A*a*INT((a*COS(x) + b*SIN(x))^n, x)
+ ((n*B*b - C*a)*COS(x) + (n*C*b + B*a)*SIN(x))
*(a*COS(x) + b*SIN(x))^n = 0

25. Inserting an extra cosine power into the two-power tangent
recurrences given in section 11 of part three (or an extra sine power
into the cotangent recurrences of section 12), and transforming the
extended integrands to three powers of the type (a*COS(x)+b*SIN(x))^n
leads to relations substantially more numerous and bulkier than those
derived from the single-power tangent or cotangent recurrences (see
sections 18, 19, and 20 of part five). Since integrands with three
sine-plus-cosine powers are anything but uncouth (although three factors
of the same type can be boring) and are perfectly within the present
complexity limit (cf. the introduction to part one), another restriction
is needed to keep this compilation practicable: no integrand with three
or more powers shall be admitted whatever its factors may be.

Yet, because exponential factors do not count as powers for the present
purpose (see section 22 above), degenerate powers in exponential form
can be added in spite of this condition if they do not push the required
number of numerator terms beyond its limit of three. Thus the two-power
sine-plus-cosine integrands in section 20 of part five may still be
extended with an exponential factor EXP(m*x). The resulting exponential
version of the degenerate subset of the three-power sine-plus-cosine
recurrences comprises the relations:

(n + 1)*(a^2 + b^2)*INT((A*COS(x) + B*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- INT((((n + 1)*(A*a + B*b)*c - (m*c + p*d)*(A*b - B*a))*COS(x)
+ ((n + 1)*(A*a + B*b)*d - (m*d - p*c)*(A*b - B*a))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p - 1), x)
- (A*b - B*a)*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^p = 0

(n + 1)*(p + 1)*(a*d - b*c)^2*INT((A*COS(x) + B*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
+ INT((((n + 1)*(A*d - B*c)*(m*a + (n + p + 3)*b)
+ (p + 1)*(A*b - B*a)*(m*c + (n + p + 3)*d))*COS(x)
+ ((n + 1)*(A*d - B*c)*(m*b - (n + p + 3)*a)
+ (p + 1)*(A*b - B*a)*(m*d - (n + p + 3)*c))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1), x)
- (((n + 1)*(A*d - B*c)*a + (p + 1)*(A*b - B*a)*c)*COS(x)
+ ((n + 1)*(A*d - B*c)*b + (p + 1)*(A*b - B*a)*d)*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m^2 + (n + p + 1)^2)*INT((A*COS(x) + B*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
+ INT(((m*(n*(A*b - B*a)*c + p*(A*d - B*c)*a)
- (n + p + 1)*(n*(A*a + B*b)*c + p*(A*c + B*d)*a))*COS(x)
+ (m*(n*(A*b - B*a)*d + p*(A*d - B*c)*b)
- (n + p + 1)*(n*(A*a + B*b)*d + p*(A*c + B*d)*b))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^(p - 1), x)
- ((m*A - (n + p + 1)*B)*COS(x) + (m*B + (n + p + 1)*A)*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p = 0

(n + 1)*(n + 2)*(a^2 + b^2)*(a*d - b*c)^2*INT((A*COS(x) + B*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- INT(((m*((n + 1)*(A*d - B*c)*(a^2 + b^2)*c
+ (A*b - B*a)*(m*(b*c - a*d)*c + (p + 1)*(a*(c^2 - d^2) + 2*b*c*d)))
+ (n + p + 3)*((n + 1)*(A*(a*d*(a*d - b*c) + b^2*(c^2 + d^2))
- B*(a*c + b*d)*b*c)
+ (A*b - B*a)*(p*(a*c + b*d)*d + b*(c^2 + d^2))))*COS(x)
+ (m*((n + 1)*(A*d - B*c)*(a^2 + b^2)*d
- (A*b - B*a)*(m*(a*d - b*c)*d - (p + 1)*(2*a*c*d - b*(c^2 - d^2))))
- (n + p + 3)*((n + 1)*(A*a*d*(a*c + b*d)


- B*(a^2*(c^2 + d^2) - (a*d - b*c)*b*c))

+ (A*b - B*a)*(p*(a*c + b*d)*c + a*(c^2 + d^2))))*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^(n + 2)*(c*COS(x) + d*SIN(x))^p, x)
+ (((n + 1)*(A*(a^3*d + 2*a*b^2*d - b^3*c) - B*a^2*(a*c + b*d))
- (A*b - B*a)*((m*(a*d - b*c) - (p + 2)*(a*c + b*d))*a
+ (a^2 + b^2)*c))*COS(x)
+ ((n + 1)*(A*(a*c + b*d)*b^2 + B*(a^3*d - 2*a^2*b*c - b^3*c))
- (A*b - B*a)*((m*(a*d - b*c) - (p + 2)*(a*c + b*d))*b
+ (a^2 + b^2)*d))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m^2 + (n + p + 1)^2)*(c^2 + d^2)*INT((A*COS(x) + B*SIN(x))
*EXP^(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- INT(((m*((A*d - B*c)*(m*a*(a*d - b*c) - (n - 1)*(a^2 + b^2)*c)
- (p + 1)*((A*b + B*a)*(d^2 - c^2) + 2*(A*a - B*b)*c*d)*a)
+ (n + p + 1)*(n*(A*((a^2 + b^2)*c^2 + (a*d - b*c)*a*d)
+ B*(a*c + b*d)*b*c)
+ (A*c + B*d)*(p*a*(a*c + b*d) + (a*d - b*c)*b)))*COS(x)
+ (m*((A*d - B*c)*(m*(a*d - b*c)*b - (n - 1)*(a^2 + b^2)*d)
- (p + 1)*((A*b + B*a)*(d^2 - c^2) + 2*(A*a - B*b)*c*d)*b)
+ (n + p + 1)*(n*(A*(a*c + b*d)*a*d


+ B*((a^2 + b^2)*d^2 - (a*d - b*c)*b*c))

+ (A*c + B*d)*(p*(a*c + b*d)*b - a*(a*d - b*c))))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 2)*(c*COS(x) + d*SIN(x))^p, x)
- ((m*(A*(a*c + b*d) + B*(a*d - b*c))
+ (n + p + 1)*(A*(a*d - b*c) - B*(a*c + b*d)))*COS(x)
- (m*(A*(a*d - b*c) - B*(a*c + b*d))
- (n + p + 1)*(A*(a*c + b*d) + B*(a*d - b*c)))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(n + 1)*(n + 2)*(a^2 + b^2)^2*INT((A*COS(x) + B*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
+ INT(((m*((A*b - B*a)*((m*c + (p - 1)*d)*(a*d - b*c)
+ (n - p + 2)*(a*c + b*d)*c)) - (n + 1)*((A*a + B*b)
*((n + 2)*(a*c + b*d)*c + (m*c - d)*(a*d - b*c))
+ p*(A*(a*d - b*c) + B*(a*c + b*d))*(a*d - b*c)) - p*(A*b - B*a)
*((p - 1)*(a*c + b*d)*d - (a*d - b*c)*c))*COS(x)
+ (m*((A*b - B*a)*((m*d - (p - 1)*c)*(a*d - b*c)
+ (n - p + 2)*(a*c + b*d)*d)) - (n + 1)*((A*a + B*b)
*((n + 2)*(a*c + b*d)*d + (m*d + c)*(a*d - b*c))
- p*(A*(a*c + b*d) + B*(b*c - a*d))*(a*d - b*c)) - p*(B*a - A*b)
*((p - 1)*(a*c + b*d)*c + (a*d - b*c)*d))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 2)*(c*COS(x) + d*SIN(x))^(p - 2), x)
+ (((n + 1)*(A*(a^3*d - 2*a^2*b*c - b^3*c) + B*a^2*(a*c + b*d))
- (A*b - B*a)*((m*(a*d - b*c) - p*(a*c + b*d))*a
+ (a^2 + b^2)*c))*COS(x)
- ((n + 1)*(A*(a*c + b*d)*b^2 - B*(a^3*d + 2*a*b^2*d - b^3*c))
+ (A*b - B*a)*((m*(a*d - b*c) - p*(a*c + b*d))*b
+ (a^2 + b^2)*d))*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p - 1) = 0

for which the corresponding comments made in section 20 of part five
remain valid. Simpler recurrences for a^2 + b^2 = 0 read:

(m*a + (n - p)*b)*a*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
+ p*(a*d + b*c)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p - 1), x)
- a^2*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p = 0

(p + 1)*a*(a*d - b*c)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
+ (m*a + (n + p + 2)*b)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1), x)
- a*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m*a + (n - p)*b)*a^2*(a*d - b*c)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- (m*a + (n + p + 2)*b)*(a*d + b*c)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 2)*(c*COS(x) + d*SIN(x))^p, x)
+ 2*a^2*b*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(p + 1)*(p + 2)*a*(c^2 + d^2)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- ((m^2 - (n + p + 2)*(n - p - 2))*a + 2*m*n*b)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 2), x)
+ (((m*c - (p + 2)*d)*a + n*b*c)*COS(x)
+ ((m*d + (p + 2)*c)*a + n*b*d)*SIN(x))
*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m*a + (n - p)*b)*(m*a + (n - p + 2)*b)*a*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- p*(p - 1)*(a*(d^2 - c^2) + 2*b*c*d)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 2)*(c*COS(x) + d*SIN(x))^(p - 2), x)
- (((m*c - p*d)*a + (n - 2*p + 2)*b*c)*COS(x)
+ ((m*d + p*c)*a + (n - 2*p + 2)*b*d)*SIN(x))*a^2*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p - 1) = 0

where the corresponding comments from section 20 apply again. An
explicit evaluation for a^2 + b^2 = c^2 + d^2 = 0 finally is:

((m*c + p*d)*a + n*b*c)
*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)
- a*c*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p = 0

Similar integrands that involve sine or cosine functions of the argument
m*x can be converted to exponential versions with complex values of m by
decomposing COS(m*x) = 1/2 (EXP(#i*m*x) + EXP(-#i*m*x)) and SIN(m,x) =
1/(2*#i) (EXP(#i*m*x) - EXP(-#i*m*x)).

The saga of sine-cosine pairings in two-term recurrences for integrals
involving powers of trigonometric functions is to continue with the

seventh instalment of this compilation, where many more exponential
factors may be expected.

Martin.

clicl...@freenet.de

unread,
Apr 29, 2011, 5:21:15 AM4/29/11
to

The seventh part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions supplies reduction formulae
for recent exponential two-power recurrences and then explores some
consequences of these recurrences. Presented are two ways of putting an
exponential into the Gradshteyn-Ryzhik recurrence 2.558(1), followed by
similar relations for sine-only and cosine-only powers.

Some addenda and corrigenda must be dealt with first: The following
should have been appended to the penultimate paragraph of section 21 in
part six: "One may then dispense with the integrated term and convert to
three integrals by means of the formulae:

(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- A*(a*d - b*c)*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^n, x)
- (B*d - C*c)*INT((a*COS(x) + b*SIN(x))^(m + 1)
*(c*COS(x) + d*SIN(x))^n, x)
+ (B*b - C*a)*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^(n + 1), x) = 0

(a*d + b*c)*INT((A + B*COS(x) + C*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- A*(a*d + b*c)*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^n, x)
- (B*d - C*c)*a^2*INT((a*COS(x) + b*SIN(x))^(m - 1)
*(c*COS(x) + d*SIN(x))^n, x)
- (B*b + C*a)*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^(n + 1), x) = 0

(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))
*(a*COS(x) + b*SIN(x))^m*(c*COS(x) + d*SIN(x))^n, x)

- A*(a*d - b*c)*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^n, x)
- (B*d + C*c)*a^2*INT((a*COS(x) + b*SIN(x))^(m - 1)
*(c*COS(x) + d*SIN(x))^n, x)
+ (B*b + C*a)*c^2*INT((a*COS(x) + b*SIN(x))^m
*(c*COS(x) + d*SIN(x))^(n - 1), x) = 0

of which the first holds regardless of degeneracies, the second only if
a^2 + b^2 = 0, or c^2 + d^2 = 0 on interchanging (a,b,m) with (c,d,n),
and the third only if a^2 + b^2 = c^2 + d^2 = 0." At the end of sections
22 and 23 should have been mentioned that the results generalize entries
2.662(1) and (2), and are related to entries 2.535(1), 2.536(1),
2.537(1) and 2.538(1) in Gradshteyn and Ryzhik, respectively; the last
four rely on the second single-step (rather than on the second
double-step) degenerate recurrence in section 20 of part five. And at
the beginning of section 25 please read "(see sections 16 to 20 of part
five)" for "(see sections 18, 19, and 20 of part five)".

26. The exponential two-power sine-plus-cosine recurrences in section 25
of part six structurally resemble their non-exponential counterparts
(cf. section 20 of part five), and exponential integrals that involve a
full numerator A+B*COS(x)+C*SIN(x) can be resolved analoguously (cf.
section 21, part six). Accordingly, such integrals split into two parts
that do not mix under the recurrences, and no integrated term arises in
the non-degenerate case:

INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- A*INT((a*COS(x) + b*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^p, x)
- INT((B*COS(x) + C*SIN(x))*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x) = 0

where (a,b,n) may be interchanged with (c,d,p) to obtain an alternative
relation. In the singly degenerate case of a^2 + b^2 = 0, integrals can


be reduced by means of the formulae:

(p + 1)*a*(c^2 + d^2)*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (p + 1)*A*a*(c^2 + d^2)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

+ ((m*a + n*b)*(B*d - C*c) - (p + 1)*(B*c + C*d)*a)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1), x)
- (B*d - C*c)*a*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m*a + (n - p - 1)*b)*(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))


*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (m*a + (n - p - 1)*b)*A*(a*d - b*c)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- ((m*a + n*b)*(B*d - C*c) - (p + 1)*(B*c + C*d)*a)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^p, x)
+ (B*b - C*a)*a*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1) = 0

(m*a + (n + p + 1)*b)*(a*d + b*c)*INT((A + B*COS(x) + C*SIN(x))


*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (m*a + (n + p + 1)*b)*A*(a*d + b*c)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- ((m*a + n*b)*(B*d - C*c) - (p + 1)*(B*c + C*d)*a)*a^2*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^p, x)
- (B*b + C*a)*a*EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1) = 0

which do not simultaneously become singular if both the second factor is
non-degenerate (c^2 + d^2 /= 0) and m and n are real, since b = +- #i*a
then implies both a*d +- b*c /= 0 and m*a + n*b /= 0; interchanging
(a,b,n) with (c,d,p) here results in relations for c^2 + d^2 = 0. A
different kind of integrated term is needed when both p = -1 and m*a +
n*b = 0, which can be avoided by converting to three integrals:

(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- A*(a*d - b*c)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (B*d - C*c)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n + 1)*(c*COS(x) + d*SIN(x))^p, x)
+ (B*b - C*a)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1), x) = 0

(a*d + b*c)*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- A*(a*d + b*c)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (B*d - C*c)*a^2*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^p, x)
- (B*b + C*a)*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p + 1), x) = 0

While the first relation holds without restriction, the second requires
a^2 + b^2 = 0; mutual replacement of (a,b,n) with (c,d,p) here leaves
the first relation unchanged and takes the second into a formula for c^2
+ d^2 = 0. For doubly degenerate integrands with a^2 + b^2 = c^2 + d^2 =
0 one has:

((m^2 - n^2 - p^2 + 1)*a*c + 2*m*(n*b*c + p*a*d) + 2*n*p*b*d)
*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- ((m^2 - n^2 - p^2 + 1)*a*c + 2*m*(n*b*c + p*a*d) + 2*n*p*b*d)*A


*INT(EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- ((B*((m*a + n*b)*c + p*a*d) - C*a*c)*COS(x)
+ (B*a*c + C*((m*a + n*b)*c + p*a*d))*SIN(x))


*EXP(m*x)*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p = 0

which survives the symmetry operation (a,b,n) <-> (c,d,p) unchanged.
Where this formula becomes singular, constant contributions arise in the
integrand and require a different kind of integrated term; one may then
again resort to a reduction to three integrals and use the earlier
formulae without integrated term, along with:

(a*d - b*c)*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- A*(a*d - b*c)*INT(EXP(m*x)


*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^p, x)

- (B*d + C*c)*a^2*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^(n - 1)*(c*COS(x) + d*SIN(x))^p, x)
+ (B*b + C*a)*c^2*INT(EXP(m*x)
*(a*COS(x) + b*SIN(x))^n*(c*COS(x) + d*SIN(x))^(p - 1), x) = 0

which requires a^2 + b^2 = c^2 + d^2 = 0, and is also symmetric under
the operation (a,b,n) <-> (c,d,p). As in section 25 of part six,
integrands that contain the functions SIN(m*x) and COS(m*x) in place of
EXP(m*x) can be accomodated by decomposition into complex exponentials.

The exponential two-power sine-plus-cosine recurrences of section 25
augmented by the present formulae provide a generalization of entry
2.661 in Gradshteyn and Ryzhik.

27. An exponential factor EXP(m*x) may also be inserted into the
integrand of Gradshteyn-Ryzhik entry 2.558(1) which involves a power of
the trinomial a+b*COS(x)+c*SIN(x) (cf. section 1 of part one). The
feasibility can be shown by decomposing a + b*COS(2*x) + c*SIN(2*x) as
((a+b)*COS(x) + (c+r)*SIN(x)) * ((a+b)*COS(x) + (c-r)*SIN(x)) / (a+b)
where r = SQRT(b^2-a^2+c^2), and specializing the exponential two-power
integrands of section 25 in part six to either n = p+1 or p = n+1 where
the offset is needed to convert the numerator. One can also infer that
just two numerator terms suffice as they did in the case without
exponential (see sections 6 and 7 of part two); the recurrences given
here, however, employ the full numerator A+B*COS(x)+C*SIN(x) and they
reduce to 2.558(1) in Gradshteyn and Ryzhik on setting m = 0:

(a^2 - b^2 - c^2)*(n + 1)*INT((A + B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- INT((m*(B*c - C*b) + (n + 1)*(A*a - B*b - C*c)
+ (m*(A*c - C*a) - (n + 2)*(A*b - B*a))*COS(x)
- (m*(A*b - B*a) + (n + 2)*(A*c - C*a))*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
+ (B*c - C*b + (A*c - C*a)*COS(x) - (A*b - B*a)*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

(m^2 + (n + 1)^2)*a*INT((A + B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- INT((((m^2 + (n + 1)^2)*A*a
- (m*B - (n + 1)*C)*(m*b + n*c) - (m*C + (n + 1)*B)*(m*c - n*b))*a
+ (((m^2 + (n + 1)^2)*A*b + n*(m*C + (n + 1)*B)*a)*a
- (m*(B*b + C*c) + (n + 1)*(B*c - C*b))*(m*b + n*c))*COS(x)
+ (((m^2 + (n + 1)^2)*A*c - n*(m*B - (n + 1)*C)*a)*a
- (m*(B*b + C*c) + (n + 1)*(B*c - C*b))*(m*c - n*b))*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n - 1), x)
- (m*(B*b + C*c) + (n + 1)*(B*c - C*b)
+ (m*B - (n + 1)*C)*a*COS(x) + (m*C + (n + 1)*B)*a*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n = 0

For a degenerate power with a^2 = b^2 + c^2 one has the simple two-way
relation:

(n + 1)*(2*n + 1)*a*INT(EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- (m^2 + (n + 1)^2)*INT(EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
+ (m*a + (m*b - (n + 1)*c)*COS(x) + (m*c + (n + 1)*b)*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n = 0

along with the reduction formula:

(m^2 + (n + 1)^2)*a*INT((A + B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- ((m^2 + (n + 1)^2)*A*a - (m^2 - n*(n + 1))*(B*b + C*c)
- m*(2*n + 1)*(B*c - C*b))
*INT(EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- (m*(B*b + C*c) + (n + 1)*(B*c - C*b)
+ (m*B - (n + 1)*C)*a*COS(x) + (m*C + (n + 1)*B)*a*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n = 0

The same relations with complex values of m apply when integrands
containing a sine or cosine function in place of the exponential are
rewritten using COS(m*x) = 1/2 * (EXP(#i*m*x) + EXP(-#i*m*x)) or
SIN(m*x) = 1/(2*#i) * (EXP(#i*m*x) - EXP(-#i*m*x)).

Decomposition of the trinomial into two sine-plus-cosine factors also
explains why, even without additional exponential factor, recurrences
for integrals involving two powers of this type require four numerator
terms. They thus fall outside the range of the present compilation (cf.
the introduction to part one), in fact none is likely to fit the space
of a single page. Four terms are also needed for simplified integrands
that just combine (a+b*SIN(x))^m with (c+d*COS(x))^n. The decomposition
argument, however, becomes unreliable for such binomials because their
sine-plus-cosine constituents are under-determined, and consequently
correlated.

28. Alternatives to the foregoing relations are obtained by eliminating
the absolute term in the numerator, leaving only B*COS(x)+C*SIN(x). In
this regard, the integrand with factor EXP(m*x) differs from its
relative without exponential (compare sections 6 and 7 of part two), for
which B = 0 or C = 0 is possible while no recurrence exists with A = 0.
Accordingly, the following recurrences with A = 0 fail when m = 0, but
this should not deter a genuine rule-based integrator:

m*(n + 1)*a*(a^2 - b^2 - c^2)*INT((B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
+ INT(((m*(m*C - (n + 2)*B)*a^2
+ (m*(B*c - C*b) - (n + 1)*(B*b + C*c))*(m*b + (n + 2)*c))*COS(x)
- (m*(m*B + (n + 2)*C)*a^2
- (m*(B*c - C*b) - (n + 1)*(B*b + C*c))*(m*c - (n + 2)*b))*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1), x)
+ ((n + 1)*(B*b + C*c)*a
- (m*(B*b*c + C*(a^2 - b^2)) - (n + 1)*(B*b + C*c)*b)*COS(x)
+ (m*(B*(a^2 - c^2) + C*b*c) + (n + 1)*(B*b + C*c)*c)*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

m*(m^2 + (n + 1)^2)*a*INT((B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- n*INT(((m*(m*C + (n + 1)*B)*a^2
+ (m*(B*c - C*b) - (n + 1)*(B*b + C*c))*(m*b + n*c))*COS(x)
- (m*(m*B - (n + 1)*C)*a^2
- (m*(B*c - C*b) - (n + 1)*(B*b + C*c))*(m*c - n*b))*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n - 1), x)
+ (n*(m*(B*c - C*b) - (n + 1)*(B*b + C*c))
- m*(m*B - C*(n + 1))*a*COS(x) - m*(m*C + B*(n + 1))*a*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n = 0

The reduction formula needed for a full numerator is:

m*a*INT((A + B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
+ INT(((m*(A*b - B*a) + (n + 1)*A*c)*COS(x)
+ (m*(A*c - C*a) - (n + 1)*A*b)*SIN(x))
*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^n, x)
- A*EXP(m*x)*(a + b*COS(x) + c*SIN(x))^(n + 1) = 0

The degenerate integral in section 27 is not affected as it has no
dispensable numerator term. Again, the relations can also be used for
integrands involving a sine or cosine function of argument m*x once the
function has been converted to complex exponentials. A removal of the
cosine term (B = 0) or of the sine term (C = 0) from the numerator of
the non-degenerate exponential integrands is feasible as well, but
unattractive because the recurrences then acquire a new singularity at
m*b + (n+2)*c = 0 or at m*c - (n+2)*b = 0, respectively.

29. The singularities just mentioned become harmless, and an elimination
of the cosine or the sine numerator term in the exponential recurrences
of section 27 therefore presents no problem, in the case of b = 0 or c =
0, respectively. Imposing B = b = 0 one thus obtains the following
relations for exponential single-power sine integrands, in which C has
been renamed to B, and c to b:

(n + 1)*(n + 2)*(a^2 - b^2)*b*INT((A + B*SIN(x))
*EXP(m*x)*(a + b*SIN(x))^n, x)
+ INT((m^2*(A*b - B*a)*a - (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 + (n + 2)^2)*(A*b - B*a)*b*SIN(x))
*EXP(m*x)*(a + b*SIN(x))^(n + 1), x)
- (A*b - B*a)*(m*a + m*b*SIN(x) - (n + 2)*b*COS(x))
*EXP(m*x)*(a + b*SIN(x))^(n + 1) = 0

(m^2 + (n + 1)^2)*b*INT((A + B*SIN(x))*EXP(m*x)*(a + b*SIN(x))^n, x)
- INT(((m^2 + (n + 1)^2)*A*a*b - B*(m^2*a^2 - n*(n + 1)*b^2)
+ ((m^2 + (n + 1)^2)*A*b - (m^2 - n*(n + 1))*B*a)*b*SIN(x))
*EXP(m*x)*(a + b*SIN(x))^(n - 1), x)
- B*(m*a + m*b*SIN(x) - (n + 1)*b*COS(x))
*EXP(m*x)*(a + b*SIN(x))^n = 0

Rule-base integrators might here like to have a reduction formula for an
additional COS(x) term in the numerator:

(n + 1)*b*INT((A + B*SIN(x) + C*COS(x))*EXP(m*x)*(a + b*SIN(x))^n, x)
+ INT(((m*C*a - (n + 1)*A*b) + (m*C - (n + 1)*B)*b*SIN(x))
*EXP(m*x)*(a + b*SIN(x))^n, x)
- C*EXP(m*x)*(a + b*SIN(x))^(n + 1) = 0

The two-way recurrence for a^2 = b^2 here reads:

(n + 1)*(2*n + 1)*a*INT(EXP(m*x)*(a + b*SIN(x))^n, x)
- (m^2 + (n + 1)^2)*INT(EXP(m*x)*(a + b*SIN(x))^(n + 1), x)
+ (m*a + m*b*SIN(x) - (n + 1)*b*COS(x))*EXP(m*x)*(a + b*SIN(x))^n = 0

and the corresponding reduction formula:

(m^2 + (n + 1)^2)*a*INT((A + B*SIN(x) + C*COS(x))
*EXP(m*x)*(a + b*SIN(x))^n, x)
- ((m^2 + (n + 1)^2)*A*a - ((m^2 - n*(n + 1))*B + m*(2*n + 1)*C)*b)
*INT(EXP(m*x)*(a + b*SIN(x))^n, x)
- ((m*B + (n + 1)*C)*b
+ (m*B + (n + 1)*C)*a*SIN(x) + (m*C - (n + 1)*B)*a*COS(x))
*EXP(m*x)*(a + b*SIN(x))^n = 0

Note that, in the m = 0 integrands of section 2 in part one, a cosine
term in the numerator can instead be handled as a case of f'(x)*g(f(x)).
The present relations generalize those non-exponential sine recurrences
without raising the number of numerator terms needed. Corresponding
two-power relations with factor EXP(m*x) would require four numerator
terms, as predicted by a decomposition into sine-plus-cosine factors,
and are therefore not compiled here (see the introduction to part one);
the restriction of one power to a power of SIN(x) does not lower this
complexity. On the other hand, three numerator terms suffice for the
non-exponential versions given in section 8 of part two, where the
decomposition argument would predict four terms as well. The discrepancy
is caused by correlations among the under-determined sine-plus-cosine
factors that compose the binomials in the integrand.

30. Along the lines of the last section, but now eliminating sine terms
in the power and the numerator (C = c = 0), one arrives at recurrence
relations for exponential single-power cosine integrands:

(n + 1)*(n + 2)*(a^2 - b^2)*b*INT((A + B*COS(x))
*EXP(m*x)*(a + b*COS(x))^n, x)
+ INT((m^2*(A*b - B*a)*a - (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 + (n + 2)^2)*(A*b - B*a)*b*COS(x))
*EXP(m*x)*(a + b*COS(x))^(n + 1), x)
- (A*b - B*a)*(m*a + m*b*COS(x) + (n + 2)*b*SIN(x))
*EXP(m*x)*(a + b*COS(x))^(n + 1) = 0

(m^2 + (n + 1)^2)*b*INT((A + B*COS(x))*EXP(m*x)*(a + b*COS(x))^n, x)
- INT(((m^2 + (n + 1)^2)*A*a*b - B*(m^2*a^2 - n*(n + 1)*b^2)
+ ((m^2 + (n + 1)^2)*A*b - (m^2 - n*(n + 1))*B*a)*b*COS(x))
*EXP(m*x)*(a + b*COS(x))^(n - 1), x)
- B*(m*a + m*b*COS(x) + (n + 1)*b*SIN(x))
*EXP(m*x)*(a + b*COS(x))^n = 0

A sine term in the numerator can be eliminated by means of:

(n + 1)*b*INT((A + B*COS(x) + C*SIN(x))*EXP(m*x)*(a + b*COS(x))^n, x)
- INT(((m*C*a + (n + 1)*A*b) + (m*C + (n + 1)*B)*b*COS(x))
*EXP(m*x)*(a + b*COS(x))^n, x)
+ C*EXP(m*x)*(a + b*COS(x))^(n + 1) = 0

For a^2 = b^2 one has the simple two-way recurrence:

(n + 1)*(2*n + 1)*a*INT(EXP(m*x)*(a + b*COS(x))^n, x)
- (m^2 + (n + 1)^2)*INT(EXP(m*x)*(a + b*COS(x))^(n + 1), x)
+ (m*a + m*b*COS(x) + (n + 1)*b*SIN(x))*EXP(m*x)*(a + b*COS(x))^n = 0

along with the reduction formula:

(m^2 + (n + 1)^2)*a*INT((A + B*COS(x) + C*SIN(x))
*EXP(m*x)*(a + b*COS(x))^n, x)
- ((m^2 + (n + 1)^2)*A*a - ((m^2 - n*(n + 1))*B - m*(2*n + 1)*C)*b)
*INT(EXP(m*x)*(a + b*COS(x))^n, x)
- ((m*B - (n + 1)*C)*b
+ (m*B - (n + 1)*C)*a*COS(x) + (m*C + (n + 1)*B)*a*SIN(x))
*EXP(m*x)*(a + b*COS(x))^n = 0

These constitute exponential generalizations of the single-power cosine
recurrences listed in section 3 of part one. Corresponding two-power
relations again exceed the complexity limit of three numerator terms.

The saga of sine-cosine pairings in two-term recurrences for integrals

involving powers of trigonometric functions is to reach its end in the
eighth instalment of this compilation, where would-be compilees may once
again fall a victim to the no-third-power rule.

Martin.

clicl...@freenet.de

unread,
May 19, 2011, 3:03:47 PM5/19/11
to

The eighth part of my summary of two-term recurrence relations for
antiderivatives of trigonometric functions furnishes sine and cosine
variants of recent exponential recurrences. Relations for an ancient
sine integrand augmented by a cosine factor come next, followed by their
equivalents for the complementary cosine integrand with a sine factor.
Decimation of reckless candidates by the no-third-power rule helps to
bring the saga of sine-cosine pairings to a swift conclusion.

Part seven warrants an addendum: In the last paragraph of section 27
expand "that just combine (a+b*SIN(x))^m with (c+d*COS(x))^n" into "...,
or combine (a*COS(x)+b*SIN(x))^m with either (c+d*SIN(x))^n or
(c+d*COS(x))^n". There is an erratum as well: At the end of section 27
shorten "under-determined, and consequently correlated" to "necessarily
correlated", and at the end of section 29 omit "under-determined". [The
sine-plus-cosine constituents of the binomials in question are not
under-determined; their parameters are limited to a lower-dimensional
subspace.]

31. By replacing the parameter m in the exponential sine recurrences of
section 29 in part seven by #i*m and then splitting EXP(#i*m*x) into its
real and imaginary parts one arrives at relations involving SIN(m*x) and
COS(m*x), which read:

(n + 1)*(n + 2)*(a^2 - b^2)*b

*INT((A + B*SIN(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
- INT((m^2*(A*b - B*a)*a + (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 - (n + 2)^2)*(A*b - B*a)*b*SIN(x))
*SIN(m*x)*(a + b*SIN(x))^(n + 1), x)
- (A*b - B*a)*(m*(a + b*SIN(x))*COS(m*x) - (n + 2)*b*COS(x)*SIN(m*x))


*(a + b*SIN(x))^(n + 1) = 0

(m^2 - (n + 1)^2)*b*INT((A + B*SIN(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
- INT(((m^2 - (n + 1)^2)*A*a*b - B*(m^2*a^2 + n*(n + 1)*b^2)
+ ((m^2 - (n + 1)^2)*A*b - (m^2 + n*(n + 1))*B*a)*b*SIN(x))
*SIN(m*x)*(a + b*SIN(x))^(n - 1), x)
+ B*(m*(a + b*SIN(x))*COS(m*x) - (n + 1)*b*COS(x)*SIN(m*x))
*(a + b*SIN(x))^n = 0

(n + 1)*(n + 2)*(a^2 - b^2)*b

*INT((A + B*SIN(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- INT((m^2*(A*b - B*a)*a + (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 - (n + 2)^2)*(A*b - B*a)*b*SIN(x))
*COS(m*x)*(a + b*SIN(x))^(n + 1), x)
+ (A*b - B*a)*((n + 2)*b*COS(x)*COS(m*x) + m*(a + b*SIN(x))*SIN(m*x))


*(a + b*SIN(x))^(n + 1) = 0

(m^2 - (n + 1)^2)*b*INT((A + B*SIN(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- INT(((m^2 - (n + 1)^2)*A*a*b - B*(m^2*a^2 + n*(n + 1)*b^2)
+ ((m^2 - (n + 1)^2)*A*b - (m^2 + n*(n + 1))*B*a)*b*SIN(x))
*COS(m*x)*(a + b*SIN(x))^(n - 1), x)
- B*((n + 1)*b*COS(x)*COS(m*x) + m*(a + b*SIN(x))*SIN(m*x))
*(a + b*SIN(x))^n = 0

Numerators with an additional cosine term can here be reduced via:

(n + 1)*b*INT((A + B*SIN(x) + C*COS(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
- (n + 1)*b*INT((A + B*SIN(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
+ m*C*INT((a + b*SIN(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- C*SIN(m*x)*(a + b*SIN(x))^(n + 1) = 0

(n + 1)*b*INT((A + B*SIN(x) + C*COS(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- (n + 1)*b*INT((A + B*SIN(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- m*C*INT((a + b*SIN(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
- C*COS(m*x)*(a + b*SIN(x))^(n + 1) = 0

The two-way recurrences and reduction formulae for a^2 = b^2 become:

(n + 1)*(2*n + 1)*a*INT(SIN(m*x)*(a + b*SIN(x))^n, x)
+ (m^2 - (n + 1)^2)*INT(SIN(m*x)*(a + b*SIN(x))^(n + 1), x)
+ ((m*a + m*b*SIN(x))*COS(m*x) - (n + 1)*b*COS(x)*SIN(m*x))
*(a + b*SIN(x))^n = 0

(n + 1)*(2*n + 1)*a*INT(COS(m*x)*(a + b*SIN(x))^n, x)
+ (m^2 - (n + 1)^2)*INT(COS(m*x)*(a + b*SIN(x))^(n + 1), x)
- ((n + 1)*b*COS(x)*COS(m*x) + (m*a + m*b*SIN(x))*SIN(m*x))
*(a + b*SIN(x))^n = 0

(m^2 - (n + 1)^2)*a
*INT((A + B*SIN(x) + C*COS(x))*SIN(m*x)*(a + b*SIN(x))^n, x)
- (A*(m^2 - (n + 1)^2)*a - B*(m^2 + n*(n + 1))*b)
*INT(SIN(m*x)*(a + b*SIN(x))^n, x)
- m*(2*n + 1)*C*b*INT(COS(m*x)*(a + b*SIN(x))^n, x)
+ (m*(B*b + B*a*SIN(x) + C*a*COS(x))*COS(m*x)
+ (n + 1)*(C*b + C*a*SIN(x) - B*a*COS(x))*SIN(m*x))
*(a + b*SIN(x))^n = 0

(m^2 - (n + 1)^2)*a
*INT((A + B*SIN(x) + C*COS(x))*COS(m*x)*(a + b*SIN(x))^n, x)
- (A*(m^2 - (n + 1)^2)*a - B*(m^2 + n*(n + 1))*b)
*INT(COS(m*x)*(a + b*SIN(x))^n, x)
+ m*(2*n + 1)*C*b*INT(SIN(m*x)*(a + b*SIN(x))^n, x)
+ ((n + 1)*(C*b + C*a*SIN(x) - B*a*COS(x))*COS(m*x)
- m*(B*b + B*a*SIN(x) + C*a*COS(x))*SIN(m*x))
*(a + b*SIN(x))^n = 0

Alternatively, a rule-based integrator could express the functions
SIN(m*x) or COS(m*x) in terms of EXP(#i*m*x) and EXP(-#i*m*x) and apply
the relations of section 29 with complex values of m. The results of
this section are loosely connected with entries 2.535(1) and 2.536(1) in
Gradshteyn and Ryzhik (see also section 23 in part six).

32. The same procedure turns the exponential cosine recurrences of
section 30 in part seven into the following trigonometric versions:

(n + 1)*(n + 2)*(a^2 - b^2)*b

*INT((A + B*COS(x))*SIN(m*x)*(a + b*COS(x))^n, x)
- INT((m^2*(A*b - B*a)*a + (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 - (n + 2)^2)*(A*b - B*a)*b*COS(x))
*SIN(m*x)*(a + b*COS(x))^(n + 1), x)
- (A*b - B*a)*(m*(a + b*COS(x))*COS(m*x) + (n + 2)*b*SIN(x)*SIN(m*x))


*(a + b*COS(x))^(n + 1) = 0

(m^2 - (n + 1)^2)*b*INT((A + B*COS(x))*SIN(m*x)*(a + b*COS(x))^n, x)
- INT(((m^2 - (n + 1)^2)*A*a*b - B*(m^2*a^2 + n*(n + 1)*b^2)
+ ((m^2 - (n + 1)^2)*A*b - (m^2 + n*(n + 1))*B*a)*b*COS(x))
*SIN(m*x)*(a + b*COS(x))^(n - 1), x)
+ B*(m*(a + b*COS(x))*COS(m*x) + (n + 1)*b*SIN(x)*SIN(m*x))
*(a + b*COS(x))^n = 0

(n + 1)*(n + 2)*(a^2 - b^2)*b

*INT((A + B*COS(x))*COS(m*x)*(a + b*COS(x))^n, x)
- INT((m^2*(A*b - B*a)*a + (n + 1)*(n + 2)*(A*a - B*b)*b
+ (m^2 - (n + 2)^2)*(A*b - B*a)*b*COS(x))
*COS(m*x)*(a + b*COS(x))^(n + 1), x)
- (A*b - B*a)*((n + 2)*b*SIN(x)*COS(m*x) - m*(a + b*COS(x))*SIN(m*x))


*(a + b*COS(x))^(n + 1) = 0

(m^2 - (n + 1)^2)*b*INT((A + B*COS(x))*COS(m*x)*(a + b*COS(x))^n, x)
- INT(((m^2 - (n + 1)^2)*A*a*b - B*(m^2*a^2 + n*(n + 1)*b^2)
+ ((m^2 - (n + 1)^2)*A*b - (m^2 + n*(n + 1))*B*a)*b*COS(x))
*COS(m*x)*(a + b*COS(x))^(n - 1), x)
+ B*((n + 1)*b*SIN(x)*COS(m*x) - m*(a + b*COS(x))*SIN(m*x))
*(a + b*COS(x))^n = 0

An additional sine term in the numerator now yields to:

(n + 1)*b*INT((A + B*COS(x) + C*SIN(x))*SIN(m*x)*(a + b*COS(x))^n, x)
- (n + 1)*b*INT((A + B*COS(x))*SIN(m*x)*(a + b*COS(x))^n, x)
- m*C*INT((a + b*COS(x))*COS(m*x)*(a + b*COS(x))^n, x)
+ C*SIN(m*x)*(a + b*COS(x))^(n + 1) = 0

(n + 1)*b*INT((A + B*COS(x) + C*SIN(x))*COS(m*x)*(a + b*COS(x))^n, x)
- (n + 1)*b*INT((A + B*COS(x))*COS(m*x)*(a + b*COS(x))^n, x)
+ m*C*INT((a + b*COS(x))*SIN(m*x)*(a + b*COS(x))^n, x)
+ C*COS(m*x)*(a + b*COS(x))^(n + 1) = 0

The two-way recurrences and reduction formulae for a^2 = b^2 now are:

(n + 1)*(2*n + 1)*a*INT(SIN(m*x)*(a + b*COS(x))^n, x)
+ (m^2 - (n + 1)^2)*INT(SIN(m*x)*(a + b*COS(x))^(n + 1), x)
+ ((m*a + m*b*COS(x))*COS(m*x) + (n + 1)*b*SIN(x)*SIN(m*x))
*(a + b*COS(x))^n = 0

(n + 1)*(2*n + 1)*a*INT(COS(m*x)*(a + b*COS(x))^n, x)
+ (m^2 - (n + 1)^2)*INT(COS(m*x)*(a + b*COS(x))^(n + 1), x)
+ ((n + 1)*b*SIN(x)*COS(m*x) - (m*a + m*b*COS(x))*SIN(m*x))
*(a + b*COS(x))^n = 0

(m^2 - (n + 1)^2)*a
*INT((A + B*COS(x) + C*SIN(x))*SIN(m*x)*(a + b*COS(x))^n, x)
- (A*(m^2 - (n + 1)^2)*a - B*(m^2 + n*(n + 1))*b)
*INT(SIN(m*x)*(a + b*COS(x))^n, x)
+ m*(2*n + 1)*C*b*INT(COS(m*x)*(a + b*COS(x))^n, x)
+ (m*(B*b + B*a*COS(x) + C*a*SIN(x))*COS(m*x)
- (n + 1)*(C*b + C*a*COS(x) - B*a*SIN(x))*SIN(m*x))
*(a + b*COS(x))^n = 0

(m^2 - (n + 1)^2)*a
*INT((A + B*COS(x) + C*SIN(x))*COS(m*x)*(a + b*COS(x))^n, x)
- (A*(m^2 - (n + 1)^2)*a - B*(m^2 + n*(n + 1))*b)
*INT(COS(m*x)*(a + b*COS(x))^n, x)
- m*(2*n + 1)*C*b*INT(SIN(m*x)*(a + b*COS(x))^n, x)
- ((n + 1)*(C*b + C*a*COS(x) - B*a*SIN(x))*COS(m*x)
+ m*(B*b + B*a*COS(x) + C*a*SIN(x))*SIN(m*x))
*(a + b*COS(x))^n = 0

Again, the sine or cosine functions of m*x could alternatively be
converted to complex exponentials and then the relations of section 30
be applied. The results of this section relate to Gradshteyn-Ryzhik
entries 2.537(1) and 2.538(1) (see also section 23 in part six).

33. A simple kind of sine-cosine pairing is obtained by extending the
single-power sine integrand of section 2 in part one with the monomial
power COS(x)^m. As already seen for the corresponding tangent integral
in section 16 of part five, this generalization leaves the number of
numerator terms unchanged, and just the coefficients in the recurrences
become dependent on the new exponent:

(n + 1)*(a^2 - b^2)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (m + n + 2)*(A*b - B*a)*SIN(x))
*COS(x)^m*(a + b*SIN(x))^(n + 1), x)
+ (A*b - B*a)*COS(x)^(m + 1)*(a + b*SIN(x))^(n + 1) = 0

(m + n + 1)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((m + n + 1)*A*a + n*B*b + ((m + n + 1)*A*b + n*B*a)*SIN(x))
*COS(x)^m*(a + b*SIN(x))^(n - 1), x)
+ B*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

For degenerate integrands with a^2 = b^2, the generalized two-way
recurrence and reduction formula read:

(m + 2*n + 1)*a*INT(COS(x)^m*(a + b*SIN(x))^n, x)
- (m + n + 1)*INT(COS(x)^m*(a + b*SIN(x))^(n + 1), x)
- b*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

(m + n + 1)*a*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- ((m + n + 1)*A*a + n*B*b)*INT(COS(x)^m*(a + b*SIN(x))^n, x)
+ B*a*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

Where the reduction formula becomes singular, algebraic expansion into
two integrals may be used instead.

34. By analogy with the tangent example in section 17 of part five, the
smallest step for the new cosine exponent in the single-power sine
recurrences is one of size two on account of the square root in COS(x) =
SQRT(1-SIN(x)^2), and a separate first-degree polynomial appears in the
integrated term because the radicand is a second-degree polynomial. The
two-term recurrences for stepping the cosine exponent m in the extended
sine integrand are:

(m + 1)*(a^2 - b^2)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((m + 2)*A*(a^2 - b^2) - n*(A*b - B*a)*b
+ (m + n + 3)*(A*a - B*b)*b*SIN(x))
*COS(x)^(m + 2)*(a + b*SIN(x))^n, x)
- (A*b - B*a - (A*a - B*b)*SIN(x))
*COS(x)^(m + 1)*(a + b*SIN(x))^(n + 1) = 0

(m + n)*(m + n + 1)*b^2*INT((A + B*SIN(x))
*COS(x)^m*(a + b*SIN(x))^n, x)
- (m - 1)*INT((((m + n + 1)*A*b + n*B*a)*b
+ ((m + n + 1)*(A*a + B*b)*b - (m*a^2 + b^2)*B)*SIN(x))
*COS(x)^(m - 2)*(a + b*SIN(x))^n, x)
- ((m + n + 1)*A*b - m*B*a + (m + n)*B*b*SIN(x))
*COS(x)^(m - 1)*(a + b*SIN(x))^(n + 1) = 0

(m + 1)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((m + 2)*A*a + n*B*b + (m + n + 2)*A*b*SIN(x))
*COS(x)^(m + 2)*(a + b*SIN(x))^(n - 1), x)
+ (B + A*SIN(x))*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

(m + n + 1)*(n + 1)*b^2*INT((A + B*SIN(x))
*COS(x)^m*(a + b*SIN(x))^n, x)
- (m - 1)*INT(((n + 1)*B*b + ((m + n + 1)*A*b - m*B*a)*SIN(x))
*COS(x)^(m - 2)*(a + b*SIN(x))^(n + 1), x)
- ((m + n + 1)*A*b - m*B*a + (n + 1)*B*b*SIN(x))
*COS(x)^(m - 1)*(a + b*SIN(x))^(n + 1) = 0

Other relations whose integrated terms possess the same structure may
prove useful here too:

(m + 1)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT((((m + 2)*a^2 - b^2)*A + n*(A*b + B*a)*b
+ ((m + n + 1)*A*a + n*B*b)*b*SIN(x))
*COS(x)^(m + 2)*(a + b*SIN(x))^(n - 2), x)
+ (A*b + B*a + (A*a + B*b)*SIN(x))
*COS(x)^(m + 1)*(a + b*SIN(x))^(n - 1) = 0

(n + 1)*(n + 2)*(a^2 - b^2)*b^2*INT((A + B*SIN(x))
*COS(x)^m*(a + b*SIN(x))^n, x)
+ (m - 1)*INT(((n + 2)*(A*b - B*a)*b
- ((m + n + 1)*(A*a - B*b)*b - m*B*(a^2 - b^2))*SIN(x))
*COS(x)^(m - 2)*(a + b*SIN(x))^(n + 2), x)
- ((m*a^2 - b^2)*(A*b - B*a) + (n + 1)*A*(a^2 - b^2)*b
+ ((m - 1)*(A*b - B*a)*a + (n + 1)*B*(a^2 - b^2))*b*SIN(x))
*COS(x)^(m - 1)*(a + b*SIN(x))^(n + 1) = 0

(n + 1)*(n + 2)*(a^2 - b^2)^2*INT((A + B*SIN(x))
*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((n + 2)*((m + n + 2)*(A*b - B*a)*b + (n + 1)*(A*a - B*b)*a)
- (m + n + 3)*((m + n + 2)*(A*b - B*a)*a
+ (n + 1)*(A*a - B*b)*b)*SIN(x))
*COS(x)^m*(a + b*SIN(x))^(n + 2), x)
+ (((m + 2*n + 4)*a^2 - b^2)*(A*b - B*a) + (n + 1)*A*(a^2 - b^2)*b
+ ((m + n + 2)*(A*b - B*a)*a + (n + 1)*(A*a - B*b)*b)*b*SIN(x))
*COS(x)^(m + 1)*(a + b*SIN(x))^(n + 1) = 0

(m + n)*(m + n + 1)*INT((A + B*SIN(x))*COS(x)^m*(a + b*SIN(x))^n, x)
- INT(((m + n + 1)*A*((m + n)*a^2 + (n - 1)*b^2)
+ (m + 2*n - 1)*n*B*a*b + ((m + n + 1)*(m + 2*n - 1)*A*a*b
+ n*B*((n - 1)*a^2 + (m +n)*b^2))*SIN(x))
*COS(x)^m*(a + b*SIN(x))^(n - 2), x)
+ ((m + n + 1)*A*b + (m + 2*n)*B*a + (m + n)*B*b*SIN(x))
*COS(x)^(m + 1)*(a + b*SIN(x))^(n - 1) = 0

where the last two are just iterations of the recurrences for constant
m. In the degenerate case of a^2 = b^2, the exponent m can be stepped by
means of the simpler two-way relations:

(m + 1)*(m + 2*n + 1)*a*INT(COS(x)^m*(a + b*SIN(x))^n, x)
- (m + n + 1)*(m + n + 2)*a*INT(COS(x)^(m + 2)*(a + b*SIN(x))^n, x)
+ (n*b + (m + n + 1)*a*SIN(x))*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

(m + 1)*a*INT(COS(x)^m*(a + b*SIN(x))^n, x)
- (m + n + 1)*a^2*INT(COS(x)^(m + 2)*(a + b*SIN(x))^(n - 1), x)
+ b*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

and in correspondence with the non-degenerate case one also has:

(m + 1)*INT(COS(x)^m*(a + b*SIN(x))^n, x)
- (m + 2*n - 1)*a^2*INT(COS(x)^(m + 2)*(a + b*SIN(x))^(n - 2), x)
+ 2*b*COS(x)^(m + 1)*(a + b*SIN(x))^(n - 1) = 0

(m + 2*n + 1)*(m + 2*n + 3)*a^2*INT(COS(x)^m*(a + b*SIN(x))^n, x)
- (m + n + 1)*(m + n + 2)*INT(COS(x)^m*(a + b*SIN(x))^(n + 2), x)
- ((2*m + 3*n + 4)*b + (m + n + 1)*a*SIN(x))*a
*COS(x)^(m + 1)*(a + b*SIN(x))^n = 0

which work both ways as well. As in the tangent case, the polynomial in
the integrated term vanishes in two of the recurrences for a^2 = b^2.

35. Cosine equivalents of the extended sine recurrences in section 33
result when a monomial sine power is included in the single-power cosine
integrand of section 3 in part one:

(n + 1)*(a^2 - b^2)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (m + n + 2)*(A*b - B*a)*COS(x))
*SIN(x)^m*(a + b*COS(x))^(n + 1), x)
- (A*b - B*a)*SIN(x)^(m + 1)*(a + b*COS(x))^(n + 1) = 0

(m + n + 1)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((m + n + 1)*A*a + n*B*b + ((m + n + 1)*A*b + n*B*a)*COS(x))
*SIN(x)^m*(a + b*COS(x))^(n - 1), x)
- B*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

The two-way relation and reduction formula for a^2 = b^2 generalize to:

(m + 2*n + 1)*a*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- (m + n + 1)*INT(SIN(x)^m*(a + b*COS(x))^(n + 1), x)
+ b*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

(m + n + 1)*a*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- ((m + n + 1)*A*a + n*B*b)*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- B*a*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

The singularity in the reduction formula can again be avoided by
algebraic expansion into two integrals.

36. Stepping of the new sine exponent in the extended single-power
cosine integral is effected by the following two-term recurrences:

(m + 1)*(a^2 - b^2)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((m + 2)*A*(a^2 - b^2) - n*(A*b - B*a)*b
+ (m + n + 3)*(A*a - B*b)*b*COS(x))
*SIN(x)^(m + 2)*(a + b*COS(x))^n, x)
+ (A*b - B*a - (A*a - B*b)*COS(x))
*SIN(x)^(m + 1)*(a + b*COS(x))^(n + 1) = 0

(m + n)*(m + n + 1)*b^2*INT((A + B*COS(x))
*SIN(x)^m*(a + b*COS(x))^n, x)
- (m - 1)*INT((((m + n + 1)*A*b + n*B*a)*b
+ ((m + n + 1)*(A*a + B*b)*b - (m*a^2 + b^2)*B)*COS(x))
*SIN(x)^(m - 2)*(a + b*COS(x))^n, x)
+ ((m + n + 1)*A*b - m*B*a + (m + n)*B*b*COS(x))
*SIN(x)^(m - 1)*(a + b*COS(x))^(n + 1) = 0

(m + 1)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((m + 2)*A*a + n*B*b + (m + n + 2)*A*b*COS(x))
*SIN(x)^(m + 2)*(a + b*COS(x))^(n - 1), x)
- (B + A*COS(x))*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

(m + n + 1)*(n + 1)*b^2*INT((A + B*COS(x))
*SIN(x)^m*(a + b*COS(x))^n, x)
- (m - 1)*INT(((n + 1)*B*b + ((m + n + 1)*A*b - m*B*a)*COS(x))
*SIN(x)^(m - 2)*(a + b*COS(x))^(n + 1), x)
+ ((m + n + 1)*A*b - m*B*a + (n + 1)*B*b*COS(x))
*SIN(x)^(m - 1)*(a + b*COS(x))^(n + 1) = 0

Further relations with the same type of integrated term are:

(m + 1)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT((((m + 2)*a^2 - b^2)*A + n*(A*b + B*a)*b
+ ((m + n + 1)*A*a + n*B*b)*b*COS(x))
*SIN(x)^(m + 2)*(a + b*COS(x))^(n - 2), x)
- (A*b + B*a + (A*a + B*b)*COS(x))
*SIN(x)^(m + 1)*(a + b*COS(x))^(n - 1) = 0

(n + 1)*(n + 2)*(a^2 - b^2)*b^2*INT((A + B*COS(x))
*SIN(x)^m*(a + b*COS(x))^n, x)
+ (m - 1)*INT(((n + 2)*(A*b - B*a)*b
- ((m + n + 1)*(A*a - B*b)*b - m*B*(a^2 - b^2))*COS(x))
*SIN(x)^(m - 2)*(a + b*COS(x))^(n + 2), x)
+ ((m*a^2 - b^2)*(A*b - B*a) + (n + 1)*A*(a^2 - b^2)*b
+ ((m - 1)*(A*b - B*a)*a + (n + 1)*B*(a^2 - b^2))*b*COS(x))
*SIN(x)^(m - 1)*(a + b*COS(x))^(n + 1) = 0

(n + 1)*(n + 2)*(a^2 - b^2)^2*INT((A + B*COS(x))
*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((n + 2)*((m + n + 2)*(A*b - B*a)*b + (n + 1)*(A*a - B*b)*a)
- (m + n + 3)*((m + n + 2)*(A*b - B*a)*a
+ (n + 1)*(A*a - B*b)*b)*COS(x))
*SIN(x)^m*(a + b*COS(x))^(n + 2), x)
- (((m + 2*n + 4)*a^2 - b^2)*(A*b - B*a) + (n + 1)*A*(a^2 - b^2)*b
+ ((m + n + 2)*(A*b - B*a)*a + (n + 1)*(A*a - B*b)*b)*b*COS(x))
*SIN(x)^(m + 1)*(a + b*COS(x))^(n + 1) = 0

(m + n)*(m + n + 1)*INT((A + B*COS(x))*SIN(x)^m*(a + b*COS(x))^n, x)
- INT(((m + n + 1)*A*((m + n)*a^2 + (n - 1)*b^2)
+ (m + 2*n - 1)*n*B*a*b + ((m + n + 1)*(m + 2*n - 1)*A*a*b
+ n*B*((n - 1)*a^2 + (m + n)*b^2))*COS(x))
*SIN(x)^m*(a + b*COS(x))^(n - 2), x)
- ((m + n + 1)*A*b + (m + 2*n)*B*a + (m + n)*B*b*COS(x))
*SIN(x)^(m + 1)*(a + b*COS(x))^(n - 1) = 0

For a^2 = b^2 one obtains the simpler recurrences:

(m + 1)*(m + 2*n + 1)*a*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- (m + n + 1)*(m + n + 2)*a*INT(SIN(x)^(m + 2)*(a + b*COS(x))^n, x)
- (n*b + (m + n + 1)*a*COS(x))*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

(m + 1)*a*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- (m + n + 1)*a^2*INT(SIN(x)^(m + 2)*(a + b*COS(x))^(n - 1), x)
- b*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

and by analogy with the non-degenerate case also:

(m + 1)*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- (m + 2*n - 1)*a^2*INT(SIN(x)^(m + 2)*(a + b*COS(x))^(n - 2), x)
- 2*b*SIN(x)^(m + 1)*(a + b*COS(x))^(n - 1) = 0

(m + 2*n + 1)*(m + 2*n + 3)*a^2*INT(SIN(x)^m*(a + b*COS(x))^n, x)
- (m + n + 1)*(m + n + 2)*INT(SIN(x)^m*(a + b*COS(x))^(n + 2), x)
+ ((2*m + 3*n + 4)*b + (m + n + 1)*a*COS(x))*a
*SIN(x)^(m + 1)*(a + b*COS(x))^n = 0

These four can be read forward as well as backward. Like the results of
sections 20 and 21 in parts five and six, the relations of this and the
three preceding sections generalize the two-power recurrences under


2.510 in Gradshteyn and Ryzhik.

Recurrences that include an exponential factor EXP(m*x) in the present
integrand or in the complementary integrand of sections 33 and 34
require four numerator terms and are therefore not part of this
compilation (see the introduction to part one). On the other hand, the
numerator complexity remains at three terms when the two-power sine or
cosine integrands from section 8 or section 9 of part two are extended
with just a monomial cosine or monomial sine power, respectively. Along
with their cosine-tangent and sine-cotangent counterparts mentioned in
section 25 of part six, these three-power integrands are excluded here
because of the large number of bulky relations that they satisfy.

The ninth instalment of this compilation of two-term recurrences for
integrals of trigonometric functions is to witness the return of uncouth
integrands combining sine or cosine powers with tangent or cotangent
powers. What a life.

Martin.

clicl...@freenet.de

unread,
Jun 15, 2011, 2:43:37 PM6/15/11
to

My apidological studies on the South Downs leave little room for other
interests this year, but with Martin's stimulating compilation having
reached the halfway mark the time has come to set some matters straight.

In part two, section 14 of the serial it was stated that "substantially
simpler [two-term recurrence] relations for single-power secant
integrals do not exist", where the single-power integrand was evidently
assumed to be of the form (a + b*SEC(x))^n. However, such relations do
exist as inconspicuous special cases of the two-power recurrences listed
in section 14 when the integrand is allowed to include the additional
factor SEC(x). The following sections 5b and 5c should therefore be
added to part one of Martin's serial:

5b. Corresponding recurrence relations for secant integrands involve a
twist in that an extra factor SEC(x) must be present in the integrand:

(n + 1)*(a^2 - b^2)*INT((A + B*SEC(x))*SEC(x)*(a + b*SEC(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (n + 2)*(A*b - B*a)*SEC(x))
*SEC(x)*(a + b*SEC(x))^(n + 1), x)
- (A*b - B*a)*TAN(x)*(a + b*SEC(x))^(n + 1) = 0

(n + 1)*INT((A + B*SEC(x))*SEC(x)*(a + b*SEC(x))^n, x)
- INT(((n + 1)*A*a + n*B*b + ((n + 1)*A*b + n*B*a)*SEC(x))
*SEC(x)*(a + b*SEC(x))^(n - 1), x)
- B*TAN(x)*(a + b*SEC(x))^n = 0

The two-way recurrence and reduction formula for a^2 = b^2 are:

(2*n + 1)*a*INT(SEC(x)*(a + b*SEC(x))^n, x)
- (n + 1)*INT(SEC(x)*(a + b*SEC(x))^(n + 1), x)
+ b*TAN(x)*(a + b*SEC(x))^n = 0

(n + 1)*a*INT((A + B*SEC(x))*SEC(x)*(a + b*SEC(x))^n, x)
- ((n + 1)*A*a + n*B*b)*INT(SEC(x)*(a + b*SEC(x))^n, x)
- B*a*TAN(x)*(a + b*SEC(x))^n = 0

Note that the coefficients in these recurrences fully agree with those
in the cosine relations of section 3 above. The integrand may here be
similarly generalized by including an arbitrary fixed power of TAN(x).

5c. Cosecant equivalents of the foregoing relations read:

(n + 1)*(a^2 - b^2)*INT((A + B*CSC(x))*CSC(x)*(a + b*CSC(x))^n, x)
- INT(((n + 1)*(A*a - B*b) - (n + 2)*(A*b - B*a)*CSC(x))
*CSC(x)*(a + b*CSC(x))^(n + 1), x)
+ (A*b - B*a)*COT(x)*(a + b*CSC(x))^(n + 1) = 0

(n + 1)*INT((A + B*CSC(x))*CSC(x)*(a + b*CSC(x))^n, x)
- INT(((n + 1)*A*a + n*B*b + ((n + 1)*A*b + n*B*a)*CSC(x))
*CSC(x)*(a + b*CSC(x))^(n - 1), x)
+ B*COT(x)*(a + b*CSC(x))^n = 0

And for a^2 = b^2:

(2*n + 1)*a*INT(CSC(x)*(a + b*CSC(x))^n, x)
- (n + 1)*INT(CSC(x)*(a + b*CSC(x))^(n + 1), x)
- b*COT(x)*(a + b*CSC(x))^n = 0

(n + 1)*a*INT((A + B*CSC(x))*CSC(x)*(a + b*CSC(x))^n, x)
- ((n + 1)*A*a + n*B*b)*INT(CSC(x)*(a + b*CSC(x))^n, x)
+ B*a*COT(x)*(a + b*CSC(x))^n = 0

The cosecant integrand may be generalized by including a fixed power of
COT(x).

These overlooked single-power recurrences, as well as the inverted
recurrence for a + b*COS(x) + c*SIN(x) and that for the degenerate case
of a^2 = b^2 + c^2, both listed in section 1, part one of Martin's
compilation, and also the two-way recurrence listed in section 24, part
six, were obtained and published previously by Albert D. Rich as
components of his automated integrator Rubi.

The inclusion of an extra factor SEC(x) also enables the derivation of
recurrence relations for integrands involving two powers of the binomial
type (a + b*SEC(x))^n. In view of the existence of the single-power
secant and cosecant relations and in order to cover the corresponding
two-power relations, sections 14, 15 and 16 in part two of Martin's
compilation need to be updated to read as follows:

14. The transformation of secant integrals to algebraic ones via the
substitution s = SEC(x), ds = s*SQRT(s^2-1) dx is as unattractive as
that of sine integrals because the sign of the extra factor SQRT(s^2-1)
is ambiguous. Moreover, since a second extra factor s appears here,

integrands involving two powers of the binomial type (a + b*SEC(x))^n
cannot be accomodated within the present complexity limit (see the
introduction to part one) unless an additional fixed factor SEC(x) is
included - the very extra factor that distinguishes the single-power
integrals of section 5b in part one. The resulting two-power secant
recurrences are:

(m + 1)*(a^2 - b^2)*(a*d - b*c)*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
+ INT(((m + 1)*(((A + C)*a - B*b)*b*c - A*(a^2 - b^2)*d)
+ (n + 1)*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*b - B*a)*(a*d - b*c)
- (A*b^2 - (B*b - C*a)*a)*c)*SEC(x)
- (m + n + 3)*(A*b^2 - (B*b - C*a)*a)*d*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^n, x)


+ (A*b^2 - (B*b - C*a)*a)

*TAN(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^(n + 1) = 0

(m + n + 2)*d*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)


- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*((A + C)*b + B*a)*d - C*(a*c + b*d))*SEC(x)
+ ((m + n + 2)*B*b*d + C*(m*a*d - (m + 1)*b*c))*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^(m - 1)*(c + d*SEC(x))^n, x)
- C*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n + 1) = 0

(m + 1)*b*(a^2 - b^2)*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- INT(((m + 1)*((A + C)*a - B*b)*b*c + n*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*(a*d - b*c) + B*(a*c - b*d))*b
- (A*b^2 - (B*b - C*a)*a)*c)*SEC(x)
- ((m + n + 2)*((A + C)*b - B*a)*b
+ (n + 1)*C*(a^2 - b^2))*d*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^(n - 1), x)


- (A*b^2 - (B*b - C*a)*a)

*TAN(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^n = 0

Interchanging the symbols (a,b,m) with (c,d,n) transforms the above into
another three relations. The somewhat simpler recurrences for the
degenerate case of a^2 = b^2 read:

(2*m + 1)*a*(a*d - b*c)*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)


- INT((m*(A*d - B*c)*a + (m + 1)*A*(a*d - b*c)

+ (n + 1)*(A*a - B*b)*d - (m + n + 2)*(A*b - B*a)*d*SEC(x))
*SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^n, x)
- (A*a - B*b)*a*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- INT((A*(m + n + 1)*a*d + B*((m - 1)*a*c + (n + 1)*b*d)
+ ((m + n + 1)*(A*b + B*a)*d + B*((m - 1)*a*d - m*b*c))*SEC(x))
*SEC(x)*(a + b*SEC(x))^(m - 1)*(c + d*SEC(x))^n, x)
- B*b*TAN(x)*(a + b*SEC(x))^(m - 1)*(c + d*SEC(x))^(n + 1) = 0

(n + 1)*a*(c^2 - d^2)*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- INT((m*(A*d - B*c)*b + (n + 1)*(A*c - B*d)*a
- (m + n + 2)*(A*d - B*c)*a*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n + 1), x)
- (A*d - B*c)*a*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n + 1) = 0

(m + n + 1)*a*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- INT(((m + n + 1)*A*a*c + B*(m*b*c + n*a*d)
+ ((m + n + 1)*A*a*d + B*(m*b*d + n*a*c))*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n - 1), x)
- B*a*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n = 0

(2*m + 1)*a^2*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)


- INT((((m + 1)*A*a + m*B*b)*c - n*(A*b - B*a)*d

+ ((m + n + 1)*A*a + (m - n)*B*b)*d*SEC(x))
*SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^(n - 1), x)
+ (A*b - B*a)*a*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
- (m*(A*d - B*c)*a + (n + 1)*(A*a + B*b)*d)*SEC(x))
*SEC(x)*(a + b*SEC(x))^(m - 1)*(c + d*SEC(x))^(n + 1), x)
+ (A*d - B*c)*a^2
*TAN(x)*(a + b*SEC(x))^(m - 1)*(c + d*SEC(x))^(n + 1) = 0

Relations for c^2 = d^2 result here when (a,b,m) is interchanged with
(c,d,n). In the doubly degenerate case where both a^2 = b^2 and c^2
= d^2 one finally finds:

((2*m + n + 1)*a*d + n*b*c)
*INT(SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- (m + n + 1)*d
*INT(SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^n, x)
+ b*d*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n = 0

((2*m + n)*a*d + (n - 1)*b*c)*b

*INT(SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- ((m + 2*n - 1)*b*c + m*a*d)*d
*INT(SEC(x)*(a + b*SEC(x))^(m + 1)*(c + d*SEC(x))^(n - 1), x)
- (a*d - b*c)*b*d*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n - 1) = 0

and these two-way relations remain valid after the operation (a,b,m) <->
(c,d,n) has been applied.

Note that the extra SEC(x) can be absorbed into one power if either
(a,b) = (0,1) or (c,d) = (0,1); such relations for the integrand
SEC(x)^m * (a + b*SEC(x))^n were already given in various earlier posts,


where they were derived ab initio. Equivalent results may be obtained

from the two-power cosine recurrences in section 9, part two, by means


of the replacements (a,b) <- (0,1), (c,d) <- (b,a), (A,B,C) <- (C,B,A),

m <- -m-n-2, and a regrouping of factors. Also note the complete
agreement of coefficients between the cosine relations of section 9 and
the recurrences listed here.

As was the case for a single secant power, the integrand of the present
recurrences can be extended by including an arbitrary constant power of
TAN(x).

15. The two-term recurrence relations for the corresponding cosecant

integrals read:

(m + 1)*(a^2 - b^2)*(a*d - b*c)*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
+ INT(((m + 1)*(((A + C)*a - B*b)*b*c - A*(a^2 - b^2)*d)
+ (n + 1)*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*b - B*a)*(a*d - b*c)
- (A*b^2 - (B*b - C*a)*a)*c)*CSC(x)
- (m + n + 3)*(A*b^2 - (B*b - C*a)*a)*d*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^n, x)
- (A*b^2 - (B*b - C*a)*a)
*COT(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^(n + 1) = 0

(m + n + 2)*d*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)


- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*((A + C)*b + B*a)*d - C*(a*c + b*d))*CSC(x)
+ ((m + n + 2)*B*b*d + C*(m*a*d - (m + 1)*b*c))*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^(m - 1)*(c + d*CSC(x))^n, x)
+ C*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n + 1) = 0

(m + 1)*b*(a^2 - b^2)*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- INT(((m + 1)*((A + C)*a - B*b)*b*c + n*(A*b^2 - (B*b - C*a)*a)*d
+ ((m + 1)*((A + C)*(a*d - b*c) + B*(a*c - b*d))*b
- (A*b^2 - (B*b - C*a)*a)*c)*CSC(x)
- ((m + n + 2)*((A + C)*b - B*a)*b
+ (n + 1)*C*(a^2 - b^2))*d*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^(n - 1), x)


+ (A*b^2 - (B*b - C*a)*a)

*COT(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^n = 0

For a^2 = b^2 one has the simpler recurrences:

(2*m + 1)*a*(a*d - b*c)*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)


- INT((m*(A*d - B*c)*a + (m + 1)*A*(a*d - b*c)

+ (n + 1)*(A*a - B*b)*d - (m + n + 2)*(A*b - B*a)*d*CSC(x))
*CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^n, x)
+ (A*a - B*b)*a*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n + 1) = 0

(m + n + 1)*d*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- INT((A*(m + n + 1)*a*d + B*((m - 1)*a*c + (n + 1)*b*d)
+ ((m + n + 1)*(A*b + B*a)*d + B*((m - 1)*a*d - m*b*c))*CSC(x))
*CSC(x)*(a + b*CSC(x))^(m - 1)*(c + d*CSC(x))^n, x)
+ B*b*COT(x)*(a + b*CSC(x))^(m - 1)*(c + d*CSC(x))^(n + 1) = 0

(n + 1)*a*(c^2 - d^2)*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- INT((m*(A*d - B*c)*b + (n + 1)*(A*c - B*d)*a
- (m + n + 2)*(A*d - B*c)*a*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n + 1), x)
+ (A*d - B*c)*a*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n + 1) = 0

(m + n + 1)*a*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- INT(((m + n + 1)*A*a*c + B*(m*b*c + n*a*d)
+ ((m + n + 1)*A*a*d + B*(m*b*d + n*a*c))*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n - 1), x)
+ B*a*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n = 0

(2*m + 1)*a^2*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)


- INT((((m + 1)*A*a + m*B*b)*c - n*(A*b - B*a)*d

+ ((m + n + 1)*A*a + (m - n)*B*b)*d*CSC(x))
*CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^(n - 1), x)
- (A*b - B*a)*a*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n = 0

(n + 1)*(a*d + b*c)*d*INT((A + B*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
+ a*INT(((m - 1)*(A*d - B*c)*b - (n + 1)*(A*b + B*a)*d
- (m*(A*d - B*c)*a + (n + 1)*(A*a + B*b)*d)*CSC(x))
*CSC(x)*(a + b*CSC(x))^(m - 1)*(c + d*CSC(x))^(n + 1), x)
- (A*d - B*c)*a^2
*COT(x)*(a + b*CSC(x))^(m - 1)*(c + d*CSC(x))^(n + 1) = 0

and if both a^2 = b^2 and c^2 = d^2, finally:

((2*m + n + 1)*a*d + n*b*c)
*INT(CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- (m + n + 1)*d
*INT(CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^n, x)
- b*d*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n = 0

((2*m + n)*a*d + (n - 1)*b*c)*b

*INT(CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
- ((m + 2*n - 1)*b*c + m*a*d)*d
*INT(CSC(x)*(a + b*CSC(x))^(m + 1)*(c + d*CSC(x))^(n - 1), x)
+ (a*d - b*c)*b*d*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n - 1) = 0

The integrand of the cosecant recurrences may be extended by including
a constant power of COT(x).

16. In the degenerate case a^2 = b^2 of the two-power secant integrals,
numerators with C /= 0 can be reduced by means of the formula:

(m + n + 2)*a*d*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)


- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*B*a*d + C*(m*b*d - (m + 1)*a*c))*SEC(x))
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- C*a*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^(n + 1) = 0

while the following applies if B /= 0 or C /= 0 when both a^2 = b^2 and
c^2 = d^2:

(m + n + 1)*(m + n + 2)*a*c*INT((A + B*SEC(x) + C*SEC(x)^2)
*SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)


- ((m + n + 2)*((m + n + 1)*A*a*c + B*(n*a*d + m*b*c))
+ C*((m^2 + m + n^2 + n + 1)*a*c + 2*m*n*b*d))

*INT(SEC(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n, x)
- ((m + n + 2)*B*a*c + C*(m*b*c + n*a*d) + (m + n + 1)*C*a*c*SEC(x))
*TAN(x)*(a + b*SEC(x))^m*(c + d*SEC(x))^n = 0

The equivalent cosecant formula for the case a^2 = b^2 is:

(m + n + 2)*a*d*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)


- INT(((m + n + 2)*A*a*d + C*(m*b*c + (n + 1)*a*d)

+ ((m + n + 2)*B*a*d + C*(m*b*d - (m + 1)*a*c))*CSC(x))
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
+ C*a*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^(n + 1) = 0

and that for the doubly degenerate case:

(m + n + 1)*(m + n + 2)*a*c*INT((A + B*CSC(x) + C*CSC(x)^2)
*CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)


- ((m + n + 2)*((m + n + 1)*A*a*c + B*(n*a*d + m*b*c))
+ C*((m^2 + m + n^2 + n + 1)*a*c + 2*m*n*b*d))

*INT(CSC(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n, x)
+ ((m + n + 2)*B*a*c + C*(m*b*c + n*a*d) + (m + n + 1)*C*a*c*CSC(x))
*COT(x)*(a + b*CSC(x))^m*(c + d*CSC(x))^n = 0

Once more, these four do not work for all combinations of exponents m,n.


A full set of reduction formulae can be derived by fusing the above with
suitable recurrence steps. Alternatively, algebraic expansion of the
integrands into multiple terms may be employed.

I must attend to my colonies now, and Martin is free to take to the helm
again and deliver the delayed ninth instalment of his compilation of
two-term recurrences for integrals of trigonometric functions.

Holmes.

0 new messages