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

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

Optimal result

Integrand size = 25, antiderivative size = 140 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{a^2+b^2}+\frac {\left (b c^3-3 a c^2 d-3 b c d^2+a d^3\right ) \log (\cos (e+f x))}{\left (a^2+b^2\right ) f}+\frac {(b c-a d)^3 \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right ) f}+\frac {d^2 (c+d \tan (e+f x))}{b f} \] Output:

(a*c^3-3*a*c*d^2+3*b*c^2*d-b*d^3)*x/(a^2+b^2)+(-3*a*c^2*d+a*d^3+b*c^3-3*b* 
c*d^2)*ln(cos(f*x+e))/(a^2+b^2)/f+(-a*d+b*c)^3*ln(a+b*tan(f*x+e))/b^2/(a^2 
+b^2)/f+d^2*(c+d*tan(f*x+e))/b/f
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.48 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.90 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {\frac {(c+i d)^3 \log (i-\tan (e+f x))}{i a-b}-\frac {(c-i d)^3 \log (i+\tan (e+f x))}{i a+b}+\frac {2 (b c-a d)^3 \log (a+b \tan (e+f x))}{b^2 \left (a^2+b^2\right )}+\frac {2 d^2 (c+d \tan (e+f x))}{b}}{2 f} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.74 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.08, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {3042, 4049, 3042, 4109, 3042, 3956, 4100, 16}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4049

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4109

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3956

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

\(\Big \downarrow \) 4100

\(\displaystyle \frac {\frac {(b c-a d)^3 \int \frac {1}{a+b \tan (e+f x)}d(b \tan (e+f x))}{b f \left (a^2+b^2\right )}-\frac {b \left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f \left (a^2+b^2\right )}+\frac {b x \left (a c^3-3 a c d^2+3 b c^2 d-b d^3\right )}{a^2+b^2}}{b}+\frac {d^2 (c+d \tan (e+f x))}{b f}\)

\(\Big \downarrow \) 16

\(\displaystyle \frac {-\frac {b \left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f \left (a^2+b^2\right )}+\frac {b x \left (a c^3-3 a c d^2+3 b c^2 d-b d^3\right )}{a^2+b^2}+\frac {(b c-a d)^3 \log (a+b \tan (e+f x))}{b f \left (a^2+b^2\right )}}{b}+\frac {d^2 (c+d \tan (e+f x))}{b f}\)

Input:

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

Output:

((b*(a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*x)/(a^2 + b^2) - (b*(a*d*(3*c^ 
2 - d^2) - b*(c^3 - 3*c*d^2))*Log[Cos[e + f*x]])/((a^2 + b^2)*f) + ((b*c - 
 a*d)^3*Log[a + b*Tan[e + f*x]])/(b*(a^2 + b^2)*f))/b + (d^2*(c + d*Tan[e 
+ f*x]))/(b*f)
 

Defintions of rubi rules used

rule 16
Int[(c_.)/((a_.) + (b_.)*(x_)), x_Symbol] :> Simp[c*(Log[RemoveContent[a + 
b*x, x]]/b), x] /; FreeQ[{a, b, c}, 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 4049
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c 
+ d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[1/(d*(m + n - 1)) 
 Int[(a + b*Tan[e + f*x])^(m - 3)*(c + d*Tan[e + f*x])^n*Simp[a^3*d*(m + n 
- 1) - b^2*(b*c*(m - 2) + a*d*(1 + n)) + b*d*(m + n - 1)*(3*a^2 - b^2)*Tan[ 
e + f*x] - b^2*(b*c*(m - 2) - a*d*(3*m + 2*n - 4))*Tan[e + f*x]^2, x], x], 
x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2 
, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 2] && (GeQ[n, -1] || I 
ntegerQ[m]) &&  !(IGtQ[n, 2] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])) 
)
 

rule 4100
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + 
 (f_.)*(x_)]^2), x_Symbol] :> Simp[A/(b*f)   Subst[Int[(a + x)^m, x], x, b* 
Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
 

rule 4109
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2 
)/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*A + b*B - a 
*C)*(x/(a^2 + b^2)), x] + (Simp[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2)   Int[( 
1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Simp[(A*b - a*B - b*C)/( 
a^2 + b^2)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] & 
& NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a*B - b*C 
, 0]
 
Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.17

method result size
derivativedivides \(\frac {\frac {\tan \left (f x +e \right ) d^{3}}{b}+\frac {\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{a^{2}+b^{2}}+\frac {\left (-a^{3} d^{3}+3 a^{2} b c \,d^{2}-3 a \,b^{2} c^{2} d +b^{3} c^{3}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{f}\) \(164\)
default \(\frac {\frac {\tan \left (f x +e \right ) d^{3}}{b}+\frac {\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{a^{2}+b^{2}}+\frac {\left (-a^{3} d^{3}+3 a^{2} b c \,d^{2}-3 a \,b^{2} c^{2} d +b^{3} c^{3}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{b^{2} \left (a^{2}+b^{2}\right )}}{f}\) \(164\)
norman \(\frac {\left (a \,c^{3}-3 a c \,d^{2}+3 b \,c^{2} d -b \,d^{3}\right ) x}{a^{2}+b^{2}}+\frac {d^{3} \tan \left (f x +e \right )}{f b}+\frac {\left (3 a \,c^{2} d -a \,d^{3}-b \,c^{3}+3 b c \,d^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a^{2}+b^{2}\right )}-\frac {\left (a^{3} d^{3}-3 a^{2} b c \,d^{2}+3 a \,b^{2} c^{2} d -b^{3} c^{3}\right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{\left (a^{2}+b^{2}\right ) b^{2} f}\) \(171\)
parallelrisch \(\frac {2 a \,b^{2} c^{3} f x -6 a \,b^{2} c \,d^{2} f x +6 b^{3} c^{2} d f x -2 b^{3} d^{3} f x +3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,b^{2} c^{2} d -\ln \left (1+\tan \left (f x +e \right )^{2}\right ) a \,b^{2} d^{3}-\ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{3} c^{3}+3 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{3} c \,d^{2}-2 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{3} d^{3}+6 \ln \left (a +b \tan \left (f x +e \right )\right ) a^{2} b c \,d^{2}-6 \ln \left (a +b \tan \left (f x +e \right )\right ) a \,b^{2} c^{2} d +2 \ln \left (a +b \tan \left (f x +e \right )\right ) b^{3} c^{3}+2 \tan \left (f x +e \right ) a^{2} b \,d^{3}+2 \tan \left (f x +e \right ) b^{3} d^{3}}{2 \left (a^{2}+b^{2}\right ) b^{2} f}\) \(252\)
risch \(\frac {6 i a \,c^{2} d x}{a^{2}+b^{2}}+\frac {2 i d^{3}}{f b \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {x \,c^{3}}{i b -a}+\frac {3 x c \,d^{2}}{i b -a}+\frac {6 i d^{2} c x}{b}-\frac {2 i b \,c^{3} e}{\left (a^{2}+b^{2}\right ) f}-\frac {2 i d^{3} a x}{b^{2}}-\frac {2 i d^{3} a e}{b^{2} f}+\frac {2 i a^{3} d^{3} x}{\left (a^{2}+b^{2}\right ) b^{2}}+\frac {6 i d^{2} c e}{b f}-\frac {6 i a^{2} c \,d^{2} x}{\left (a^{2}+b^{2}\right ) b}+\frac {2 i a^{3} d^{3} e}{\left (a^{2}+b^{2}\right ) b^{2} f}-\frac {6 i a^{2} c \,d^{2} e}{\left (a^{2}+b^{2}\right ) b f}-\frac {2 i b \,c^{3} x}{a^{2}+b^{2}}+\frac {3 i x \,c^{2} d}{i b -a}+\frac {6 i a \,c^{2} d e}{\left (a^{2}+b^{2}\right ) f}-\frac {i x \,d^{3}}{i b -a}+\frac {d^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a}{b^{2} f}-\frac {3 d^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) c}{b f}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{3} d^{3}}{\left (a^{2}+b^{2}\right ) b^{2} f}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a^{2} c \,d^{2}}{\left (a^{2}+b^{2}\right ) b f}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a \,c^{2} d}{\left (a^{2}+b^{2}\right ) f}+\frac {b \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) c^{3}}{\left (a^{2}+b^{2}\right ) f}\) \(563\)

Input:

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

Output:

1/f*(tan(f*x+e)*d^3/b+1/(a^2+b^2)*(1/2*(3*a*c^2*d-a*d^3-b*c^3+3*b*c*d^2)*l 
n(1+tan(f*x+e)^2)+(a*c^3-3*a*c*d^2+3*b*c^2*d-b*d^3)*arctan(tan(f*x+e)))+(- 
a^3*d^3+3*a^2*b*c*d^2-3*a*b^2*c^2*d+b^3*c^3)/b^2/(a^2+b^2)*ln(a+b*tan(f*x+ 
e)))
 

Fricas [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.44 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {2 \, {\left (a^{2} b + b^{3}\right )} d^{3} \tan \left (f x + e\right ) + 2 \, {\left (a b^{2} c^{3} + 3 \, b^{3} c^{2} d - 3 \, a b^{2} c d^{2} - b^{3} d^{3}\right )} f x + {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (3 \, {\left (a^{2} b + b^{3}\right )} c d^{2} - {\left (a^{3} + a b^{2}\right )} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a^{2} b^{2} + b^{4}\right )} f} \] Input:

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

Output:

1/2*(2*(a^2*b + b^3)*d^3*tan(f*x + e) + 2*(a*b^2*c^3 + 3*b^3*c^2*d - 3*a*b 
^2*c*d^2 - b^3*d^3)*f*x + (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d 
^3)*log((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)/(tan(f*x + e)^2 + 
1)) - (3*(a^2*b + b^3)*c*d^2 - (a^3 + a*b^2)*d^3)*log(1/(tan(f*x + e)^2 + 
1)))/((a^2*b^2 + b^4)*f)
 

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.78 (sec) , antiderivative size = 1712, normalized size of antiderivative = 12.23 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\text {Too large to display} \] Input:

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

Output:

Piecewise((zoo*x*(c + d*tan(e))**3/tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)) 
, ((c**3*x + 3*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*c*d**2*x + 3*c*d* 
*2*tan(e + f*x)/f - d**3*log(tan(e + f*x)**2 + 1)/(2*f) + d**3*tan(e + f*x 
)**2/(2*f))/a, Eq(b, 0)), (I*c**3*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2 
*I*b*f) + c**3*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) + I*c**3/(2*b*f*tan(e + 
f*x) - 2*I*b*f) + 3*c**2*d*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2*I*b*f) 
 - 3*I*c**2*d*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) - 3*c**2*d/(2*b*f*tan(e + 
 f*x) - 2*I*b*f) + 3*I*c*d**2*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2*I*b 
*f) + 3*c*d**2*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) + 3*c*d**2*log(tan(e + f 
*x)**2 + 1)*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2*I*b*f) - 3*I*c*d**2*log(t 
an(e + f*x)**2 + 1)/(2*b*f*tan(e + f*x) - 2*I*b*f) - 3*I*c*d**2/(2*b*f*tan 
(e + f*x) - 2*I*b*f) - 3*d**3*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2*I*b 
*f) + 3*I*d**3*f*x/(2*b*f*tan(e + f*x) - 2*I*b*f) + I*d**3*log(tan(e + f*x 
)**2 + 1)*tan(e + f*x)/(2*b*f*tan(e + f*x) - 2*I*b*f) + d**3*log(tan(e + f 
*x)**2 + 1)/(2*b*f*tan(e + f*x) - 2*I*b*f) + 2*d**3*tan(e + f*x)**2/(2*b*f 
*tan(e + f*x) - 2*I*b*f) + 3*d**3/(2*b*f*tan(e + f*x) - 2*I*b*f), Eq(a, -I 
*b)), (-I*c**3*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) + 2*I*b*f) + c**3*f*x/ 
(2*b*f*tan(e + f*x) + 2*I*b*f) - I*c**3/(2*b*f*tan(e + f*x) + 2*I*b*f) + 3 
*c**2*d*f*x*tan(e + f*x)/(2*b*f*tan(e + f*x) + 2*I*b*f) + 3*I*c**2*d*f*x/( 
2*b*f*tan(e + f*x) + 2*I*b*f) - 3*c**2*d/(2*b*f*tan(e + f*x) + 2*I*b*f)...
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.22 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {\frac {2 \, d^{3} \tan \left (f x + e\right )}{b} + \frac {2 \, {\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{2} b^{2} + b^{4}} - \frac {{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, f} \] Input:

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

Output:

1/2*(2*d^3*tan(f*x + e)/b + 2*(a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*(f*x 
 + e)/(a^2 + b^2) + 2*(b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - a^3*d^3)* 
log(b*tan(f*x + e) + a)/(a^2*b^2 + b^4) - (b*c^3 - 3*a*c^2*d - 3*b*c*d^2 + 
 a*d^3)*log(tan(f*x + e)^2 + 1)/(a^2 + b^2))/f
 

Giac [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.27 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {d^{3} \tan \left (f x + e\right )}{b f} + \frac {{\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )} {\left (f x + e\right )}}{a^{2} f + b^{2} f} - \frac {{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{2 \, {\left (a^{2} f + b^{2} f\right )}} + \frac {{\left (b^{3} c^{3} - 3 \, a b^{2} c^{2} d + 3 \, a^{2} b c d^{2} - a^{3} d^{3}\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b^{2} f + b^{4} f} \] Input:

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

Output:

d^3*tan(f*x + e)/(b*f) + (a*c^3 + 3*b*c^2*d - 3*a*c*d^2 - b*d^3)*(f*x + e) 
/(a^2*f + b^2*f) - 1/2*(b*c^3 - 3*a*c^2*d - 3*b*c*d^2 + a*d^3)*log(tan(f*x 
 + e)^2 + 1)/(a^2*f + b^2*f) + (b^3*c^3 - 3*a*b^2*c^2*d + 3*a^2*b*c*d^2 - 
a^3*d^3)*log(abs(b*tan(f*x + e) + a))/(a^2*b^2*f + b^4*f)
 

Mupad [B] (verification not implemented)

Time = 2.49 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.27 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {d^3\,\mathrm {tan}\left (e+f\,x\right )}{b\,f}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a^3\,d^3-3\,a^2\,b\,c\,d^2+3\,a\,b^2\,c^2\,d-b^3\,c^3\right )}{f\,\left (a^2\,b^2+b^4\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-c^3\,1{}\mathrm {i}+3\,c^2\,d+c\,d^2\,3{}\mathrm {i}-d^3\right )}{2\,f\,\left (a+b\,1{}\mathrm {i}\right )}+\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (-c^3+c^2\,d\,3{}\mathrm {i}+3\,c\,d^2-d^3\,1{}\mathrm {i}\right )}{2\,f\,\left (b+a\,1{}\mathrm {i}\right )} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 251, normalized size of antiderivative = 1.79 \[ \int \frac {(c+d \tan (e+f x))^3}{a+b \tan (e+f x)} \, dx=\frac {3 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a \,b^{2} c^{2} d -\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) a \,b^{2} d^{3}-\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b^{3} c^{3}+3 \,\mathrm {log}\left (\tan \left (f x +e \right )^{2}+1\right ) b^{3} c \,d^{2}-2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) a^{3} d^{3}+6 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) a^{2} b c \,d^{2}-6 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) a \,b^{2} c^{2} d +2 \,\mathrm {log}\left (\tan \left (f x +e \right ) b +a \right ) b^{3} c^{3}+2 \tan \left (f x +e \right ) a^{2} b \,d^{3}+2 \tan \left (f x +e \right ) b^{3} d^{3}+2 a \,b^{2} c^{3} f x -6 a \,b^{2} c \,d^{2} f x +6 b^{3} c^{2} d f x -2 b^{3} d^{3} f x}{2 b^{2} f \left (a^{2}+b^{2}\right )} \] Input:

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

Output:

(3*log(tan(e + f*x)**2 + 1)*a*b**2*c**2*d - log(tan(e + f*x)**2 + 1)*a*b** 
2*d**3 - log(tan(e + f*x)**2 + 1)*b**3*c**3 + 3*log(tan(e + f*x)**2 + 1)*b 
**3*c*d**2 - 2*log(tan(e + f*x)*b + a)*a**3*d**3 + 6*log(tan(e + f*x)*b + 
a)*a**2*b*c*d**2 - 6*log(tan(e + f*x)*b + a)*a*b**2*c**2*d + 2*log(tan(e + 
 f*x)*b + a)*b**3*c**3 + 2*tan(e + f*x)*a**2*b*d**3 + 2*tan(e + f*x)*b**3* 
d**3 + 2*a*b**2*c**3*f*x - 6*a*b**2*c*d**2*f*x + 6*b**3*c**2*d*f*x - 2*b** 
3*d**3*f*x)/(2*b**2*f*(a**2 + b**2))