\(\int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx\) [54]

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

Optimal result

Integrand size = 24, antiderivative size = 90 \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {3 i x}{2 a}+\frac {3 i \cot (c+d x)}{2 a d}-\frac {\cot ^2(c+d x)}{a d}-\frac {2 \log (\sin (c+d x))}{a d}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))} \] Output:

3/2*I*x/a+3/2*I*cot(d*x+c)/a/d-cot(d*x+c)^2/a/d-2*ln(sin(d*x+c))/a/d+1/2*c 
ot(d*x+c)^2/d/(a+I*a*tan(d*x+c))
 

Mathematica [C] (verified)

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

Time = 0.64 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.99 \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {\frac {3 i \cot (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\tan ^2(c+d x)\right )}{a}-\frac {4 (\log (\cos (c+d x))+\log (\tan (c+d x)))}{a}+\cot ^2(c+d x) \left (-\frac {2}{a}+\frac {1}{a+i a \tan (c+d x)}\right )}{2 d} \] Input:

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

Output:

(((3*I)*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2])/a - 
 (4*(Log[Cos[c + d*x]] + Log[Tan[c + d*x]]))/a + Cot[c + d*x]^2*(-2/a + (a 
 + I*a*Tan[c + d*x])^(-1)))/(2*d)
 

Rubi [A] (verified)

Time = 0.63 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.98, number of steps used = 13, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.542, Rules used = {3042, 4035, 25, 3042, 4012, 25, 3042, 4012, 3042, 4014, 3042, 25, 3956}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4035

\(\displaystyle \frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}-\frac {\int -\cot ^3(c+d x) (4 a-3 i a \tan (c+d x))dx}{2 a^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \cot ^3(c+d x) (4 a-3 i a \tan (c+d x))dx}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {4 a-3 i a \tan (c+d x)}{\tan (c+d x)^3}dx}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 4012

\(\displaystyle \frac {-\frac {2 a \cot ^2(c+d x)}{d}+\int -\cot ^2(c+d x) (4 \tan (c+d x) a+3 i a)dx}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {-\frac {2 a \cot ^2(c+d x)}{d}-\int \cot ^2(c+d x) (4 \tan (c+d x) a+3 i a)dx}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {2 a \cot ^2(c+d x)}{d}-\int \frac {4 \tan (c+d x) a+3 i a}{\tan (c+d x)^2}dx}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 4012

\(\displaystyle \frac {-\int \cot (c+d x) (4 a-3 i a \tan (c+d x))dx-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\int \frac {4 a-3 i a \tan (c+d x)}{\tan (c+d x)}dx-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 4014

\(\displaystyle \frac {-4 a \int \cot (c+d x)dx-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}+3 i a x}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-4 a \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}+3 i a x}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {4 a \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}+3 i a x}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

\(\Big \downarrow \) 3956

\(\displaystyle \frac {-\frac {2 a \cot ^2(c+d x)}{d}+\frac {3 i a \cot (c+d x)}{d}-\frac {4 a \log (-\sin (c+d x))}{d}+3 i a x}{2 a^2}+\frac {\cot ^2(c+d x)}{2 d (a+i a \tan (c+d x))}\)

Input:

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

Output:

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

Defintions of rubi rules used

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

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

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 4012
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[(b*c - a*d)*((a + b*Tan[e + f*x])^(m + 1)/ 
(f*(m + 1)*(a^2 + b^2))), x] + Simp[1/(a^2 + b^2)   Int[(a + b*Tan[e + f*x] 
)^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a 
, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1 
]
 

rule 4014
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a 
*d)/(a^2 + b^2)   Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; 
FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N 
eQ[a*c + b*d, 0]
 

rule 4035
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[(-a)*((c + d*Tan[e + f*x])^(n + 1)/(2*f*(b* 
c - a*d)*(a + b*Tan[e + f*x]))), x] + Simp[1/(2*a*(b*c - a*d))   Int[(c + d 
*Tan[e + f*x])^n*Simp[b*c + a*d*(n - 1) - b*d*n*Tan[e + f*x], x], x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] 
&& NeQ[c^2 + d^2, 0] &&  !GtQ[n, 0]
 
Maple [A] (verified)

Time = 0.81 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.86

method result size
risch \(\frac {7 i x}{2 a}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )}}{4 a d}+\frac {4 i c}{a d}+\frac {2}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a d}\) \(77\)
derivativedivides \(\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d a}+\frac {3 i \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {1}{2 a d \tan \left (d x +c \right )^{2}}+\frac {i}{a d \tan \left (d x +c \right )}-\frac {2 \ln \left (\tan \left (d x +c \right )\right )}{a d}+\frac {i}{2 d a \left (-i+\tan \left (d x +c \right )\right )}\) \(104\)
default \(\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d a}+\frac {3 i \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {1}{2 a d \tan \left (d x +c \right )^{2}}+\frac {i}{a d \tan \left (d x +c \right )}-\frac {2 \ln \left (\tan \left (d x +c \right )\right )}{a d}+\frac {i}{2 d a \left (-i+\tan \left (d x +c \right )\right )}\) \(104\)
norman \(\frac {\frac {i \tan \left (d x +c \right )}{d a}-\frac {\tan \left (d x +c \right )^{2}}{a d}-\frac {1}{2 a d}+\frac {3 i \tan \left (d x +c \right )^{3}}{2 d a}+\frac {3 i x \tan \left (d x +c \right )^{2}}{2 a}+\frac {3 i x \tan \left (d x +c \right )^{4}}{2 a}}{\tan \left (d x +c \right )^{2} \left (1+\tan \left (d x +c \right )^{2}\right )}+\frac {\ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d a}-\frac {2 \ln \left (\tan \left (d x +c \right )\right )}{a d}\) \(143\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.49 \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {14 i \, d x e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-28 i \, d x - 1\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (-7 i \, d x - 5\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 8 \, {\left (e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, e^{\left (4 i \, d x + 4 i \, c\right )} + e^{\left (2 i \, d x + 2 i \, c\right )}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) - 1}{4 \, {\left (a d e^{\left (6 i \, d x + 6 i \, c\right )} - 2 \, a d e^{\left (4 i \, d x + 4 i \, c\right )} + a d e^{\left (2 i \, d x + 2 i \, c\right )}\right )}} \] Input:

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

Output:

1/4*(14*I*d*x*e^(6*I*d*x + 6*I*c) + (-28*I*d*x - 1)*e^(4*I*d*x + 4*I*c) - 
2*(-7*I*d*x - 5)*e^(2*I*d*x + 2*I*c) - 8*(e^(6*I*d*x + 6*I*c) - 2*e^(4*I*d 
*x + 4*I*c) + e^(2*I*d*x + 2*I*c))*log(e^(2*I*d*x + 2*I*c) - 1) - 1)/(a*d* 
e^(6*I*d*x + 6*I*c) - 2*a*d*e^(4*I*d*x + 4*I*c) + a*d*e^(2*I*d*x + 2*I*c))
 

Sympy [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.53 \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\begin {cases} - \frac {e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: a d e^{2 i c} \neq 0 \\x \left (\frac {\left (7 i e^{2 i c} + i\right ) e^{- 2 i c}}{2 a} - \frac {7 i}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {2}{a d e^{4 i c} e^{4 i d x} - 2 a d e^{2 i c} e^{2 i d x} + a d} + \frac {7 i x}{2 a} - \frac {2 \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} \] Input:

integrate(cot(d*x+c)**3/(a+I*a*tan(d*x+c)),x)
 

Output:

Piecewise((-exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(a*d*exp(2*I*c), 0)), (x* 
((7*I*exp(2*I*c) + I)*exp(-2*I*c)/(2*a) - 7*I/(2*a)), True)) + 2/(a*d*exp( 
4*I*c)*exp(4*I*d*x) - 2*a*d*exp(2*I*c)*exp(2*I*d*x) + a*d) + 7*I*x/(2*a) - 
 2*log(exp(2*I*d*x) - exp(-2*I*c))/(a*d)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\text {Exception raised: RuntimeError} \] Input:

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

Output:

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati 
ve exponent.
 

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 1.05 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.22 \[ \int \frac {\cot ^3(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {7\,\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )}{4\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{4\,a\,d}-\frac {2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}-\frac {\frac {1}{2\,a}+\frac {3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,a}-\frac {\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}{2\,a}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^2\right )} \] Input:

int(cot(c + d*x)^3/(a + a*tan(c + d*x)*1i),x)
 

Output:

(7*log(tan(c + d*x) - 1i))/(4*a*d) + log(tan(c + d*x) + 1i)/(4*a*d) - (2*l 
og(tan(c + d*x)))/(a*d) - (1/(2*a) - (tan(c + d*x)*1i)/(2*a) + (3*tan(c + 
d*x)^2)/(2*a))/(d*(tan(c + d*x)^2 + tan(c + d*x)^3*1i))
 

Reduce [F]

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

int(cot(d*x+c)^3/(a+I*a*tan(d*x+c)),x)
 

Output:

int(cot(c + d*x)**3/(tan(c + d*x)*i + 1),x)/a