\(\int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx\) [35]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (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 = 86 \[ \int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx=-\frac {a^3 \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}-\frac {b^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec (c+d x) \tan (c+d x)}{2 d} \] Output:

-a^3*arctanh(cos(d*x+c))/d+3*a^2*b*arctanh(sin(d*x+c))/d-1/2*b^3*arctanh(s 
in(d*x+c))/d+3*a*b^2*sec(d*x+c)/d+1/2*b^3*sec(d*x+c)*tan(d*x+c)/d
 

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00 \[ \int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {3 a^2 b \coth ^{-1}(\sin (c+d x))}{d}-\frac {a^3 \text {arctanh}(\cos (c+d x))}{d}-\frac {b^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec (c+d x) \tan (c+d x)}{2 d} \] Input:

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

Output:

(3*a^2*b*ArcCoth[Sin[c + d*x]])/d - (a^3*ArcTanh[Cos[c + d*x]])/d - (b^3*A 
rcTanh[Sin[c + d*x]])/(2*d) + (3*a*b^2*Sec[c + d*x])/d + (b^3*Sec[c + d*x] 
*Tan[c + d*x])/(2*d)
 

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 4000, 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 (c+d x) (a+b \tan (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4000

\(\displaystyle \int \left (a^3 \csc (c+d x)+3 a^2 b \sec (c+d x)+3 a b^2 \tan (c+d x) \sec (c+d x)+b^3 \tan ^2(c+d x) \sec (c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {a^3 \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^2 b \text {arctanh}(\sin (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x)}{d}-\frac {b^3 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {b^3 \tan (c+d x) \sec (c+d x)}{2 d}\)

Input:

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

Output:

-((a^3*ArcTanh[Cos[c + d*x]])/d) + (3*a^2*b*ArcTanh[Sin[c + d*x]])/d - (b^ 
3*ArcTanh[Sin[c + d*x]])/(2*d) + (3*a*b^2*Sec[c + d*x])/d + (b^3*Sec[c + d 
*x]*Tan[c + d*x])/(2*d)
 

Defintions of rubi rules used

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 4000
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n 
_.), x_Symbol] :> Int[Expand[Sin[e + f*x]^m*(a + b*Tan[e + f*x])^n, x], x] 
/; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IGtQ[n, 0]
 
Maple [A] (verified)

Time = 0.88 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.24

method result size
derivativedivides \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {3 a \,b^{2}}{\cos \left (d x +c \right )}+3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) \(107\)
default \(\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {3 a \,b^{2}}{\cos \left (d x +c \right )}+3 a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) \(107\)
risch \(-\frac {i b^{2} {\mathrm e}^{i \left (d x +c \right )} \left (6 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+b \,{\mathrm e}^{2 i \left (d x +c \right )}+6 i a -b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}\) \(196\)

Input:

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

Output:

1/d*(b^3*(1/2*sin(d*x+c)^3/cos(d*x+c)^2+1/2*sin(d*x+c)-1/2*ln(sec(d*x+c)+t 
an(d*x+c)))+3*a*b^2/cos(d*x+c)+3*a^2*b*ln(sec(d*x+c)+tan(d*x+c))+a^3*ln(cs 
c(d*x+c)-cot(d*x+c)))
 

Fricas [A] (verification not implemented)

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

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

Output:

-1/4*(2*a^3*cos(d*x + c)^2*log(1/2*cos(d*x + c) + 1/2) - 2*a^3*cos(d*x + c 
)^2*log(-1/2*cos(d*x + c) + 1/2) - 12*a*b^2*cos(d*x + c) - (6*a^2*b - b^3) 
*cos(d*x + c)^2*log(sin(d*x + c) + 1) + (6*a^2*b - b^3)*cos(d*x + c)^2*log 
(-sin(d*x + c) + 1) - 2*b^3*sin(d*x + c))/(d*cos(d*x + c)^2)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.29 \[ \int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx=-\frac {b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{3} \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right ) - \frac {12 \, a b^{2}}{\cos \left (d x + c\right )}}{4 \, d} \] Input:

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

Output:

-1/4*(b^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - l 
og(sin(d*x + c) - 1)) - 6*a^2*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) 
- 1)) + 4*a^3*log(cot(d*x + c) + csc(d*x + c)) - 12*a*b^2/cos(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.67 \[ \int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {2 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \] Input:

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

Output:

1/2*(2*a^3*log(abs(tan(1/2*d*x + 1/2*c))) + (6*a^2*b - b^3)*log(abs(tan(1/ 
2*d*x + 1/2*c) + 1)) - (6*a^2*b - b^3)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) 
+ 2*(b^3*tan(1/2*d*x + 1/2*c)^3 - 6*a*b^2*tan(1/2*d*x + 1/2*c)^2 + b^3*tan 
(1/2*d*x + 1/2*c) + 6*a*b^2)/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
 

Mupad [B] (verification not implemented)

Time = 1.33 (sec) , antiderivative size = 278, normalized size of antiderivative = 3.23 \[ \int \csc (c+d x) (a+b \tan (c+d x))^3 \, dx=\frac {2\,\left (\frac {a^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}-\frac {b^3\,\mathrm {atan}\left (\frac {2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{2{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )\,1{}\mathrm {i}}{2}+a^2\,b\,\mathrm {atan}\left (\frac {2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{2{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3-6{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b+1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )\,3{}\mathrm {i}\right )}{d}+\frac {\frac {\sin \left (c+d\,x\right )\,b^3}{2}+3\,a\,\cos \left (c+d\,x\right )\,b^2}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )} \] Input:

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

Output:

(2*((a^3*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 - (b^3*atan((b^3*co 
s(c/2 + (d*x)/2) + 2*a^3*sin(c/2 + (d*x)/2) - 6*a^2*b*cos(c/2 + (d*x)/2))/ 
(a^3*cos(c/2 + (d*x)/2)*2i + b^3*sin(c/2 + (d*x)/2)*1i - a^2*b*sin(c/2 + ( 
d*x)/2)*6i))*1i)/2 + a^2*b*atan((b^3*cos(c/2 + (d*x)/2) + 2*a^3*sin(c/2 + 
(d*x)/2) - 6*a^2*b*cos(c/2 + (d*x)/2))/(a^3*cos(c/2 + (d*x)/2)*2i + b^3*si 
n(c/2 + (d*x)/2)*1i - a^2*b*sin(c/2 + (d*x)/2)*6i))*3i))/d + ((b^3*sin(c + 
 d*x))/2 + 3*a*b^2*cos(c + d*x))/(d*(cos(2*c + 2*d*x)/2 + 1/2))
 

Reduce [B] (verification not implemented)

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

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

Output:

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