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

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

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

Mathematica [A] (verified)

Time = 5.45 (sec) , antiderivative size = 107, normalized size of antiderivative = 0.65 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\frac {c^4 \left (\frac {B (i+\tan (e+f x))^4}{(a+i a \tan (e+f x))^3}-\frac {i (A+7 i B) \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}\right )}{f} \] Input:

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

Output:

(c^4*((B*(I + Tan[e + f*x])^4)/(a + I*a*Tan[e + f*x])^3 - (I*(A + (7*I)*B) 
*(-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.62 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.72, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {3042, 4071, 27, 86, 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+B \tan (e+f x))}{(a+i a \tan (e+f x))^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4071

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 86

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

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 4071
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si 
mp[a*(c/f)   Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x 
, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c 
+ a*d, 0] && EqQ[a^2 + b^2, 0]
 
Maple [A] (verified)

Time = 0.51 (sec) , antiderivative size = 248, normalized size of antiderivative = 1.51

method result size
derivativedivides \(\frac {i B \,c^{4} \tan \left (f x +e \right )}{a^{3} f}+\frac {i c^{4} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {7 c^{4} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {c^{4} A \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}-\frac {7 i c^{4} B \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}+\frac {6 i c^{4} A}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {10 c^{4} B}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {8 c^{4} A}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {8 i c^{4} B}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}+\frac {18 i c^{4} B}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}+\frac {6 c^{4} A}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}\) \(248\)
default \(\frac {i B \,c^{4} \tan \left (f x +e \right )}{a^{3} f}+\frac {i c^{4} A \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {7 c^{4} B \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \,a^{3}}-\frac {c^{4} A \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}-\frac {7 i c^{4} B \arctan \left (\tan \left (f x +e \right )\right )}{f \,a^{3}}+\frac {6 i c^{4} A}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {10 c^{4} B}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {8 c^{4} A}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {8 i c^{4} B}{3 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}+\frac {18 i c^{4} B}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}+\frac {6 c^{4} A}{f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}\) \(248\)
risch \(-\frac {5 c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a^{3} f}+\frac {i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a^{3} f}+\frac {3 c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} B}{2 a^{3} f}-\frac {i c^{4} {\mathrm e}^{-4 i \left (f x +e \right )} A}{2 a^{3} f}-\frac {c^{4} {\mathrm e}^{-6 i \left (f x +e \right )} B}{3 a^{3} f}+\frac {i c^{4} {\mathrm e}^{-6 i \left (f x +e \right )} A}{3 a^{3} f}-\frac {14 i c^{4} B x}{a^{3}}-\frac {2 c^{4} A x}{a^{3}}-\frac {14 i c^{4} B e}{a^{3} f}-\frac {2 c^{4} A e}{a^{3} f}-\frac {2 c^{4} B}{f \,a^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {7 c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{a^{3} f}-\frac {i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{a^{3} f}\) \(253\)
norman \(\frac {\frac {\left (7 i c^{4} B +2 A \,c^{4}\right ) \tan \left (f x +e \right )}{a f}+\frac {i c^{4} B \tan \left (f x +e \right )^{7}}{a f}-\frac {\left (7 i c^{4} B +A \,c^{4}\right ) x}{a}-\frac {-8 i c^{4} A +32 B \,c^{4}}{3 a f}-\frac {3 \left (7 i c^{4} B +A \,c^{4}\right ) x \tan \left (f x +e \right )^{2}}{a}-\frac {3 \left (7 i c^{4} B +A \,c^{4}\right ) x \tan \left (f x +e \right )^{4}}{a}-\frac {\left (7 i c^{4} B +A \,c^{4}\right ) x \tan \left (f x +e \right )^{6}}{a}-\frac {\left (-49 i c^{4} B +8 A \,c^{4}\right ) \tan \left (f x +e \right )^{3}}{3 a f}+\frac {3 \left (7 i c^{4} B +2 A \,c^{4}\right ) \tan \left (f x +e \right )^{5}}{a f}-\frac {\left (-4 i c^{4} A +28 B \,c^{4}\right ) \tan \left (f x +e \right )^{2}}{a f}-\frac {\left (-12 i c^{4} A +28 B \,c^{4}\right ) \tan \left (f x +e \right )^{4}}{a f}}{a^{2} \left (1+\tan \left (f x +e \right )^{2}\right )^{3}}-\frac {\left (-i c^{4} A +7 B \,c^{4}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 a^{3} f}\) \(342\)

Input:

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

Output:

I*B*c^4*tan(f*x+e)/a^3/f+1/2*I/f*c^4/a^3*A*ln(1+tan(f*x+e)^2)-7/2/f*c^4/a^ 
3*B*ln(1+tan(f*x+e)^2)-1/f*c^4/a^3*A*arctan(tan(f*x+e))-7*I/f*c^4/a^3*B*ar 
ctan(tan(f*x+e))+6*I/f*c^4/a^3/(-I+tan(f*x+e))^2*A-10/f*c^4/a^3/(-I+tan(f* 
x+e))^2*B-8/3/f*c^4/a^3/(-I+tan(f*x+e))^3*A-8/3*I/f*c^4/a^3/(-I+tan(f*x+e) 
)^3*B+18*I/f*c^4/a^3/(-I+tan(f*x+e))*B+6/f*c^4/a^3/(-I+tan(f*x+e))*A
 

Fricas [A] (verification not implemented)

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

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

Output:

-1/6*(12*(A + 7*I*B)*c^4*f*x*e^(8*I*f*x + 8*I*e) + 3*(-I*A + 7*B)*c^4*e^(4 
*I*f*x + 4*I*e) - (-I*A + 7*B)*c^4*e^(2*I*f*x + 2*I*e) + 2*(-I*A + B)*c^4 
+ 6*(2*(A + 7*I*B)*c^4*f*x + (-I*A + 7*B)*c^4)*e^(6*I*f*x + 6*I*e) + 6*((I 
*A - 7*B)*c^4*e^(8*I*f*x + 8*I*e) + (I*A - 7*B)*c^4*e^(6*I*f*x + 6*I*e))*l 
og(e^(2*I*f*x + 2*I*e) + 1))/(a^3*f*e^(8*I*f*x + 8*I*e) + a^3*f*e^(6*I*f*x 
 + 6*I*e))
                                                                                    
                                                                                    
 

Sympy [A] (verification not implemented)

Time = 0.91 (sec) , antiderivative size = 403, normalized size of antiderivative = 2.46 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=- \frac {2 B c^{4}}{a^{3} f e^{2 i e} e^{2 i f x} + a^{3} f} + \begin {cases} \frac {\left (\left (2 i A a^{6} c^{4} f^{2} e^{6 i e} - 2 B a^{6} c^{4} f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (- 3 i A a^{6} c^{4} f^{2} e^{8 i e} + 9 B a^{6} c^{4} f^{2} e^{8 i e}\right ) e^{- 4 i f x} + \left (6 i A a^{6} c^{4} f^{2} e^{10 i e} - 30 B a^{6} c^{4} f^{2} e^{10 i e}\right ) e^{- 2 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 A c^{4} - 14 i B c^{4}}{a^{3}} + \frac {\left (- 2 A c^{4} e^{6 i e} + 2 A c^{4} e^{4 i e} - 2 A c^{4} e^{2 i e} + 2 A c^{4} - 14 i B c^{4} e^{6 i e} + 10 i B c^{4} e^{4 i e} - 6 i B c^{4} e^{2 i e} + 2 i B c^{4}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} - \frac {i c^{4} \left (A + 7 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \frac {x \left (- 2 A c^{4} - 14 i B c^{4}\right )}{a^{3}} \] Input:

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

Output:

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

Maxima [F(-2)]

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

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.64 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.74 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\frac {i \, B c^{4} \tan \left (f x + e\right )}{a^{3} f} + \frac {{\left (i \, A c^{4} - 7 \, B c^{4}\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} f} - \frac {2 \, {\left (4 \, A c^{4} + 16 i \, B c^{4} - 9 \, {\left (A c^{4} + 3 i \, B c^{4}\right )} \tan \left (f x + e\right )^{2} + 3 \, {\left (3 i \, A c^{4} - 13 \, B c^{4}\right )} \tan \left (f x + e\right )\right )}}{3 \, a^{3} f {\left (\tan \left (f x + e\right ) - i\right )}^{3}} \] Input:

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

Output:

I*B*c^4*tan(f*x + e)/(a^3*f) + (I*A*c^4 - 7*B*c^4)*log(tan(f*x + e) - I)/( 
a^3*f) - 2/3*(4*A*c^4 + 16*I*B*c^4 - 9*(A*c^4 + 3*I*B*c^4)*tan(f*x + e)^2 
+ 3*(3*I*A*c^4 - 13*B*c^4)*tan(f*x + e))/(a^3*f*(tan(f*x + e) - I)^3)
 

Mupad [B] (verification not implemented)

Time = 7.51 (sec) , antiderivative size = 266, normalized size of antiderivative = 1.62 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=-\frac {c^4\,\left (25\,B\,\mathrm {tan}\left (e+f\,x\right )-\frac {B\,32{}\mathrm {i}}{3}-A\,\mathrm {tan}\left (e+f\,x\right )\,6{}\mathrm {i}-\frac {8\,A}{3}-A\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )-B\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,7{}\mathrm {i}+6\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,15{}\mathrm {i}+3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3+B\,{\mathrm {tan}\left (e+f\,x\right )}^4\,1{}\mathrm {i}+3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )+A\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,21{}\mathrm {i}-7\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )-A\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,3{}\mathrm {i}+21\,B\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\right )\,1{}\mathrm {i}}{a^3\,f\,{\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \] Input:

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

Output:

-(c^4*(25*B*tan(e + f*x) - (B*32i)/3 - A*tan(e + f*x)*6i - (8*A)/3 - A*log 
(- tan(e + f*x)*1i - 1) - B*log(- tan(e + f*x)*1i - 1)*7i + 6*A*tan(e + f* 
x)^2 + B*tan(e + f*x)^2*15i + 3*B*tan(e + f*x)^3 + B*tan(e + f*x)^4*1i + 3 
*A*tan(e + f*x)^2*log(- tan(e + f*x)*1i - 1) + A*tan(e + f*x)^3*log(- tan( 
e + f*x)*1i - 1)*1i + B*tan(e + f*x)^2*log(- tan(e + f*x)*1i - 1)*21i - 7* 
B*tan(e + f*x)^3*log(- tan(e + f*x)*1i - 1) - A*tan(e + f*x)*log(- tan(e + 
 f*x)*1i - 1)*3i + 21*B*tan(e + f*x)*log(- tan(e + f*x)*1i - 1))*1i)/(a^3* 
f*(tan(e + f*x)*1i + 1)^3)
 

Reduce [F]

\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{(a+i a \tan (e+f x))^3} \, dx=\frac {c^{4} \left (-48 \left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) a f i +112 \left (\int \frac {\tan \left (f x +e \right )^{2}}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) b f -32 \left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) a f -128 \left (\int \frac {\tan \left (f x +e \right )}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) b f i +16 \left (\int \frac {1}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) a f i -48 \left (\int \frac {1}{\tan \left (f x +e \right )^{3}-3 \tan \left (f x +e \right )^{2} i -3 \tan \left (f x +e \right )+i}d x \right ) b f +\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a i -7 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b +2 \tan \left (f x +e \right ) b i -14 a f x -50 b f i x \right )}{2 a^{3} f} \] Input:

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

Output:

(c**4*( - 48*int(tan(e + f*x)**2/(tan(e + f*x)**3 - 3*tan(e + f*x)**2*i - 
3*tan(e + f*x) + i),x)*a*f*i + 112*int(tan(e + f*x)**2/(tan(e + f*x)**3 - 
3*tan(e + f*x)**2*i - 3*tan(e + f*x) + i),x)*b*f - 32*int(tan(e + f*x)/(ta 
n(e + f*x)**3 - 3*tan(e + f*x)**2*i - 3*tan(e + f*x) + i),x)*a*f - 128*int 
(tan(e + f*x)/(tan(e + f*x)**3 - 3*tan(e + f*x)**2*i - 3*tan(e + f*x) + i) 
,x)*b*f*i + 16*int(1/(tan(e + f*x)**3 - 3*tan(e + f*x)**2*i - 3*tan(e + f* 
x) + i),x)*a*f*i - 48*int(1/(tan(e + f*x)**3 - 3*tan(e + f*x)**2*i - 3*tan 
(e + f*x) + i),x)*b*f + log(tan(e + f*x)**2 + 1)*a*i - 7*log(tan(e + f*x)* 
*2 + 1)*b + 2*tan(e + f*x)*b*i - 14*a*f*x - 50*b*f*i*x))/(2*a**3*f)