\(\int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx\) [98]

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

Optimal result

Integrand size = 21, antiderivative size = 66 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=-\frac {x}{a^3}+\frac {7 \text {arctanh}(\sin (c+d x))}{2 a^3 d}-\frac {5 \tan (c+d x)}{2 a^3 d}-\frac {(1-\sec (c+d x)) \tan (c+d x)}{2 a^3 d} \] Output:

-x/a^3+7/2*arctanh(sin(d*x+c))/a^3/d-5/2*tan(d*x+c)/a^3/d-1/2*(1-sec(d*x+c 
))*tan(d*x+c)/a^3/d
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(241\) vs. \(2(66)=132\).

Time = 1.51 (sec) , antiderivative size = 241, normalized size of antiderivative = 3.65 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {2 \cos ^6\left (\frac {1}{2} (c+d x)\right ) \sec ^3(c+d x) \left (-4 x-\frac {14 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {14 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {12 \sin (d x)}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{a^3 (1+\sec (c+d x))^3} \] Input:

Integrate[Tan[c + d*x]^6/(a + a*Sec[c + d*x])^3,x]
 

Output:

(2*Cos[(c + d*x)/2]^6*Sec[c + d*x]^3*(-4*x - (14*Log[Cos[(c + d*x)/2] - Si 
n[(c + d*x)/2]])/d + (14*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/d + 1/( 
d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2) - 1/(d*(Cos[(c + d*x)/2] + Sin[ 
(c + d*x)/2])^2) - (12*Sin[d*x])/(d*(Cos[c/2] - Sin[c/2])*(Cos[c/2] + Sin[ 
c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d 
*x)/2]))))/(a^3*(1 + Sec[c + d*x])^3)
 

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.12, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {3042, 4376, 3042, 4262, 3042, 4402, 3042, 4254, 24, 4257}

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 \frac {\tan ^6(c+d x)}{(a \sec (c+d x)+a)^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4376

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4262

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4402

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4254

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

\(\Big \downarrow \) 24

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

\(\Big \downarrow \) 4257

\(\displaystyle \frac {-\frac {\tan (c+d x) \left (a^3-a^3 \sec (c+d x)\right )}{2 d}-\frac {1}{2} a \left (-\frac {7 a^2 \text {arctanh}(\sin (c+d x))}{d}+\frac {5 a^2 \tan (c+d x)}{d}+2 a^2 x\right )}{a^6}\)

Input:

Int[Tan[c + d*x]^6/(a + a*Sec[c + d*x])^3,x]
 

Output:

(-1/2*((a^3 - a^3*Sec[c + d*x])*Tan[c + d*x])/d - (a*(2*a^2*x - (7*a^2*Arc 
Tanh[Sin[c + d*x]])/d + (5*a^2*Tan[c + d*x])/d))/2)/a^6
 

Defintions of rubi rules used

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

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

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4262
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*C 
ot[c + d*x]*((a + b*Csc[c + d*x])^(n - 2)/(d*(n - 1))), x] + Simp[a/(n - 1) 
   Int[(a + b*Csc[c + d*x])^(n - 2)*(a*(n - 1) + b*(3*n - 4)*Csc[c + d*x]), 
 x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && GtQ[n, 1] && Inte 
gerQ[2*n]
 

rule 4376
Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + ( 
a_))^(n_), x_Symbol] :> Simp[a^(2*n)/e^(2*n)   Int[(e*Cot[c + d*x])^(m + 2* 
n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[a 
^2 - b^2, 0] && ILtQ[n, 0]
 

rule 4402
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + 
 (c_)), x_Symbol] :> Simp[a*c*x, x] + (Simp[b*d   Int[Csc[e + f*x]^2, x], x 
] + Simp[(b*c + a*d)   Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f 
}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.72 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.59

method result size
risch \(-\frac {x}{a^{3}}-\frac {i \left ({\mathrm e}^{3 i \left (d x +c \right )}+6 \,{\mathrm e}^{2 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}+6\right )}{d \,a^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {7 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d \,a^{3}}+\frac {7 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d \,a^{3}}\) \(105\)
derivativedivides \(\frac {\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {7 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {7 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d \,a^{3}}\) \(110\)
default \(\frac {\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}-\frac {7 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2}-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {1}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {7}{2 \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {7 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2}}{d \,a^{3}}\) \(110\)

Input:

int(tan(d*x+c)^6/(a+a*sec(d*x+c))^3,x,method=_RETURNVERBOSE)
 

Output:

-x/a^3-I*(exp(3*I*(d*x+c))+6*exp(2*I*(d*x+c))-exp(I*(d*x+c))+6)/d/a^3/(exp 
(2*I*(d*x+c))+1)^2-7/2/d/a^3*ln(exp(I*(d*x+c))-I)+7/2/d/a^3*ln(exp(I*(d*x+ 
c))+I)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.32 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=-\frac {4 \, d x \cos \left (d x + c\right )^{2} - 7 \, \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) + 7 \, \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, \cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}{4 \, a^{3} d \cos \left (d x + c\right )^{2}} \] Input:

integrate(tan(d*x+c)^6/(a+a*sec(d*x+c))^3,x, algorithm="fricas")
 

Output:

-1/4*(4*d*x*cos(d*x + c)^2 - 7*cos(d*x + c)^2*log(sin(d*x + c) + 1) + 7*co 
s(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*(6*cos(d*x + c) - 1)*sin(d*x + c)) 
/(a^3*d*cos(d*x + c)^2)
 

Sympy [F]

\[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {\int \frac {\tan ^{6}{\left (c + d x \right )}}{\sec ^{3}{\left (c + d x \right )} + 3 \sec ^{2}{\left (c + d x \right )} + 3 \sec {\left (c + d x \right )} + 1}\, dx}{a^{3}} \] Input:

integrate(tan(d*x+c)**6/(a+a*sec(d*x+c))**3,x)
 

Output:

Integral(tan(c + d*x)**6/(sec(c + d*x)**3 + 3*sec(c + d*x)**2 + 3*sec(c + 
d*x) + 1), x)/a**3
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 171 vs. \(2 (58) = 116\).

Time = 0.11 (sec) , antiderivative size = 171, normalized size of antiderivative = 2.59 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {7 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{3} - \frac {2 \, a^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {4 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{3}} - \frac {7 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{3}} + \frac {7 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{3}}}{2 \, d} \] Input:

integrate(tan(d*x+c)^6/(a+a*sec(d*x+c))^3,x, algorithm="maxima")
 

Output:

-1/2*(2*(5*sin(d*x + c)/(cos(d*x + c) + 1) - 7*sin(d*x + c)^3/(cos(d*x + c 
) + 1)^3)/(a^3 - 2*a^3*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + a^3*sin(d*x + 
 c)^4/(cos(d*x + c) + 1)^4) + 4*arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^ 
3 - 7*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a^3 + 7*log(sin(d*x + c)/(c 
os(d*x + c) + 1) - 1)/a^3)/d
 

Giac [A] (verification not implemented)

Time = 0.42 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.47 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=-\frac {\frac {2 \, {\left (d x + c\right )}}{a^{3}} - \frac {7 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{3}} + \frac {7 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{3}} - \frac {2 \, {\left (7 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{3}}}{2 \, d} \] Input:

integrate(tan(d*x+c)^6/(a+a*sec(d*x+c))^3,x, algorithm="giac")
 

Output:

-1/2*(2*(d*x + c)/a^3 - 7*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a^3 + 7*log(a 
bs(tan(1/2*d*x + 1/2*c) - 1))/a^3 - 2*(7*tan(1/2*d*x + 1/2*c)^3 - 5*tan(1/ 
2*d*x + 1/2*c))/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*a^3))/d
 

Mupad [B] (verification not implemented)

Time = 12.60 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.39 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {7\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^3\,d}-\frac {x}{a^3}-\frac {5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{d\,\left (a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a^3\right )} \] Input:

int(tan(c + d*x)^6/(a + a/cos(c + d*x))^3,x)
 

Output:

(7*atanh(tan(c/2 + (d*x)/2)))/(a^3*d) - x/a^3 - (5*tan(c/2 + (d*x)/2) - 7* 
tan(c/2 + (d*x)/2)^3)/(d*(a^3*tan(c/2 + (d*x)/2)^4 - 2*a^3*tan(c/2 + (d*x) 
/2)^2 + a^3))
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.98 \[ \int \frac {\tan ^6(c+d x)}{(a+a \sec (c+d x))^3} \, dx=\frac {6 \cos \left (d x +c \right ) \sin \left (d x +c \right )-7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{2}+7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{2}-7 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-2 \sin \left (d x +c \right )^{2} d x -\sin \left (d x +c \right )+2 d x}{2 a^{3} d \left (\sin \left (d x +c \right )^{2}-1\right )} \] Input:

int(tan(d*x+c)^6/(a+a*sec(d*x+c))^3,x)
 

Output:

(6*cos(c + d*x)*sin(c + d*x) - 7*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**2 
 + 7*log(tan((c + d*x)/2) - 1) + 7*log(tan((c + d*x)/2) + 1)*sin(c + d*x)* 
*2 - 7*log(tan((c + d*x)/2) + 1) - 2*sin(c + d*x)**2*d*x - sin(c + d*x) + 
2*d*x)/(2*a**3*d*(sin(c + d*x)**2 - 1))