\(\int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx\) [921]

Optimal result
Mathematica [A] (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 = 31, antiderivative size = 113 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {c^4 x}{a^3}-\frac {i c^4 \log (\cos (e+f x))}{a^3 f}+\frac {8 i c^4}{3 a^3 f (1+i \tan (e+f x))^3}-\frac {6 i c^4}{a^3 f (1+i \tan (e+f x))^2}+\frac {6 i c^4}{a^3 f (1+i \tan (e+f x))} \] Output:

-c^4*x/a^3-I*c^4*ln(cos(f*x+e))/a^3/f+8/3*I*c^4/a^3/f/(1+I*tan(f*x+e))^3-6 
*I*c^4/a^3/f/(1+I*tan(f*x+e))^2+6*I*c^4/a^3/f/(1+I*tan(f*x+e))
 

Mathematica [A] (verified)

Time = 5.31 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.61 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {i c^4 \left (-\log (i-\tan (e+f x))+\frac {2 \left (-4 i+9 \tan (e+f x)+9 i \tan ^2(e+f x)\right )}{3 (-i+\tan (e+f x))^3}\right )}{a^3 f} \] Input:

Integrate[(c - I*c*Tan[e + f*x])^4/(a + I*a*Tan[e + f*x])^3,x]
 

Output:

((-I)*c^4*(-Log[I - Tan[e + f*x]] + (2*(-4*I + 9*Tan[e + f*x] + (9*I)*Tan[ 
e + f*x]^2))/(3*(-I + Tan[e + f*x])^3)))/(a^3*f)
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.80, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {3042, 4005, 3042, 3968, 49, 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 \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3}dx\)

\(\Big \downarrow \) 4005

\(\displaystyle a^4 c^4 \int \frac {\sec ^8(e+f x)}{(i \tan (e+f x) a+a)^7}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a^4 c^4 \int \frac {\sec (e+f x)^8}{(i \tan (e+f x) a+a)^7}dx\)

\(\Big \downarrow \) 3968

\(\displaystyle -\frac {i c^4 \int \frac {(a-i a \tan (e+f x))^3}{(i \tan (e+f x) a+a)^4}d(i a \tan (e+f x))}{a^3 f}\)

\(\Big \downarrow \) 49

\(\displaystyle -\frac {i c^4 \int \left (\frac {8 a^3}{(i \tan (e+f x) a+a)^4}-\frac {12 a^2}{(i \tan (e+f x) a+a)^3}+\frac {6 a}{(i \tan (e+f x) a+a)^2}+\frac {1}{-i \tan (e+f x) a-a}\right )d(i a \tan (e+f x))}{a^3 f}\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {i c^4 \left (-\frac {8 a^3}{3 (a+i a \tan (e+f x))^3}+\frac {6 a^2}{(a+i a \tan (e+f x))^2}-\frac {6 a}{a+i a \tan (e+f x)}-\log (a+i a \tan (e+f x))\right )}{a^3 f}\)

Input:

Int[(c - I*c*Tan[e + f*x])^4/(a + I*a*Tan[e + f*x])^3,x]
 

Output:

((-I)*c^4*(-Log[a + I*a*Tan[e + f*x]] - (8*a^3)/(3*(a + I*a*Tan[e + f*x])^ 
3) + (6*a^2)/(a + I*a*Tan[e + f*x])^2 - (6*a)/(a + I*a*Tan[e + f*x])))/(a^ 
3*f)
 

Defintions of rubi rules used

rule 49
Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int 
[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d}, x] 
&& IGtQ[m, 0] && IGtQ[m + n + 2, 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 3968
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[1/(a^(m - 2)*b*f)   Subst[Int[(a - x)^(m/2 - 1)*(a + x 
)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && 
 EqQ[a^2 + b^2, 0] && IntegerQ[m/2]
 

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

Time = 0.24 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {i c^{4} \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {c^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}-\frac {8 c^{4}}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}+\frac {6 c^{4}}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}+\frac {6 i c^{4}}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}\) \(110\)
default \(\frac {i c^{4} \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {c^{4} \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}-\frac {8 c^{4}}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}+\frac {6 c^{4}}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}+\frac {6 i c^{4}}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}\) \(110\)
risch \(\frac {i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )}}{a^{3} f}-\frac {i c^{4} {\mathrm e}^{-4 i \left (f x +e \right )}}{2 a^{3} f}+\frac {i c^{4} {\mathrm e}^{-6 i \left (f x +e \right )}}{3 a^{3} f}-\frac {2 c^{4} x}{a^{3}}-\frac {2 c^{4} e}{a^{3} f}-\frac {i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a^{3} f}\) \(110\)
norman \(\frac {\frac {4 i c^{4} \tan \left (f x +e \right )^{2}}{a f}-\frac {c^{4} x}{a}+\frac {8 i c^{4}}{3 a f}-\frac {8 c^{4} \tan \left (f x +e \right )^{3}}{3 a f}+\frac {6 c^{4} \tan \left (f x +e \right )^{5}}{a f}-\frac {3 c^{4} x \tan \left (f x +e \right )^{2}}{a}-\frac {3 c^{4} x \tan \left (f x +e \right )^{4}}{a}-\frac {c^{4} x \tan \left (f x +e \right )^{6}}{a}+\frac {2 c^{4} \tan \left (f x +e \right )}{a f}+\frac {12 i c^{4} \tan \left (f x +e \right )^{4}}{a f}}{a^{2} \left (1+\tan \left (f x +e \right )^{2}\right )^{3}}+\frac {i c^{4} \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}\) \(209\)

Input:

int((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x,method=_RETURNVERBOSE)
 

Output:

1/2*I/f*c^4/a^3*ln(1+tan(f*x+e)^2)-1/f*c^4/a^3*arctan(tan(f*x+e))-8/3/f*c^ 
4/a^3/(-I+tan(f*x+e))^3+6/f*c^4/a^3/(-I+tan(f*x+e))+6*I/f*c^4/a^3/(-I+tan( 
f*x+e))^2
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 93, normalized size of antiderivative = 0.82 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {{\left (12 \, c^{4} f x e^{\left (6 i \, f x + 6 i \, e\right )} + 6 i \, c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 6 i \, c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 i \, c^{4} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, c^{4}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6 \, a^{3} f} \] Input:

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="fricas")
 

Output:

-1/6*(12*c^4*f*x*e^(6*I*f*x + 6*I*e) + 6*I*c^4*e^(6*I*f*x + 6*I*e)*log(e^( 
2*I*f*x + 2*I*e) + 1) - 6*I*c^4*e^(4*I*f*x + 4*I*e) + 3*I*c^4*e^(2*I*f*x + 
 2*I*e) - 2*I*c^4)*e^(-6*I*f*x - 6*I*e)/(a^3*f)
                                                                                    
                                                                                    
 

Sympy [A] (verification not implemented)

Time = 0.47 (sec) , antiderivative size = 212, normalized size of antiderivative = 1.88 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\begin {cases} \frac {\left (6 i a^{6} c^{4} f^{2} e^{10 i e} e^{- 2 i f x} - 3 i a^{6} c^{4} f^{2} e^{8 i e} e^{- 4 i f x} + 2 i a^{6} c^{4} f^{2} e^{6 i e} e^{- 6 i f x}\right ) e^{- 12 i e}}{6 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (\frac {2 c^{4}}{a^{3}} + \frac {\left (- 2 c^{4} e^{6 i e} + 2 c^{4} e^{4 i e} - 2 c^{4} e^{2 i e} + 2 c^{4}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} - \frac {2 c^{4} x}{a^{3}} - \frac {i c^{4} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} \] Input:

integrate((c-I*c*tan(f*x+e))**4/(a+I*a*tan(f*x+e))**3,x)
 

Output:

Piecewise(((6*I*a**6*c**4*f**2*exp(10*I*e)*exp(-2*I*f*x) - 3*I*a**6*c**4*f 
**2*exp(8*I*e)*exp(-4*I*f*x) + 2*I*a**6*c**4*f**2*exp(6*I*e)*exp(-6*I*f*x) 
)*exp(-12*I*e)/(6*a**9*f**3), Ne(a**9*f**3*exp(12*I*e), 0)), (x*(2*c**4/a* 
*3 + (-2*c**4*exp(6*I*e) + 2*c**4*exp(4*I*e) - 2*c**4*exp(2*I*e) + 2*c**4) 
*exp(-6*I*e)/a**3), True)) - 2*c**4*x/a**3 - I*c**4*log(exp(2*I*f*x) + exp 
(-2*I*e))/(a**3*f)
 

Maxima [F(-2)]

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

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="maxima")
 

Output:

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

Giac [A] (verification not implemented)

Time = 0.61 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.61 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\frac {i \, c^{4} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} f} + \frac {2 \, {\left (9 \, c^{4} \tan \left (f x + e\right )^{2} - 9 i \, c^{4} \tan \left (f x + e\right ) - 4 \, c^{4}\right )}}{3 \, a^{3} f {\left (\tan \left (f x + e\right ) - i\right )}^{3}} \] Input:

integrate((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x, algorithm="giac")
 

Output:

I*c^4*log(tan(f*x + e) - I)/(a^3*f) + 2/3*(9*c^4*tan(f*x + e)^2 - 9*I*c^4* 
tan(f*x + e) - 4*c^4)/(a^3*f*(tan(f*x + e) - I)^3)
 

Mupad [B] (verification not implemented)

Time = 1.88 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.91 \[ \int \frac {(c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {\frac {6\,c^4\,\mathrm {tan}\left (e+f\,x\right )}{a^3}-\frac {c^4\,8{}\mathrm {i}}{3\,a^3}+\frac {c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2\,6{}\mathrm {i}}{a^3}}{f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (e+f\,x\right )}^2+\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+1\right )}+\frac {c^4\,\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{a^3\,f} \] Input:

int((c - c*tan(e + f*x)*1i)^4/(a + a*tan(e + f*x)*1i)^3,x)
 

Output:

(c^4*log(tan(e + f*x) - 1i)*1i)/(a^3*f) - ((6*c^4*tan(e + f*x))/a^3 - (c^4 
*8i)/(3*a^3) + (c^4*tan(e + f*x)^2*6i)/a^3)/(f*(tan(e + f*x)*3i - 3*tan(e 
+ f*x)^2 - tan(e + f*x)^3*1i + 1))
 

Reduce [F]

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

int((c-I*c*tan(f*x+e))^4/(a+I*a*tan(f*x+e))^3,x)
 

Output:

(c**4*( - int(tan(e + f*x)**4/(tan(e + f*x)**3*i + 3*tan(e + f*x)**2 - 3*t 
an(e + f*x)*i - 1),x) - 4*int(tan(e + f*x)**3/(tan(e + f*x)**3*i + 3*tan(e 
 + f*x)**2 - 3*tan(e + f*x)*i - 1),x)*i + 6*int(tan(e + f*x)**2/(tan(e + f 
*x)**3*i + 3*tan(e + f*x)**2 - 3*tan(e + f*x)*i - 1),x) + 4*int(tan(e + f* 
x)/(tan(e + f*x)**3*i + 3*tan(e + f*x)**2 - 3*tan(e + f*x)*i - 1),x)*i - i 
nt(1/(tan(e + f*x)**3*i + 3*tan(e + f*x)**2 - 3*tan(e + f*x)*i - 1),x)))/a 
**3