\(\int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx\) [45]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 130 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {5 x}{2 a}+\frac {3 i \log (\cos (c+d x))}{a d}-\frac {5 \tan (c+d x)}{2 a d}+\frac {3 i \tan ^2(c+d x)}{2 a d}+\frac {5 \tan ^3(c+d x)}{6 a d}-\frac {3 i \tan ^4(c+d x)}{4 a d}-\frac {\tan ^5(c+d x)}{2 d (a+i a \tan (c+d x))} \] Output:

5/2*x/a+3*I*ln(cos(d*x+c))/a/d-5/2*tan(d*x+c)/a/d+3/2*I*tan(d*x+c)^2/a/d+5 
/6*tan(d*x+c)^3/a/d-3/4*I*tan(d*x+c)^4/a/d-1/2*tan(d*x+c)^5/d/(a+I*a*tan(d 
*x+c))
 

Mathematica [A] (verified)

Time = 0.42 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.88 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {36 \log (\cos (c+d x))+6 i (5+6 \log (\cos (c+d x))) \tan (c+d x)-12 \tan ^2(c+d x)+8 i \tan ^3(c+d x)+\tan ^4(c+d x)-3 i \tan ^5(c+d x)+30 \arctan (\tan (c+d x)) (-i+\tan (c+d x))}{12 a d (-i+\tan (c+d x))} \] Input:

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

Output:

(36*Log[Cos[c + d*x]] + (6*I)*(5 + 6*Log[Cos[c + d*x]])*Tan[c + d*x] - 12* 
Tan[c + d*x]^2 + (8*I)*Tan[c + d*x]^3 + Tan[c + d*x]^4 - (3*I)*Tan[c + d*x 
]^5 + 30*ArcTan[Tan[c + d*x]]*(-I + Tan[c + d*x]))/(12*a*d*(-I + Tan[c + d 
*x]))
 

Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.92, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 4033, 3042, 4011, 3042, 4011, 3042, 4011, 3042, 4008, 3042, 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 {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4033

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4008

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3956

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

Input:

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

Output:

-1/2*Tan[c + d*x]^5/(d*(a + I*a*Tan[c + d*x])) + (5*a*x + ((6*I)*a*Log[Cos 
[c + d*x]])/d - (5*a*Tan[c + d*x])/d + ((3*I)*a*Tan[c + d*x]^2)/d + (5*a*T 
an[c + d*x]^3)/(3*d) - (((3*I)/2)*a*Tan[c + d*x]^4)/d)/(2*a^2)
 

Defintions of rubi rules used

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 4008
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), 
x] + Simp[(b*c + a*d)   Int[Tan[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]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*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] && GtQ[m, 0]
 

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

Time = 0.66 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.78

method result size
risch \(\frac {11 x}{2 a}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )}}{4 a d}+\frac {6 c}{a d}-\frac {2 i \left (9 \,{\mathrm e}^{4 i \left (d x +c \right )}+10 \,{\mathrm e}^{2 i \left (d x +c \right )}+7\right )}{3 d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{a d}\) \(102\)
derivativedivides \(-\frac {2 \tan \left (d x +c \right )}{a d}-\frac {i \tan \left (d x +c \right )^{4}}{4 d a}+\frac {\tan \left (d x +c \right )^{3}}{3 a d}+\frac {i \tan \left (d x +c \right )^{2}}{d a}-\frac {3 i \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d a}+\frac {5 \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {1}{2 d a \left (-i+\tan \left (d x +c \right )\right )}\) \(120\)
default \(-\frac {2 \tan \left (d x +c \right )}{a d}-\frac {i \tan \left (d x +c \right )^{4}}{4 d a}+\frac {\tan \left (d x +c \right )^{3}}{3 a d}+\frac {i \tan \left (d x +c \right )^{2}}{d a}-\frac {3 i \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d a}+\frac {5 \arctan \left (\tan \left (d x +c \right )\right )}{2 d a}-\frac {1}{2 d a \left (-i+\tan \left (d x +c \right )\right )}\) \(120\)
norman \(\frac {\frac {5 x}{2 a}+\frac {\tan \left (d x +c \right )^{5}}{3 a d}+\frac {5 x \tan \left (d x +c \right )^{2}}{2 a}-\frac {3 i}{2 a d}-\frac {5 \tan \left (d x +c \right )}{2 a d}-\frac {5 \tan \left (d x +c \right )^{3}}{3 a d}+\frac {3 i \tan \left (d x +c \right )^{4}}{4 d a}-\frac {i \tan \left (d x +c \right )^{6}}{4 a d}}{1+\tan \left (d x +c \right )^{2}}-\frac {3 i \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{2 d a}\) \(145\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (110) = 220\).

Time = 0.09 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.70 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {66 \, d x e^{\left (10 i \, d x + 10 i \, c\right )} + 3 \, {\left (88 \, d x - i\right )} e^{\left (8 i \, d x + 8 i \, c\right )} + 12 \, {\left (33 \, d x - 7 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 2 \, {\left (132 \, d x - 49 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (33 \, d x - 34 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 36 \, {\left (-i \, e^{\left (10 i \, d x + 10 i \, c\right )} - 4 i \, e^{\left (8 i \, d x + 8 i \, c\right )} - 6 i \, e^{\left (6 i \, d x + 6 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} - i \, 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 ) - 3 i}{12 \, {\left (a d e^{\left (10 i \, d x + 10 i \, c\right )} + 4 \, a d e^{\left (8 i \, d x + 8 i \, c\right )} + 6 \, a d e^{\left (6 i \, d x + 6 i \, c\right )} + 4 \, 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(tan(d*x+c)^6/(a+I*a*tan(d*x+c)),x, algorithm="fricas")
 

Output:

1/12*(66*d*x*e^(10*I*d*x + 10*I*c) + 3*(88*d*x - I)*e^(8*I*d*x + 8*I*c) + 
12*(33*d*x - 7*I)*e^(6*I*d*x + 6*I*c) + 2*(132*d*x - 49*I)*e^(4*I*d*x + 4* 
I*c) + 2*(33*d*x - 34*I)*e^(2*I*d*x + 2*I*c) - 36*(-I*e^(10*I*d*x + 10*I*c 
) - 4*I*e^(8*I*d*x + 8*I*c) - 6*I*e^(6*I*d*x + 6*I*c) - 4*I*e^(4*I*d*x + 4 
*I*c) - I*e^(2*I*d*x + 2*I*c))*log(e^(2*I*d*x + 2*I*c) + 1) - 3*I)/(a*d*e^ 
(10*I*d*x + 10*I*c) + 4*a*d*e^(8*I*d*x + 8*I*c) + 6*a*d*e^(6*I*d*x + 6*I*c 
) + 4*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.31 (sec) , antiderivative size = 219, normalized size of antiderivative = 1.68 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {- 18 i e^{4 i c} e^{4 i d x} - 20 i e^{2 i c} e^{2 i d x} - 14 i}{3 a d e^{8 i c} e^{8 i d x} + 12 a d e^{6 i c} e^{6 i d x} + 18 a d e^{4 i c} e^{4 i d x} + 12 a d e^{2 i c} e^{2 i d x} + 3 a d} + \begin {cases} - \frac {i 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 (11 e^{2 i c} - 1\right ) e^{- 2 i c}}{2 a} - \frac {11}{2 a}\right ) & \text {otherwise} \end {cases} + \frac {11 x}{2 a} + \frac {3 i \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{a d} \] Input:

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

Output:

(-18*I*exp(4*I*c)*exp(4*I*d*x) - 20*I*exp(2*I*c)*exp(2*I*d*x) - 14*I)/(3*a 
*d*exp(8*I*c)*exp(8*I*d*x) + 12*a*d*exp(6*I*c)*exp(6*I*d*x) + 18*a*d*exp(4 
*I*c)*exp(4*I*d*x) + 12*a*d*exp(2*I*c)*exp(2*I*d*x) + 3*a*d) + Piecewise(( 
-I*exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(a*d*exp(2*I*c), 0)), (x*((11*exp( 
2*I*c) - 1)*exp(-2*I*c)/(2*a) - 11/(2*a)), True)) + 11*x/(2*a) + 3*I*log(e 
xp(2*I*d*x) + exp(-2*I*c))/(a*d)
 

Maxima [F(-2)]

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

integrate(tan(d*x+c)^6/(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.18 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.95 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=-\frac {i \, \log \left (\tan \left (d x + c\right ) + i\right )}{4 \, a d} - \frac {11 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{4 \, a d} - \frac {1}{2 \, a d {\left (\tan \left (d x + c\right ) - i\right )}} - \frac {i \, {\left (3 \, a^{3} d^{3} \tan \left (d x + c\right )^{4} + 4 i \, a^{3} d^{3} \tan \left (d x + c\right )^{3} - 12 \, a^{3} d^{3} \tan \left (d x + c\right )^{2} - 24 i \, a^{3} d^{3} \tan \left (d x + c\right )\right )}}{12 \, a^{4} d^{4}} \] Input:

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

Output:

-1/4*I*log(tan(d*x + c) + I)/(a*d) - 11/4*I*log(tan(d*x + c) - I)/(a*d) - 
1/2/(a*d*(tan(d*x + c) - I)) - 1/12*I*(3*a^3*d^3*tan(d*x + c)^4 + 4*I*a^3* 
d^3*tan(d*x + c)^3 - 12*a^3*d^3*tan(d*x + c)^2 - 24*I*a^3*d^3*tan(d*x + c) 
)/(a^4*d^4)
 

Mupad [B] (verification not implemented)

Time = 1.01 (sec) , antiderivative size = 125, normalized size of antiderivative = 0.96 \[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a\,d}-\frac {2\,\mathrm {tan}\left (c+d\,x\right )}{a\,d}-\frac {1{}\mathrm {i}}{2\,a\,d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,11{}\mathrm {i}}{4\,a\,d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^4\,1{}\mathrm {i}}{4\,a\,d} \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {\tan ^6(c+d x)}{a+i a \tan (c+d x)} \, dx=\frac {-12 \left (\int \frac {1}{\tan \left (d x +c \right ) i +1}d x \right ) d -18 \,\mathrm {log}\left (\tan \left (d x +c \right )^{2}+1\right ) i -3 \tan \left (d x +c \right )^{4} i +4 \tan \left (d x +c \right )^{3}+12 \tan \left (d x +c \right )^{2} i -24 \tan \left (d x +c \right )+36 d x}{12 a d} \] Input:

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

Output:

( - 12*int(1/(tan(c + d*x)*i + 1),x)*d - 18*log(tan(c + d*x)**2 + 1)*i - 3 
*tan(c + d*x)**4*i + 4*tan(c + d*x)**3 + 12*tan(c + d*x)**2*i - 24*tan(c + 
 d*x) + 36*d*x)/(12*a*d)