\(\int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx\) [31]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (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 = 21, antiderivative size = 122 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {\left (a^2+2 b^2\right ) \cot (c+d x)}{d}-\frac {2 a b \cot ^2(c+d x)}{d}-\frac {\left (2 a^2+b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {a b \cot ^4(c+d x)}{2 d}-\frac {a^2 \cot ^5(c+d x)}{5 d}+\frac {2 a b \log (\tan (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d} \] Output:

-(a^2+2*b^2)*cot(d*x+c)/d-2*a*b*cot(d*x+c)^2/d-1/3*(2*a^2+b^2)*cot(d*x+c)^ 
3/d-1/2*a*b*cot(d*x+c)^4/d-1/5*a^2*cot(d*x+c)^5/d+2*a*b*ln(tan(d*x+c))/d+b 
^2*tan(d*x+c)/d
 

Mathematica [A] (verified)

Time = 1.75 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.93 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {2 \cot (c+d x) \left (8 a^2+25 b^2+\left (4 a^2+5 b^2\right ) \csc ^2(c+d x)+3 a^2 \csc ^4(c+d x)\right )+15 b \left (2 a \csc ^2(c+d x)+a \csc ^4(c+d x)+4 a \log (\cos (c+d x))-4 a \log (\sin (c+d x))-2 b \tan (c+d x)\right )}{30 d} \] Input:

Integrate[Csc[c + d*x]^6*(a + b*Tan[c + d*x])^2,x]
 

Output:

-1/30*(2*Cot[c + d*x]*(8*a^2 + 25*b^2 + (4*a^2 + 5*b^2)*Csc[c + d*x]^2 + 3 
*a^2*Csc[c + d*x]^4) + 15*b*(2*a*Csc[c + d*x]^2 + a*Csc[c + d*x]^4 + 4*a*L 
og[Cos[c + d*x]] - 4*a*Log[Sin[c + d*x]] - 2*b*Tan[c + d*x]))/d
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.92, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3999, 522, 2009}

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 \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a+b \tan (c+d x))^2}{\sin (c+d x)^6}dx\)

\(\Big \downarrow \) 3999

\(\displaystyle \frac {b \int \frac {\cot ^6(c+d x) (a+b \tan (c+d x))^2 \left (\tan ^2(c+d x) b^2+b^2\right )^2}{b^6}d(b \tan (c+d x))}{d}\)

\(\Big \downarrow \) 522

\(\displaystyle \frac {b \int \left (\frac {a^2 \cot ^6(c+d x)}{b^2}+\frac {2 a \cot ^5(c+d x)}{b}+\frac {\left (b^4+2 a^2 b^2\right ) \cot ^4(c+d x)}{b^4}+\frac {4 a \cot ^3(c+d x)}{b}+\frac {\left (a^2+2 b^2\right ) \cot ^2(c+d x)}{b^2}+\frac {2 a \cot (c+d x)}{b}+1\right )d(b \tan (c+d x))}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b \left (-\frac {\left (2 a^2+b^2\right ) \cot ^3(c+d x)}{3 b}-\frac {\left (a^2+2 b^2\right ) \cot (c+d x)}{b}-\frac {a^2 \cot ^5(c+d x)}{5 b}+2 a \log (b \tan (c+d x))-\frac {1}{2} a \cot ^4(c+d x)-2 a \cot ^2(c+d x)+b \tan (c+d x)\right )}{d}\)

Input:

Int[Csc[c + d*x]^6*(a + b*Tan[c + d*x])^2,x]
 

Output:

(b*(-(((a^2 + 2*b^2)*Cot[c + d*x])/b) - 2*a*Cot[c + d*x]^2 - ((2*a^2 + b^2 
)*Cot[c + d*x]^3)/(3*b) - (a*Cot[c + d*x]^4)/2 - (a^2*Cot[c + d*x]^5)/(5*b 
) + 2*a*Log[b*Tan[c + d*x]] + b*Tan[c + d*x]))/d
 

Defintions of rubi rules used

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 0]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 3999
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[b/f   Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), 
 x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
 
Maple [A] (verified)

Time = 17.30 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {b^{2} \left (-\frac {1}{3 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+2 a b \left (-\frac {1}{4 \sin \left (d x +c \right )^{4}}-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )}{d}\) \(119\)
default \(\frac {b^{2} \left (-\frac {1}{3 \sin \left (d x +c \right )^{3} \cos \left (d x +c \right )}+\frac {4}{3 \sin \left (d x +c \right ) \cos \left (d x +c \right )}-\frac {8 \cot \left (d x +c \right )}{3}\right )+2 a b \left (-\frac {1}{4 \sin \left (d x +c \right )^{4}}-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a^{2} \left (-\frac {8}{15}-\frac {\csc \left (d x +c \right )^{4}}{5}-\frac {4 \csc \left (d x +c \right )^{2}}{15}\right ) \cot \left (d x +c \right )}{d}\) \(119\)
risch \(\frac {4 a b \,{\mathrm e}^{10 i \left (d x +c \right )}-16 a b \,{\mathrm e}^{8 i \left (d x +c \right )}-\frac {32 i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{3}+\frac {32 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{3}-\frac {16 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}}{3}-\frac {80 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}}{3}+16 a b \,{\mathrm e}^{4 i \left (d x +c \right )}+\frac {64 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{15}+\frac {64 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{3}-4 a b \,{\mathrm e}^{2 i \left (d x +c \right )}-\frac {16 i a^{2}}{15}-\frac {16 i b^{2}}{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(226\)

Input:

int(csc(d*x+c)^6*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

1/d*(b^2*(-1/3/sin(d*x+c)^3/cos(d*x+c)+4/3/sin(d*x+c)/cos(d*x+c)-8/3*cot(d 
*x+c))+2*a*b*(-1/4/sin(d*x+c)^4-1/2/sin(d*x+c)^2+ln(tan(d*x+c)))+a^2*(-8/1 
5-1/5*csc(d*x+c)^4-4/15*csc(d*x+c)^2)*cot(d*x+c))
 

Fricas [B] (verification not implemented)

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

Time = 0.10 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.97 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {16 \, {\left (a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 40 \, {\left (a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 30 \, {\left (a^{2} + 5 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 30 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 30 \, {\left (a b \cos \left (d x + c\right )^{5} - 2 \, a b \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) - 30 \, b^{2} - 15 \, {\left (2 \, a b \cos \left (d x + c\right )^{3} - 3 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{30 \, {\left (d \cos \left (d x + c\right )^{5} - 2 \, d \cos \left (d x + c\right )^{3} + d \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )} \] Input:

integrate(csc(d*x+c)^6*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
 

Output:

-1/30*(16*(a^2 + 5*b^2)*cos(d*x + c)^6 - 40*(a^2 + 5*b^2)*cos(d*x + c)^4 + 
 30*(a^2 + 5*b^2)*cos(d*x + c)^2 + 30*(a*b*cos(d*x + c)^5 - 2*a*b*cos(d*x 
+ c)^3 + a*b*cos(d*x + c))*log(cos(d*x + c)^2)*sin(d*x + c) - 30*(a*b*cos( 
d*x + c)^5 - 2*a*b*cos(d*x + c)^3 + a*b*cos(d*x + c))*log(-1/4*cos(d*x + c 
)^2 + 1/4)*sin(d*x + c) - 30*b^2 - 15*(2*a*b*cos(d*x + c)^3 - 3*a*b*cos(d* 
x + c))*sin(d*x + c))/((d*cos(d*x + c)^5 - 2*d*cos(d*x + c)^3 + d*cos(d*x 
+ c))*sin(d*x + c))
 

Sympy [F]

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

integrate(csc(d*x+c)**6*(a+b*tan(d*x+c))**2,x)
 

Output:

Integral((a + b*tan(c + d*x))**2*csc(c + d*x)**6, x)
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.85 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {60 \, a b \log \left (\tan \left (d x + c\right )\right ) + 30 \, b^{2} \tan \left (d x + c\right ) - \frac {60 \, a b \tan \left (d x + c\right )^{3} + 30 \, {\left (a^{2} + 2 \, b^{2}\right )} \tan \left (d x + c\right )^{4} + 15 \, a b \tan \left (d x + c\right ) + 10 \, {\left (2 \, a^{2} + b^{2}\right )} \tan \left (d x + c\right )^{2} + 6 \, a^{2}}{\tan \left (d x + c\right )^{5}}}{30 \, d} \] Input:

integrate(csc(d*x+c)^6*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
 

Output:

1/30*(60*a*b*log(tan(d*x + c)) + 30*b^2*tan(d*x + c) - (60*a*b*tan(d*x + c 
)^3 + 30*(a^2 + 2*b^2)*tan(d*x + c)^4 + 15*a*b*tan(d*x + c) + 10*(2*a^2 + 
b^2)*tan(d*x + c)^2 + 6*a^2)/tan(d*x + c)^5)/d
 

Giac [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.86 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {60 \, a b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 30 \, b^{2} \tan \left (d x + c\right ) - \frac {60 \, a b \tan \left (d x + c\right )^{3} + 30 \, {\left (a^{2} + 2 \, b^{2}\right )} \tan \left (d x + c\right )^{4} + 15 \, a b \tan \left (d x + c\right ) + 10 \, {\left (2 \, a^{2} + b^{2}\right )} \tan \left (d x + c\right )^{2} + 6 \, a^{2}}{\tan \left (d x + c\right )^{5}}}{30 \, d} \] Input:

integrate(csc(d*x+c)^6*(a+b*tan(d*x+c))^2,x, algorithm="giac")
 

Output:

1/30*(60*a*b*log(abs(tan(d*x + c))) + 30*b^2*tan(d*x + c) - (60*a*b*tan(d* 
x + c)^3 + 30*(a^2 + 2*b^2)*tan(d*x + c)^4 + 15*a*b*tan(d*x + c) + 10*(2*a 
^2 + b^2)*tan(d*x + c)^2 + 6*a^2)/tan(d*x + c)^5)/d
 

Mupad [B] (verification not implemented)

Time = 1.11 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.88 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (a^2+2\,b^2\right )+\frac {a^2}{5}+{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {2\,a^2}{3}+\frac {b^2}{3}\right )+\frac {a\,b\,\mathrm {tan}\left (c+d\,x\right )}{2}+2\,a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^3}{d\,{\mathrm {tan}\left (c+d\,x\right )}^5}+\frac {2\,a\,b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d} \] Input:

int((a + b*tan(c + d*x))^2/sin(c + d*x)^6,x)
 

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 245, normalized size of antiderivative = 2.01 \[ \int \csc ^6(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {-480 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \sin \left (d x +c \right )^{5} a b -480 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) \sin \left (d x +c \right )^{5} a b +480 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{5} a b +75 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5} a b -240 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a b -120 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b +128 \sin \left (d x +c \right )^{6} a^{2}+640 \sin \left (d x +c \right )^{6} b^{2}-64 \sin \left (d x +c \right )^{4} a^{2}-320 \sin \left (d x +c \right )^{4} b^{2}-16 \sin \left (d x +c \right )^{2} a^{2}-80 \sin \left (d x +c \right )^{2} b^{2}-48 a^{2}}{240 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5} d} \] Input:

int(csc(d*x+c)^6*(a+b*tan(d*x+c))^2,x)
 

Output:

( - 480*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*sin(c + d*x)**5*a*b - 480*c 
os(c + d*x)*log(tan((c + d*x)/2) + 1)*sin(c + d*x)**5*a*b + 480*cos(c + d* 
x)*log(tan((c + d*x)/2))*sin(c + d*x)**5*a*b + 75*cos(c + d*x)*sin(c + d*x 
)**5*a*b - 240*cos(c + d*x)*sin(c + d*x)**3*a*b - 120*cos(c + d*x)*sin(c + 
 d*x)*a*b + 128*sin(c + d*x)**6*a**2 + 640*sin(c + d*x)**6*b**2 - 64*sin(c 
 + d*x)**4*a**2 - 320*sin(c + d*x)**4*b**2 - 16*sin(c + d*x)**2*a**2 - 80* 
sin(c + d*x)**2*b**2 - 48*a**2)/(240*cos(c + d*x)*sin(c + d*x)**5*d)