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

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 = 26, antiderivative size = 112 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=\frac {(c-i d) x}{8 a^3}+\frac {i c-d}{6 f (a+i a \tan (e+f x))^3}+\frac {i c+d}{8 a f (a+i a \tan (e+f x))^2}+\frac {i c+d}{8 f \left (a^3+i a^3 \tan (e+f x)\right )} \] Output:

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

Mathematica [A] (verified)

Time = 0.69 (sec) , antiderivative size = 109, normalized size of antiderivative = 0.97 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=\frac {-10 c+2 i d+3 (i c+d) \arctan (\tan (e+f x)) \sec ^3(e+f x) (\cos (3 (e+f x))+i \sin (3 (e+f x)))+(-9 i c-9 d) \tan (e+f x)+3 (c-i d) \tan ^2(e+f x)}{24 a^3 f (-i+\tan (e+f x))^3} \] Input:

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

Output:

(-10*c + (2*I)*d + 3*(I*c + d)*ArcTan[Tan[e + f*x]]*Sec[e + f*x]^3*(Cos[3* 
(e + f*x)] + I*Sin[3*(e + f*x)]) + ((-9*I)*c - 9*d)*Tan[e + f*x] + 3*(c - 
I*d)*Tan[e + f*x]^2)/(24*a^3*f*(-I + Tan[e + f*x])^3)
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.269, Rules used = {3042, 4009, 3042, 3960, 3042, 3960, 24}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4009

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3960

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3960

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

\(\Big \downarrow \) 24

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

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

rule 3960
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + 
b*Tan[c + d*x])^n/(2*b*d*n)), x] + Simp[1/(2*a)   Int[(a + b*Tan[c + d*x])^ 
(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, 0]
 

rule 4009
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/(2*a 
*f*m)), x] + Simp[(b*c + a*d)/(2*a*b)   Int[(a + b*Tan[e + f*x])^(m + 1), x 
], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 
, 0] && LtQ[m, 0]
 
Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.14

method result size
risch \(-\frac {i x d}{8 a^{3}}+\frac {x c}{8 a^{3}}+\frac {{\mathrm e}^{-2 i \left (f x +e \right )} d}{16 a^{3} f}+\frac {3 i {\mathrm e}^{-2 i \left (f x +e \right )} c}{16 a^{3} f}-\frac {{\mathrm e}^{-4 i \left (f x +e \right )} d}{32 a^{3} f}+\frac {3 i {\mathrm e}^{-4 i \left (f x +e \right )} c}{32 a^{3} f}-\frac {{\mathrm e}^{-6 i \left (f x +e \right )} d}{48 a^{3} f}+\frac {i {\mathrm e}^{-6 i \left (f x +e \right )} c}{48 a^{3} f}\) \(128\)
derivativedivides \(-\frac {i d \arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{8 f \,a^{3}}-\frac {i c}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {d}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {c}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i d}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}-\frac {c}{6 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {i d}{6 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}\) \(158\)
default \(-\frac {i d \arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{3}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c}{8 f \,a^{3}}-\frac {i c}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {d}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {c}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i d}{8 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )}-\frac {c}{6 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}-\frac {i d}{6 f \,a^{3} \left (-i+\tan \left (f x +e \right )\right )^{3}}\) \(158\)

Input:

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

Output:

-1/8*I*x/a^3*d+1/8*x/a^3*c+1/16/a^3/f*exp(-2*I*(f*x+e))*d+3/16*I/a^3/f*exp 
(-2*I*(f*x+e))*c-1/32/a^3/f*exp(-4*I*(f*x+e))*d+3/32*I/a^3/f*exp(-4*I*(f*x 
+e))*c-1/48/a^3/f*exp(-6*I*(f*x+e))*d+1/48*I/a^3/f*exp(-6*I*(f*x+e))*c
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.68 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=\frac {{\left (12 \, {\left (c - i \, d\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} - 6 \, {\left (-3 i \, c - d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 3 \, {\left (-3 i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i \, c - 2 \, d\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{96 \, a^{3} f} \] Input:

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

Output:

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

Sympy [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 258, normalized size of antiderivative = 2.30 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=\begin {cases} \frac {\left (\left (512 i a^{6} c f^{2} e^{6 i e} - 512 a^{6} d f^{2} e^{6 i e}\right ) e^{- 6 i f x} + \left (2304 i a^{6} c f^{2} e^{8 i e} - 768 a^{6} d f^{2} e^{8 i e}\right ) e^{- 4 i f x} + \left (4608 i a^{6} c f^{2} e^{10 i e} + 1536 a^{6} d f^{2} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{24576 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (- \frac {c - i d}{8 a^{3}} + \frac {\left (c e^{6 i e} + 3 c e^{4 i e} + 3 c e^{2 i e} + c - i d e^{6 i e} - i d e^{4 i e} + i d e^{2 i e} + i d\right ) e^{- 6 i e}}{8 a^{3}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (c - i d\right )}{8 a^{3}} \] Input:

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

Output:

Piecewise((((512*I*a**6*c*f**2*exp(6*I*e) - 512*a**6*d*f**2*exp(6*I*e))*ex 
p(-6*I*f*x) + (2304*I*a**6*c*f**2*exp(8*I*e) - 768*a**6*d*f**2*exp(8*I*e)) 
*exp(-4*I*f*x) + (4608*I*a**6*c*f**2*exp(10*I*e) + 1536*a**6*d*f**2*exp(10 
*I*e))*exp(-2*I*f*x))*exp(-12*I*e)/(24576*a**9*f**3), Ne(a**9*f**3*exp(12* 
I*e), 0)), (x*(-(c - I*d)/(8*a**3) + (c*exp(6*I*e) + 3*c*exp(4*I*e) + 3*c* 
exp(2*I*e) + c - I*d*exp(6*I*e) - I*d*exp(4*I*e) + I*d*exp(2*I*e) + I*d)*e 
xp(-6*I*e)/(8*a**3)), True)) + x*(c - I*d)/(8*a**3)
 

Maxima [F(-2)]

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

integrate((c+d*tan(f*x+e))/(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.49 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.89 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=-\frac {{\left (-i \, c - d\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{16 \, a^{3} f} - \frac {{\left (i \, c + d\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{16 \, a^{3} f} + \frac {3 \, {\left (c - i \, d\right )} \tan \left (f x + e\right )^{2} - 9 \, {\left (i \, c + d\right )} \tan \left (f x + e\right ) - 10 \, c + 2 i \, d}{24 \, a^{3} f {\left (\tan \left (f x + e\right ) - i\right )}^{3}} \] Input:

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

Output:

-1/16*(-I*c - d)*log(tan(f*x + e) + I)/(a^3*f) - 1/16*(I*c + d)*log(tan(f* 
x + e) - I)/(a^3*f) + 1/24*(3*(c - I*d)*tan(f*x + e)^2 - 9*(I*c + d)*tan(f 
*x + e) - 10*c + 2*I*d)/(a^3*f*(tan(f*x + e) - I)^3)
 

Mupad [B] (verification not implemented)

Time = 2.14 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.99 \[ \int \frac {c+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=-\frac {x\,\left (d+c\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,a^3}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {3\,c}{8\,a^3}-\frac {d\,3{}\mathrm {i}}{8\,a^3}\right )-\frac {c\,5{}\mathrm {i}}{12\,a^3}-\frac {d}{12\,a^3}+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {d}{8\,a^3}+\frac {c\,1{}\mathrm {i}}{8\,a^3}\right )}{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 )} \] Input:

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

Output:

- (x*(c*1i + d)*1i)/(8*a^3) - (tan(e + f*x)*((3*c)/(8*a^3) - (d*3i)/(8*a^3 
)) - (c*5i)/(12*a^3) - d/(12*a^3) + tan(e + f*x)^2*((c*1i)/(8*a^3) + d/(8* 
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+d \tan (e+f x)}{(a+i a \tan (e+f x))^3} \, dx=\frac {-\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 ) d -\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 ) c}{a^{3}} \] Input:

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

Output:

( - (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)*d + int(1/(tan(e + f*x)**3*i + 3*tan(e + f*x)**2 - 3*tan(e + 
 f*x)*i - 1),x)*c))/a**3