\(\int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx\) [17]

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [C] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 111 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=a x-\frac {\cot ^7(c+d x) (a+a \sec (c+d x))}{7 d}+\frac {\cot ^5(c+d x) (7 a+6 a \sec (c+d x))}{35 d}+\frac {\cot (c+d x) (35 a+16 a \sec (c+d x))}{35 d}-\frac {\cot ^3(c+d x) (35 a+24 a \sec (c+d x))}{105 d} \] Output:

a*x-1/7*cot(d*x+c)^7*(a+a*sec(d*x+c))/d+1/35*cot(d*x+c)^5*(7*a+6*a*sec(d*x 
+c))/d+1/35*cot(d*x+c)*(35*a+16*a*sec(d*x+c))/d-1/105*cot(d*x+c)^3*(35*a+2 
4*a*sec(d*x+c))/d
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.04 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.83 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \csc (c+d x)}{d}-\frac {a \csc ^3(c+d x)}{d}+\frac {3 a \csc ^5(c+d x)}{5 d}-\frac {a \csc ^7(c+d x)}{7 d}-\frac {a \cot ^7(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {7}{2},1,-\frac {5}{2},-\tan ^2(c+d x)\right )}{7 d} \] Input:

Integrate[Cot[c + d*x]^8*(a + a*Sec[c + d*x]),x]
 

Output:

(a*Csc[c + d*x])/d - (a*Csc[c + d*x]^3)/d + (3*a*Csc[c + d*x]^5)/(5*d) - ( 
a*Csc[c + d*x]^7)/(7*d) - (a*Cot[c + d*x]^7*Hypergeometric2F1[-7/2, 1, -5/ 
2, -Tan[c + d*x]^2])/(7*d)
 

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.07, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.632, Rules used = {3042, 4370, 25, 3042, 4370, 25, 3042, 4370, 27, 3042, 4370, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cot ^8(c+d x) (a \sec (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a \csc \left (c+d x+\frac {\pi }{2}\right )+a}{\cot \left (c+d x+\frac {\pi }{2}\right )^8}dx\)

\(\Big \downarrow \) 4370

\(\displaystyle \frac {1}{7} \int -\cot ^6(c+d x) (6 \sec (c+d x) a+7 a)dx-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {1}{7} \int \cot ^6(c+d x) (6 \sec (c+d x) a+7 a)dx-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {1}{7} \int \frac {6 \csc \left (c+d x+\frac {\pi }{2}\right ) a+7 a}{\cot \left (c+d x+\frac {\pi }{2}\right )^6}dx-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 4370

\(\displaystyle \frac {1}{7} \left (\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}-\frac {1}{5} \int -\cot ^4(c+d x) (24 \sec (c+d x) a+35 a)dx\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int \cot ^4(c+d x) (24 \sec (c+d x) a+35 a)dx+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \int \frac {24 \csc \left (c+d x+\frac {\pi }{2}\right ) a+35 a}{\cot \left (c+d x+\frac {\pi }{2}\right )^4}dx+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 4370

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (\frac {1}{3} \int -3 \cot ^2(c+d x) (16 \sec (c+d x) a+35 a)dx-\frac {\cot ^3(c+d x) (24 a \sec (c+d x)+35 a)}{3 d}\right )+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-\int \cot ^2(c+d x) (16 \sec (c+d x) a+35 a)dx-\frac {\cot ^3(c+d x) (24 a \sec (c+d x)+35 a)}{3 d}\right )+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-\int \frac {16 \csc \left (c+d x+\frac {\pi }{2}\right ) a+35 a}{\cot \left (c+d x+\frac {\pi }{2}\right )^2}dx-\frac {\cot ^3(c+d x) (24 a \sec (c+d x)+35 a)}{3 d}\right )+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 4370

\(\displaystyle \frac {1}{7} \left (\frac {1}{5} \left (-\int -35 adx-\frac {\cot ^3(c+d x) (24 a \sec (c+d x)+35 a)}{3 d}+\frac {\cot (c+d x) (16 a \sec (c+d x)+35 a)}{d}\right )+\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{7} \left (\frac {\cot ^5(c+d x) (6 a \sec (c+d x)+7 a)}{5 d}+\frac {1}{5} \left (-\frac {\cot ^3(c+d x) (24 a \sec (c+d x)+35 a)}{3 d}+\frac {\cot (c+d x) (16 a \sec (c+d x)+35 a)}{d}+35 a x\right )\right )-\frac {\cot ^7(c+d x) (a \sec (c+d x)+a)}{7 d}\)

Input:

Int[Cot[c + d*x]^8*(a + a*Sec[c + d*x]),x]
 

Output:

-1/7*(Cot[c + d*x]^7*(a + a*Sec[c + d*x]))/d + ((Cot[c + d*x]^5*(7*a + 6*a 
*Sec[c + d*x]))/(5*d) + (35*a*x + (Cot[c + d*x]*(35*a + 16*a*Sec[c + d*x]) 
)/d - (Cot[c + d*x]^3*(35*a + 24*a*Sec[c + d*x]))/(3*d))/5)/7
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4370
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[(-(e*Cot[c + d*x])^(m + 1))*((a + b*Csc[c + d*x])/( 
d*e*(m + 1))), x] - Simp[1/(e^2*(m + 1))   Int[(e*Cot[c + d*x])^(m + 2)*(a* 
(m + 1) + b*(m + 2)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && L 
tQ[m, -1]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.64 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.35

method result size
risch \(a x +\frac {2 i a \left (105 \,{\mathrm e}^{11 i \left (d x +c \right )}+210 \,{\mathrm e}^{10 i \left (d x +c \right )}-735 \,{\mathrm e}^{9 i \left (d x +c \right )}+1638 \,{\mathrm e}^{7 i \left (d x +c \right )}-196 \,{\mathrm e}^{6 i \left (d x +c \right )}-1882 \,{\mathrm e}^{5 i \left (d x +c \right )}+880 \,{\mathrm e}^{4 i \left (d x +c \right )}+1025 \,{\mathrm e}^{3 i \left (d x +c \right )}-494 \,{\mathrm e}^{2 i \left (d x +c \right )}-247 \,{\mathrm e}^{i \left (d x +c \right )}+176\right )}{105 d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )^{7} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{5}}\) \(150\)
derivativedivides \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{8}}{7 \sin \left (d x +c \right )^{7}}+\frac {\cos \left (d x +c \right )^{8}}{35 \sin \left (d x +c \right )^{5}}-\frac {\cos \left (d x +c \right )^{8}}{35 \sin \left (d x +c \right )^{3}}+\frac {\cos \left (d x +c \right )^{8}}{7 \sin \left (d x +c \right )}+\frac {\left (\frac {16}{5}+\cos \left (d x +c \right )^{6}+\frac {6 \cos \left (d x +c \right )^{4}}{5}+\frac {8 \cos \left (d x +c \right )^{2}}{5}\right ) \sin \left (d x +c \right )}{7}\right )+a \left (-\frac {\cot \left (d x +c \right )^{7}}{7}+\frac {\cot \left (d x +c \right )^{5}}{5}-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(162\)
default \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{8}}{7 \sin \left (d x +c \right )^{7}}+\frac {\cos \left (d x +c \right )^{8}}{35 \sin \left (d x +c \right )^{5}}-\frac {\cos \left (d x +c \right )^{8}}{35 \sin \left (d x +c \right )^{3}}+\frac {\cos \left (d x +c \right )^{8}}{7 \sin \left (d x +c \right )}+\frac {\left (\frac {16}{5}+\cos \left (d x +c \right )^{6}+\frac {6 \cos \left (d x +c \right )^{4}}{5}+\frac {8 \cos \left (d x +c \right )^{2}}{5}\right ) \sin \left (d x +c \right )}{7}\right )+a \left (-\frac {\cot \left (d x +c \right )^{7}}{7}+\frac {\cot \left (d x +c \right )^{5}}{5}-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(162\)

Input:

int(cot(d*x+c)^8*(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)
 

Output:

a*x+2/105*I*a*(105*exp(11*I*(d*x+c))+210*exp(10*I*(d*x+c))-735*exp(9*I*(d* 
x+c))+1638*exp(7*I*(d*x+c))-196*exp(6*I*(d*x+c))-1882*exp(5*I*(d*x+c))+880 
*exp(4*I*(d*x+c))+1025*exp(3*I*(d*x+c))-494*exp(2*I*(d*x+c))-247*exp(I*(d* 
x+c))+176)/d/(exp(I*(d*x+c))-1)^7/(exp(I*(d*x+c))+1)^5
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (103) = 206\).

Time = 0.08 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.89 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=\frac {176 \, a \cos \left (d x + c\right )^{6} - 71 \, a \cos \left (d x + c\right )^{5} - 335 \, a \cos \left (d x + c\right )^{4} + 125 \, a \cos \left (d x + c\right )^{3} + 225 \, a \cos \left (d x + c\right )^{2} - 57 \, a \cos \left (d x + c\right ) + 105 \, {\left (a d x \cos \left (d x + c\right )^{5} - a d x \cos \left (d x + c\right )^{4} - 2 \, a d x \cos \left (d x + c\right )^{3} + 2 \, a d x \cos \left (d x + c\right )^{2} + a d x \cos \left (d x + c\right ) - a d x\right )} \sin \left (d x + c\right ) - 48 \, a}{105 \, {\left (d \cos \left (d x + c\right )^{5} - d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{3} + 2 \, d \cos \left (d x + c\right )^{2} + d \cos \left (d x + c\right ) - d\right )} \sin \left (d x + c\right )} \] Input:

integrate(cot(d*x+c)^8*(a+a*sec(d*x+c)),x, algorithm="fricas")
 

Output:

1/105*(176*a*cos(d*x + c)^6 - 71*a*cos(d*x + c)^5 - 335*a*cos(d*x + c)^4 + 
 125*a*cos(d*x + c)^3 + 225*a*cos(d*x + c)^2 - 57*a*cos(d*x + c) + 105*(a* 
d*x*cos(d*x + c)^5 - a*d*x*cos(d*x + c)^4 - 2*a*d*x*cos(d*x + c)^3 + 2*a*d 
*x*cos(d*x + c)^2 + a*d*x*cos(d*x + c) - a*d*x)*sin(d*x + c) - 48*a)/((d*c 
os(d*x + c)^5 - d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^3 + 2*d*cos(d*x + c)^2 
 + d*cos(d*x + c) - d)*sin(d*x + c))
 

Sympy [F]

\[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=a \left (\int \cot ^{8}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \cot ^{8}{\left (c + d x \right )}\, dx\right ) \] Input:

integrate(cot(d*x+c)**8*(a+a*sec(d*x+c)),x)
 

Output:

a*(Integral(cot(c + d*x)**8*sec(c + d*x), x) + Integral(cot(c + d*x)**8, x 
))
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.90 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=\frac {{\left (105 \, d x + 105 \, c + \frac {105 \, \tan \left (d x + c\right )^{6} - 35 \, \tan \left (d x + c\right )^{4} + 21 \, \tan \left (d x + c\right )^{2} - 15}{\tan \left (d x + c\right )^{7}}\right )} a + \frac {3 \, {\left (35 \, \sin \left (d x + c\right )^{6} - 35 \, \sin \left (d x + c\right )^{4} + 21 \, \sin \left (d x + c\right )^{2} - 5\right )} a}{\sin \left (d x + c\right )^{7}}}{105 \, d} \] Input:

integrate(cot(d*x+c)^8*(a+a*sec(d*x+c)),x, algorithm="maxima")
 

Output:

1/105*((105*d*x + 105*c + (105*tan(d*x + c)^6 - 35*tan(d*x + c)^4 + 21*tan 
(d*x + c)^2 - 15)/tan(d*x + c)^7)*a + 3*(35*sin(d*x + c)^6 - 35*sin(d*x + 
c)^4 + 21*sin(d*x + c)^2 - 5)*a/sin(d*x + c)^7)/d
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.02 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=-\frac {21 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 280 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6720 \, {\left (d x + c\right )} a + 3045 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {6720 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 1015 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 168 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{6720 \, d} \] Input:

integrate(cot(d*x+c)^8*(a+a*sec(d*x+c)),x, algorithm="giac")
 

Output:

-1/6720*(21*a*tan(1/2*d*x + 1/2*c)^5 - 280*a*tan(1/2*d*x + 1/2*c)^3 - 6720 
*(d*x + c)*a + 3045*a*tan(1/2*d*x + 1/2*c) - (6720*a*tan(1/2*d*x + 1/2*c)^ 
6 - 1015*a*tan(1/2*d*x + 1/2*c)^4 + 168*a*tan(1/2*d*x + 1/2*c)^2 - 15*a)/t 
an(1/2*d*x + 1/2*c)^7)/d
 

Mupad [B] (verification not implemented)

Time = 12.73 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.84 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=-\frac {a\,\left (15\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+21\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-280\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+3045\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-6720\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+1015\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-168\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-6720\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (c+d\,x\right )\right )}{6720\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7} \] Input:

int(cot(c + d*x)^8*(a + a/cos(c + d*x)),x)
 

Output:

-(a*(15*cos(c/2 + (d*x)/2)^12 + 21*sin(c/2 + (d*x)/2)^12 - 280*cos(c/2 + ( 
d*x)/2)^2*sin(c/2 + (d*x)/2)^10 + 3045*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d*x 
)/2)^8 - 6720*cos(c/2 + (d*x)/2)^6*sin(c/2 + (d*x)/2)^6 + 1015*cos(c/2 + ( 
d*x)/2)^8*sin(c/2 + (d*x)/2)^4 - 168*cos(c/2 + (d*x)/2)^10*sin(c/2 + (d*x) 
/2)^2 - 6720*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2)^7*(c + d*x)))/(6720*d 
*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2)^7)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.01 \[ \int \cot ^8(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \left (-21 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+280 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}-3045 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+6720 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} d x +6720 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-1015 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+168 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-15\right )}{6720 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7} d} \] Input:

int(cot(d*x+c)^8*(a+a*sec(d*x+c)),x)
 

Output:

(a*( - 21*tan((c + d*x)/2)**12 + 280*tan((c + d*x)/2)**10 - 3045*tan((c + 
d*x)/2)**8 + 6720*tan((c + d*x)/2)**7*d*x + 6720*tan((c + d*x)/2)**6 - 101 
5*tan((c + d*x)/2)**4 + 168*tan((c + d*x)/2)**2 - 15))/(6720*tan((c + d*x) 
/2)**7*d)