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

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 = 85 \[ \int \frac {\tan ^6(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {x}{a-b}+\frac {a^{5/2} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{(a-b) b^{5/2} f}-\frac {(a+b) \tan (e+f x)}{b^2 f}+\frac {\tan ^3(e+f x)}{3 b f} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.18, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 4153, 381, 27, 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)}{a+b \tan ^2(e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan (e+f x)^6}{a+b \tan (e+f x)^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 )}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 381

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 444

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

\(\Big \downarrow \) 397

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 218

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

Input:

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

Output:

(Tan[e + f*x]^3/(3*b) - (-((-((b^2*ArcTan[Tan[e + f*x]])/(a - b)) + (a^(5/ 
2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/((a - b)*Sqrt[b]))/b) + ((a + b 
)*Tan[e + f*x])/b)/b)/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 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 381
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q 
+ 1)/(b*d*(m + 2*(p + q) + 1))), x] - Simp[e^4/(b*d*(m + 2*(p + q) + 1)) 
Int[(e*x)^(m - 4)*(a + b*x^2)^p*(c + d*x^2)^q*Simp[a*c*(m - 3) + (a*d*(m + 
2*q - 1) + b*c*(m + 2*p - 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, p, q 
}, x] && NeQ[b*c - a*d, 0] && 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.85 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {-\frac {-\frac {b \tan \left (f x +e \right )^{3}}{3}+a \tan \left (f x +e \right )+b \tan \left (f x +e \right )}{b^{2}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}+\frac {a^{3} \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{b^{2} \left (a -b \right ) \sqrt {a b}}}{f}\) \(88\)
default \(\frac {-\frac {-\frac {b \tan \left (f x +e \right )^{3}}{3}+a \tan \left (f x +e \right )+b \tan \left (f x +e \right )}{b^{2}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}+\frac {a^{3} \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{b^{2} \left (a -b \right ) \sqrt {a b}}}{f}\) \(88\)
risch \(-\frac {x}{a -b}-\frac {2 i \left (3 a \,{\mathrm e}^{4 i \left (f x +e \right )}+6 b \,{\mathrm e}^{4 i \left (f x +e \right )}+6 a \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b \,{\mathrm e}^{2 i \left (f x +e \right )}+3 a +4 b \right )}{3 f \,b^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}-\frac {\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 )}{2 b^{3} \left (a -b \right ) f}+\frac {\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 )}{2 b^{3} \left (a -b \right ) f}\) \(204\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 278, normalized size of antiderivative = 3.27 \[ \int \frac {\tan ^6(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\left [-\frac {12 \, b^{2} f x - 4 \, {\left (a b - b^{2}\right )} \tan \left (f x + e\right )^{3} + 3 \, a^{2} \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 ) + 12 \, {\left (a^{2} - b^{2}\right )} \tan \left (f x + e\right )}{12 \, {\left (a b^{2} - b^{3}\right )} f}, -\frac {6 \, b^{2} f x - 2 \, {\left (a b - b^{2}\right )} \tan \left (f x + e\right )^{3} - 3 \, a^{2} \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 ) + 6 \, {\left (a^{2} - b^{2}\right )} \tan \left (f x + e\right )}{6 \, {\left (a b^{2} - b^{3}\right )} f}\right ] \] Input:

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

Output:

[-1/12*(12*b^2*f*x - 4*(a*b - b^2)*tan(f*x + e)^3 + 3*a^2*sqrt(-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*tan(f*x + e)^2 + 
 a^2)) + 12*(a^2 - b^2)*tan(f*x + e))/((a*b^2 - b^3)*f), -1/6*(6*b^2*f*x - 
 2*(a*b - b^2)*tan(f*x + e)^3 - 3*a^2*sqrt(a/b)*arctan(1/2*(b*tan(f*x + e) 
^2 - a)*sqrt(a/b)/(a*tan(f*x + e))) + 6*(a^2 - b^2)*tan(f*x + e))/((a*b^2 
- b^3)*f)]
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 595 vs. \(2 (66) = 132\).

Time = 7.84 (sec) , antiderivative size = 595, normalized size of antiderivative = 7.00 \[ \int \frac {\tan ^6(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\begin {cases} \tilde {\infty } x \tan ^{4}{\left (e \right )} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {- x + \frac {\tan ^{5}{\left (e + f x \right )}}{5 f} - \frac {\tan ^{3}{\left (e + f x \right )}}{3 f} + \frac {\tan {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {x + \frac {\tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {\tan {\left (e + f x \right )}}{f}}{b} & \text {for}\: a = 0 \\\frac {15 f x \tan ^{2}{\left (e + f x \right )}}{6 b f \tan ^{2}{\left (e + f x \right )} + 6 b f} + \frac {15 f x}{6 b f \tan ^{2}{\left (e + f x \right )} + 6 b f} + \frac {2 \tan ^{5}{\left (e + f x \right )}}{6 b f \tan ^{2}{\left (e + f x \right )} + 6 b f} - \frac {10 \tan ^{3}{\left (e + f x \right )}}{6 b f \tan ^{2}{\left (e + f x \right )} + 6 b f} - \frac {15 \tan {\left (e + f x \right )}}{6 b f \tan ^{2}{\left (e + f x \right )} + 6 b f} & \text {for}\: a = b \\\frac {x \tan ^{6}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\\frac {3 a^{3} \log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} - \frac {3 a^{3} \log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} - \frac {6 a^{2} b \sqrt {- \frac {a}{b}} \tan {\left (e + f x \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} + \frac {2 a b^{2} \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} - \frac {6 b^{3} f x \sqrt {- \frac {a}{b}}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} - \frac {2 b^{3} \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} + \frac {6 b^{3} \sqrt {- \frac {a}{b}} \tan {\left (e + f x \right )}}{6 a b^{3} f \sqrt {- \frac {a}{b}} - 6 b^{4} f \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \] Input:

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

Output:

Piecewise((zoo*x*tan(e)**4, 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, Eq(b, 0)), (( 
x + tan(e + f*x)**3/(3*f) - tan(e + f*x)/f)/b, Eq(a, 0)), (15*f*x*tan(e + 
f*x)**2/(6*b*f*tan(e + f*x)**2 + 6*b*f) + 15*f*x/(6*b*f*tan(e + f*x)**2 + 
6*b*f) + 2*tan(e + f*x)**5/(6*b*f*tan(e + f*x)**2 + 6*b*f) - 10*tan(e + f* 
x)**3/(6*b*f*tan(e + f*x)**2 + 6*b*f) - 15*tan(e + f*x)/(6*b*f*tan(e + f*x 
)**2 + 6*b*f), Eq(a, b)), (x*tan(e)**6/(a + b*tan(e)**2), Eq(f, 0)), (3*a* 
*3*log(-sqrt(-a/b) + tan(e + f*x))/(6*a*b**3*f*sqrt(-a/b) - 6*b**4*f*sqrt( 
-a/b)) - 3*a**3*log(sqrt(-a/b) + tan(e + f*x))/(6*a*b**3*f*sqrt(-a/b) - 6* 
b**4*f*sqrt(-a/b)) - 6*a**2*b*sqrt(-a/b)*tan(e + f*x)/(6*a*b**3*f*sqrt(-a/ 
b) - 6*b**4*f*sqrt(-a/b)) + 2*a*b**2*sqrt(-a/b)*tan(e + f*x)**3/(6*a*b**3* 
f*sqrt(-a/b) - 6*b**4*f*sqrt(-a/b)) - 6*b**3*f*x*sqrt(-a/b)/(6*a*b**3*f*sq 
rt(-a/b) - 6*b**4*f*sqrt(-a/b)) - 2*b**3*sqrt(-a/b)*tan(e + f*x)**3/(6*a*b 
**3*f*sqrt(-a/b) - 6*b**4*f*sqrt(-a/b)) + 6*b**3*sqrt(-a/b)*tan(e + f*x)/( 
6*a*b**3*f*sqrt(-a/b) - 6*b**4*f*sqrt(-a/b)), True))
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

tan(e + f*x)^3/(3*b*f) + (2*atan((((((4*a*b^6 - 4*a^2*b^5 - 4*a^3*b^4 + 4* 
a^4*b^3)/b^3 - (tan(e + f*x)*(4*a*b^7 - 4*b^8 + 4*a^2*b^6 - 4*a^3*b^5)*2i) 
/(b^3*(2*a - 2*b)))*1i)/(2*a - 2*b) + (2*tan(e + f*x)*(a^6 + b^6))/b^3)/(2 
*a - 2*b) - ((((4*a*b^6 - 4*a^2*b^5 - 4*a^3*b^4 + 4*a^4*b^3)/b^3 + (tan(e 
+ f*x)*(4*a*b^7 - 4*b^8 + 4*a^2*b^6 - 4*a^3*b^5)*2i)/(b^3*(2*a - 2*b)))*1i 
)/(2*a - 2*b) - (2*tan(e + f*x)*(a^6 + b^6))/b^3)/(2*a - 2*b))/((((((4*a*b 
^6 - 4*a^2*b^5 - 4*a^3*b^4 + 4*a^4*b^3)/b^3 - (tan(e + f*x)*(4*a*b^7 - 4*b 
^8 + 4*a^2*b^6 - 4*a^3*b^5)*2i)/(b^3*(2*a - 2*b)))*1i)/(2*a - 2*b) + (2*ta 
n(e + f*x)*(a^6 + b^6))/b^3)*1i)/(2*a - 2*b) - (2*(a^4*b + a^5 + a^3*b^2)) 
/b^3 + (((((4*a*b^6 - 4*a^2*b^5 - 4*a^3*b^4 + 4*a^4*b^3)/b^3 + (tan(e + f* 
x)*(4*a*b^7 - 4*b^8 + 4*a^2*b^6 - 4*a^3*b^5)*2i)/(b^3*(2*a - 2*b)))*1i)/(2 
*a - 2*b) - (2*tan(e + f*x)*(a^6 + b^6))/b^3)*1i)/(2*a - 2*b))))/(f*(2*a - 
 2*b)) - (tan(e + f*x)*(a + b))/(b^2*f) - (atan(((((((4*a*b^6 - 4*a^2*b^5 
- 4*a^3*b^4 + 4*a^4*b^3)/b^3 + (tan(e + f*x)*(-a^5*b^5)^(1/2)*(4*a*b^7 - 4 
*b^8 + 4*a^2*b^6 - 4*a^3*b^5))/(b^3*(a*b^5 - b^6)))*(-a^5*b^5)^(1/2))/(2*( 
a*b^5 - b^6)) - (2*tan(e + f*x)*(a^6 + b^6))/b^3)*(-a^5*b^5)^(1/2)*1i)/(2* 
(a*b^5 - b^6)) - (((((4*a*b^6 - 4*a^2*b^5 - 4*a^3*b^4 + 4*a^4*b^3)/b^3 - ( 
tan(e + f*x)*(-a^5*b^5)^(1/2)*(4*a*b^7 - 4*b^8 + 4*a^2*b^6 - 4*a^3*b^5))/( 
b^3*(a*b^5 - b^6)))*(-a^5*b^5)^(1/2))/(2*(a*b^5 - b^6)) + (2*tan(e + f*x)* 
(a^6 + b^6))/b^3)*(-a^5*b^5)^(1/2)*1i)/(2*(a*b^5 - b^6)))/((((((4*a*b^6...
 

Reduce [B] (verification not implemented)

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

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

Output:

(3*sqrt(b)*sqrt(a)*atan((tan(e + f*x)*b)/(sqrt(b)*sqrt(a)))*a**2 + tan(e + 
 f*x)**3*a*b**2 - tan(e + f*x)**3*b**3 - 3*tan(e + f*x)*a**2*b + 3*tan(e + 
 f*x)*b**3 - 3*b**3*f*x)/(3*b**3*f*(a - b))