\(\int \frac {\tan ^6(e+f x)}{(a+b \tan ^2(e+f x))^2} \, dx\) [230]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [B] (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 = 23, antiderivative size = 130 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=-\frac {x}{(a-b)^2}-\frac {a^{3/2} (3 a-5 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{2 (a-b)^2 b^{5/2} f}+\frac {(3 a-2 b) \tan (e+f x)}{2 (a-b) b^2 f}-\frac {a \tan ^3(e+f x)}{2 (a-b) b f \left (a+b \tan ^2(e+f x)\right )} \] Output:

-x/(a-b)^2-1/2*a^(3/2)*(3*a-5*b)*arctan(b^(1/2)*tan(f*x+e)/a^(1/2))/(a-b)^ 
2/b^(5/2)/f+1/2*(3*a-2*b)*tan(f*x+e)/(a-b)/b^2/f-1/2*a*tan(f*x+e)^3/(a-b)/ 
b/f/(a+b*tan(f*x+e)^2)
 

Mathematica [A] (verified)

Time = 0.85 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.91 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {-\frac {2 (e+f x)}{(a-b)^2}-\frac {a^{3/2} (3 a-5 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{(a-b)^2 b^{5/2}}+\frac {a^2 \sin (2 (e+f x))}{(a-b) b^2 (a+b+(a-b) \cos (2 (e+f x)))}+\frac {2 \tan (e+f x)}{b^2}}{2 f} \] Input:

Integrate[Tan[e + f*x]^6/(a + b*Tan[e + f*x]^2)^2,x]
 

Output:

((-2*(e + f*x))/(a - b)^2 - (a^(3/2)*(3*a - 5*b)*ArcTan[(Sqrt[b]*Tan[e + f 
*x])/Sqrt[a]])/((a - b)^2*b^(5/2)) + (a^2*Sin[2*(e + f*x)])/((a - b)*b^2*( 
a + b + (a - b)*Cos[2*(e + f*x)])) + (2*Tan[e + f*x])/b^2)/(2*f)
 

Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.09, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 4153, 372, 444, 397, 216, 218}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 372

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

\(\Big \downarrow \) 444

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

\(\Big \downarrow \) 397

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {(3 a-2 b) \tan (e+f x)}{b}-\frac {\frac {a^{3/2} (3 a-5 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {b} (a-b)}+\frac {2 b^2 \arctan (\tan (e+f x))}{a-b}}{b}}{2 b (a-b)}-\frac {a \tan ^3(e+f x)}{2 b (a-b) \left (a+b \tan ^2(e+f x)\right )}}{f}\)

Input:

Int[Tan[e + f*x]^6/(a + b*Tan[e + f*x]^2)^2,x]
 

Output:

((-(((2*b^2*ArcTan[Tan[e + f*x]])/(a - b) + (a^(3/2)*(3*a - 5*b)*ArcTan[(S 
qrt[b]*Tan[e + f*x])/Sqrt[a]])/((a - b)*Sqrt[b]))/b) + ((3*a - 2*b)*Tan[e 
+ f*x])/b)/(2*(a - b)*b) - (a*Tan[e + f*x]^3)/(2*(a - b)*b*(a + b*Tan[e + 
f*x]^2)))/f
 

Defintions of rubi rules used

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 372
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[(-a)*e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2 
)^(q + 1)/(2*b*(b*c - a*d)*(p + 1))), x] + Simp[e^4/(2*b*(b*c - a*d)*(p + 1 
))   Int[(e*x)^(m - 4)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[a*c*(m - 3) + 
 (a*d*(m + 2*q - 1) + 2*b*c*(p + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, 
e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 3] && IntBinomialQ[a 
, b, c, d, e, m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 444
Int[((g_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q 
_.)*((e_) + (f_.)*(x_)^2), x_Symbol] :> Simp[f*g*(g*x)^(m - 1)*(a + b*x^2)^ 
(p + 1)*((c + d*x^2)^(q + 1)/(b*d*(m + 2*(p + q + 1) + 1))), x] - Simp[g^2/ 
(b*d*(m + 2*(p + q + 1) + 1))   Int[(g*x)^(m - 2)*(a + b*x^2)^p*(c + d*x^2) 
^q*Simp[a*f*c*(m - 1) + (a*f*d*(m + 2*q + 1) + b*(f*c*(m + 2*p + 1) - e*d*( 
m + 2*(p + q + 1) + 1)))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, 
q}, x] && GtQ[m, 1]
 

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

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
Maple [A] (verified)

Time = 0.91 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.80

method result size
derivativedivides \(\frac {\frac {\tan \left (f x +e \right )}{b^{2}}-\frac {a^{2} \left (\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{a +b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a -5 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{\left (a -b \right )^{2} b^{2}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{\left (a -b \right )^{2}}}{f}\) \(104\)
default \(\frac {\frac {\tan \left (f x +e \right )}{b^{2}}-\frac {a^{2} \left (\frac {\left (-\frac {a}{2}+\frac {b}{2}\right ) \tan \left (f x +e \right )}{a +b \tan \left (f x +e \right )^{2}}+\frac {\left (3 a -5 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{2 \sqrt {a b}}\right )}{\left (a -b \right )^{2} b^{2}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{\left (a -b \right )^{2}}}{f}\) \(104\)
risch \(-\frac {x}{a^{2}-2 a b +b^{2}}+\frac {i \left (3 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}-5 a^{2} b \,{\mathrm e}^{4 i \left (f x +e \right )}+6 a \,b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-2 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}+6 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}-4 a^{2} b \,{\mathrm e}^{2 i \left (f x +e \right )}-4 a \,b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+4 b^{3} {\mathrm e}^{2 i \left (f x +e \right )}+3 a^{3}-7 a^{2} b +6 a \,b^{2}-2 b^{3}\right )}{f \,b^{2} \left (a -b \right )^{2} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a -b \right ) \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {3 \sqrt {-a b}\, a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 b^{3} \left (a -b \right )^{2} f}+\frac {5 \sqrt {-a b}\, a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{4 b^{2} \left (a -b \right )^{2} f}+\frac {3 \sqrt {-a b}\, a^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 b^{3} \left (a -b \right )^{2} f}-\frac {5 \sqrt {-a b}\, a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{4 b^{2} \left (a -b \right )^{2} f}\) \(466\)

Input:

int(tan(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 

Output:

1/f*(tan(f*x+e)/b^2-a^2/(a-b)^2/b^2*((-1/2*a+1/2*b)*tan(f*x+e)/(a+b*tan(f* 
x+e)^2)+1/2*(3*a-5*b)/(a*b)^(1/2)*arctan(b*tan(f*x+e)/(a*b)^(1/2)))-1/(a-b 
)^2*arctan(tan(f*x+e)))
 

Fricas [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 474, normalized size of antiderivative = 3.65 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\left [-\frac {8 \, b^{3} f x \tan \left (f x + e\right )^{2} + 8 \, a b^{2} f x - 8 \, {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (3 \, a^{3} - 5 \, a^{2} b + {\left (3 \, a^{2} b - 5 \, a b^{2}\right )} \tan \left (f x + e\right )^{2}\right )} \sqrt {-\frac {a}{b}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} + 4 \, {\left (b^{2} \tan \left (f x + e\right )^{3} - a b \tan \left (f x + e\right )\right )} \sqrt {-\frac {a}{b}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) - 4 \, {\left (3 \, a^{3} - 5 \, a^{2} b + 2 \, a b^{2}\right )} \tan \left (f x + e\right )}{8 \, {\left ({\left (a^{2} b^{3} - 2 \, a b^{4} + b^{5}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4}\right )} f\right )}}, -\frac {4 \, b^{3} f x \tan \left (f x + e\right )^{2} + 4 \, a b^{2} f x - 4 \, {\left (a^{2} b - 2 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (3 \, a^{3} - 5 \, a^{2} b + {\left (3 \, a^{2} b - 5 \, a b^{2}\right )} \tan \left (f x + e\right )^{2}\right )} \sqrt {\frac {a}{b}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {a}{b}}}{2 \, a \tan \left (f x + e\right )}\right ) - 2 \, {\left (3 \, a^{3} - 5 \, a^{2} b + 2 \, a b^{2}\right )} \tan \left (f x + e\right )}{4 \, {\left ({\left (a^{2} b^{3} - 2 \, a b^{4} + b^{5}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4}\right )} f\right )}}\right ] \] Input:

integrate(tan(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")
 

Output:

[-1/8*(8*b^3*f*x*tan(f*x + e)^2 + 8*a*b^2*f*x - 8*(a^2*b - 2*a*b^2 + b^3)* 
tan(f*x + e)^3 + (3*a^3 - 5*a^2*b + (3*a^2*b - 5*a*b^2)*tan(f*x + e)^2)*sq 
rt(-a/b)*log((b^2*tan(f*x + e)^4 - 6*a*b*tan(f*x + e)^2 + a^2 + 4*(b^2*tan 
(f*x + e)^3 - a*b*tan(f*x + e))*sqrt(-a/b))/(b^2*tan(f*x + e)^4 + 2*a*b*ta 
n(f*x + e)^2 + a^2)) - 4*(3*a^3 - 5*a^2*b + 2*a*b^2)*tan(f*x + e))/((a^2*b 
^3 - 2*a*b^4 + b^5)*f*tan(f*x + e)^2 + (a^3*b^2 - 2*a^2*b^3 + a*b^4)*f), - 
1/4*(4*b^3*f*x*tan(f*x + e)^2 + 4*a*b^2*f*x - 4*(a^2*b - 2*a*b^2 + b^3)*ta 
n(f*x + e)^3 + (3*a^3 - 5*a^2*b + (3*a^2*b - 5*a*b^2)*tan(f*x + e)^2)*sqrt 
(a/b)*arctan(1/2*(b*tan(f*x + e)^2 - a)*sqrt(a/b)/(a*tan(f*x + e))) - 2*(3 
*a^3 - 5*a^2*b + 2*a*b^2)*tan(f*x + e))/((a^2*b^3 - 2*a*b^4 + b^5)*f*tan(f 
*x + e)^2 + (a^3*b^2 - 2*a^2*b^3 + a*b^4)*f)]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2859 vs. \(2 (102) = 204\).

Time = 23.93 (sec) , antiderivative size = 2859, normalized size of antiderivative = 21.99 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \] Input:

integrate(tan(f*x+e)**6/(a+b*tan(f*x+e)**2)**2,x)
 

Output:

Piecewise((zoo*x*tan(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((-x + tan(e 
+ f*x)**5/(5*f) - tan(e + f*x)**3/(3*f) + tan(e + f*x)/f)/a**2, Eq(b, 0)), 
 ((-x + tan(e + f*x)/f)/b**2, Eq(a, 0)), (-15*f*x*tan(e + f*x)**4/(8*b**2* 
f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x)**2 + 8*b**2*f) - 30*f*x*tan(e + 
 f*x)**2/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x)**2 + 8*b**2*f) 
 - 15*f*x/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x)**2 + 8*b**2*f 
) + 8*tan(e + f*x)**5/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*tan(e + f*x)** 
2 + 8*b**2*f) + 25*tan(e + f*x)**3/(8*b**2*f*tan(e + f*x)**4 + 16*b**2*f*t 
an(e + f*x)**2 + 8*b**2*f) + 15*tan(e + f*x)/(8*b**2*f*tan(e + f*x)**4 + 1 
6*b**2*f*tan(e + f*x)**2 + 8*b**2*f), Eq(a, b)), (x*tan(e)**6/(a + b*tan(e 
)**2)**2, Eq(f, 0)), (-3*a**4*log(-sqrt(-a/b) + tan(e + f*x))/(4*a**3*b**3 
*f*sqrt(-a/b) + 4*a**2*b**4*f*sqrt(-a/b)*tan(e + f*x)**2 - 8*a**2*b**4*f*s 
qrt(-a/b) - 8*a*b**5*f*sqrt(-a/b)*tan(e + f*x)**2 + 4*a*b**5*f*sqrt(-a/b) 
+ 4*b**6*f*sqrt(-a/b)*tan(e + f*x)**2) + 3*a**4*log(sqrt(-a/b) + tan(e + f 
*x))/(4*a**3*b**3*f*sqrt(-a/b) + 4*a**2*b**4*f*sqrt(-a/b)*tan(e + f*x)**2 
- 8*a**2*b**4*f*sqrt(-a/b) - 8*a*b**5*f*sqrt(-a/b)*tan(e + f*x)**2 + 4*a*b 
**5*f*sqrt(-a/b) + 4*b**6*f*sqrt(-a/b)*tan(e + f*x)**2) + 6*a**3*b*sqrt(-a 
/b)*tan(e + f*x)/(4*a**3*b**3*f*sqrt(-a/b) + 4*a**2*b**4*f*sqrt(-a/b)*tan( 
e + f*x)**2 - 8*a**2*b**4*f*sqrt(-a/b) - 8*a*b**5*f*sqrt(-a/b)*tan(e + f*x 
)**2 + 4*a*b**5*f*sqrt(-a/b) + 4*b**6*f*sqrt(-a/b)*tan(e + f*x)**2) - 3...
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.04 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {\frac {a^{2} \tan \left (f x + e\right )}{a^{2} b^{2} - a b^{3} + {\left (a b^{3} - b^{4}\right )} \tan \left (f x + e\right )^{2}} - \frac {{\left (3 \, a^{3} - 5 \, a^{2} b\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} \sqrt {a b}} - \frac {2 \, {\left (f x + e\right )}}{a^{2} - 2 \, a b + b^{2}} + \frac {2 \, \tan \left (f x + e\right )}{b^{2}}}{2 \, f} \] Input:

integrate(tan(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")
 

Output:

1/2*(a^2*tan(f*x + e)/(a^2*b^2 - a*b^3 + (a*b^3 - b^4)*tan(f*x + e)^2) - ( 
3*a^3 - 5*a^2*b)*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^2*b^2 - 2*a*b^3 + b^ 
4)*sqrt(a*b)) - 2*(f*x + e)/(a^2 - 2*a*b + b^2) + 2*tan(f*x + e)/b^2)/f
 

Giac [A] (verification not implemented)

Time = 0.64 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.04 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {a^{2} \tan \left (f x + e\right )}{2 \, {\left (a b^{2} f - b^{3} f\right )} {\left (b \tan \left (f x + e\right )^{2} + a\right )}} - \frac {{\left (3 \, a^{3} - 5 \, a^{2} b\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{2 \, {\left (a^{2} b^{2} f - 2 \, a b^{3} f + b^{4} f\right )} \sqrt {a b}} - \frac {f x + e}{a^{2} f - 2 \, a b f + b^{2} f} + \frac {\tan \left (f x + e\right )}{b^{2} f} \] Input:

integrate(tan(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")
 

Output:

1/2*a^2*tan(f*x + e)/((a*b^2*f - b^3*f)*(b*tan(f*x + e)^2 + a)) - 1/2*(3*a 
^3 - 5*a^2*b)*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^2*b^2*f - 2*a*b^3*f + b 
^4*f)*sqrt(a*b)) - (f*x + e)/(a^2*f - 2*a*b*f + b^2*f) + tan(f*x + e)/(b^2 
*f)
 

Mupad [B] (verification not implemented)

Time = 9.26 (sec) , antiderivative size = 2581, normalized size of antiderivative = 19.85 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \] Input:

int(tan(e + f*x)^6/(a + b*tan(e + f*x)^2)^2,x)
 

Output:

(2*atan((((((4*a*b^8 - 22*a^2*b^7 + 48*a^3*b^6 - 52*a^4*b^5 + 28*a^5*b^4 - 
 6*a^6*b^3)*1i)/(3*a*b^5 - b^6 - 3*a^2*b^4 + a^3*b^3) - (tan(e + f*x)*(16* 
b^10 - 48*a*b^9 + 32*a^2*b^8 + 32*a^3*b^7 - 48*a^4*b^6 + 16*a^5*b^5))/(2*( 
b^5 - 2*a*b^4 + a^2*b^3)*(2*a^2 - 4*a*b + 2*b^2)))/(2*a^2 - 4*a*b + 2*b^2) 
 + (tan(e + f*x)*(9*a^6 - 30*a^5*b + 4*b^6 + 25*a^4*b^2))/(2*(b^5 - 2*a*b^ 
4 + a^2*b^3)))/(2*a^2 - 4*a*b + 2*b^2) - ((((4*a*b^8 - 22*a^2*b^7 + 48*a^3 
*b^6 - 52*a^4*b^5 + 28*a^5*b^4 - 6*a^6*b^3)*1i)/(3*a*b^5 - b^6 - 3*a^2*b^4 
 + a^3*b^3) + (tan(e + f*x)*(16*b^10 - 48*a*b^9 + 32*a^2*b^8 + 32*a^3*b^7 
- 48*a^4*b^6 + 16*a^5*b^5))/(2*(b^5 - 2*a*b^4 + a^2*b^3)*(2*a^2 - 4*a*b + 
2*b^2)))/(2*a^2 - 4*a*b + 2*b^2) - (tan(e + f*x)*(9*a^6 - 30*a^5*b + 4*b^6 
 + 25*a^4*b^2))/(2*(b^5 - 2*a*b^4 + a^2*b^3)))/(2*a^2 - 4*a*b + 2*b^2))/(( 
((((4*a*b^8 - 22*a^2*b^7 + 48*a^3*b^6 - 52*a^4*b^5 + 28*a^5*b^4 - 6*a^6*b^ 
3)*1i)/(3*a*b^5 - b^6 - 3*a^2*b^4 + a^3*b^3) - (tan(e + f*x)*(16*b^10 - 48 
*a*b^9 + 32*a^2*b^8 + 32*a^3*b^7 - 48*a^4*b^6 + 16*a^5*b^5))/(2*(b^5 - 2*a 
*b^4 + a^2*b^3)*(2*a^2 - 4*a*b + 2*b^2)))*1i)/(2*a^2 - 4*a*b + 2*b^2) + (t 
an(e + f*x)*(9*a^6 - 30*a^5*b + 4*b^6 + 25*a^4*b^2)*1i)/(2*(b^5 - 2*a*b^4 
+ a^2*b^3)))/(2*a^2 - 4*a*b + 2*b^2) - ((9*a^5)/2 - (21*a^4*b)/2 + 5*a^2*b 
^3 + 2*a^3*b^2)/(3*a*b^5 - b^6 - 3*a^2*b^4 + a^3*b^3) + (((((4*a*b^8 - 22* 
a^2*b^7 + 48*a^3*b^6 - 52*a^4*b^5 + 28*a^5*b^4 - 6*a^6*b^3)*1i)/(3*a*b^5 - 
 b^6 - 3*a^2*b^4 + a^3*b^3) + (tan(e + f*x)*(16*b^10 - 48*a*b^9 + 32*a^...
 

Reduce [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 292, normalized size of antiderivative = 2.25 \[ \int \frac {\tan ^6(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^2} \, dx=\frac {-3 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) \tan \left (f x +e \right )^{2} a^{2} b +5 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) \tan \left (f x +e \right )^{2} a \,b^{2}-3 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) a^{3}+5 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tan \left (f x +e \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) a^{2} b +2 \tan \left (f x +e \right )^{3} a^{2} b^{2}-4 \tan \left (f x +e \right )^{3} a \,b^{3}+2 \tan \left (f x +e \right )^{3} b^{4}-2 \tan \left (f x +e \right )^{2} b^{4} f x +3 \tan \left (f x +e \right ) a^{3} b -5 \tan \left (f x +e \right ) a^{2} b^{2}+2 \tan \left (f x +e \right ) a \,b^{3}-2 a \,b^{3} f x}{2 b^{3} f \left (\tan \left (f x +e \right )^{2} a^{2} b -2 \tan \left (f x +e \right )^{2} a \,b^{2}+\tan \left (f x +e \right )^{2} b^{3}+a^{3}-2 a^{2} b +a \,b^{2}\right )} \] Input:

int(tan(f*x+e)^6/(a+b*tan(f*x+e)^2)^2,x)
 

Output:

( - 3*sqrt(b)*sqrt(a)*atan((tan(e + f*x)*b)/(sqrt(b)*sqrt(a)))*tan(e + f*x 
)**2*a**2*b + 5*sqrt(b)*sqrt(a)*atan((tan(e + f*x)*b)/(sqrt(b)*sqrt(a)))*t 
an(e + f*x)**2*a*b**2 - 3*sqrt(b)*sqrt(a)*atan((tan(e + f*x)*b)/(sqrt(b)*s 
qrt(a)))*a**3 + 5*sqrt(b)*sqrt(a)*atan((tan(e + f*x)*b)/(sqrt(b)*sqrt(a))) 
*a**2*b + 2*tan(e + f*x)**3*a**2*b**2 - 4*tan(e + f*x)**3*a*b**3 + 2*tan(e 
 + f*x)**3*b**4 - 2*tan(e + f*x)**2*b**4*f*x + 3*tan(e + f*x)*a**3*b - 5*t 
an(e + f*x)*a**2*b**2 + 2*tan(e + f*x)*a*b**3 - 2*a*b**3*f*x)/(2*b**3*f*(t 
an(e + f*x)**2*a**2*b - 2*tan(e + f*x)**2*a*b**2 + tan(e + f*x)**2*b**3 + 
a**3 - 2*a**2*b + a*b**2))