\(\int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx\) [1267]

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

Optimal result

Integrand size = 27, antiderivative size = 312 \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=-\frac {2 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \arctan \left (\frac {a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4-2 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \tan (e+f x)}{\left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \sqrt {3+4 \tan (e+f x)}}\right )}{5 f}+\frac {\left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right ) \text {arctanh}\left (\frac {2+\tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}}\right )}{5 f}+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {3+4 \tan (e+f x)}}{20 f}+\frac {(14 a-3 b) b^3 \tan (e+f x) \sqrt {3+4 \tan (e+f x)}}{30 f}+\frac {b^2 \sqrt {3+4 \tan (e+f x)} (a+b \tan (e+f x))^2}{10 f} \] Output:

-2/5*(a^4+2*a^3*b-6*a^2*b^2-2*a*b^3+b^4)*arctan((a^4+2*a^3*b-6*a^2*b^2-2*a 
*b^3+b^4-2*(a^4+2*a^3*b-6*a^2*b^2-2*a*b^3+b^4)*tan(f*x+e))/(a^4+2*a^3*b-6* 
a^2*b^2-2*a*b^3+b^4)/(3+4*tan(f*x+e))^(1/2))/f+1/5*(a^4-8*a^3*b-6*a^2*b^2+ 
8*a*b^3+b^4)*arctanh((2+tan(f*x+e))/(3+4*tan(f*x+e))^(1/2))/f+1/20*b^2*(58 
*a^2-20*a*b-7*b^2)*(3+4*tan(f*x+e))^(1/2)/f+1/30*(14*a-3*b)*b^3*tan(f*x+e) 
*(3+4*tan(f*x+e))^(1/2)/f+1/10*b^2*(3+4*tan(f*x+e))^(1/2)*(a+b*tan(f*x+e)) 
^2/f
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.73 (sec) , antiderivative size = 145, normalized size of antiderivative = 0.46 \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {(24-12 i) (a+i b)^4 \arctan \left (\left (\frac {1}{5}+\frac {2 i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )+(12-24 i) (a-i b)^4 \text {arctanh}\left (\left (\frac {2}{5}+\frac {i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )+b^2 \sqrt {3+4 \tan (e+f x)} \left (3 \left (60 a^2-20 a b-7 b^2\right )+2 (20 a-3 b) b \tan (e+f x)+6 b^2 \tan ^2(e+f x)\right )}{60 f} \] Input:

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

Output:

((24 - 12*I)*(a + I*b)^4*ArcTan[(1/5 + (2*I)/5)*Sqrt[3 + 4*Tan[e + f*x]]] 
+ (12 - 24*I)*(a - I*b)^4*ArcTanh[(2/5 + I/5)*Sqrt[3 + 4*Tan[e + f*x]]] + 
b^2*Sqrt[3 + 4*Tan[e + f*x]]*(3*(60*a^2 - 20*a*b - 7*b^2) + 2*(20*a - 3*b) 
*b*Tan[e + f*x] + 6*b^2*Tan[e + f*x]^2))/(60*f)
 

Rubi [A] (verified)

Time = 1.51 (sec) , antiderivative size = 403, normalized size of antiderivative = 1.29, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {3042, 4049, 27, 3042, 4120, 27, 3042, 4113, 3042, 4019, 27, 3042, 4018, 216, 220}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4049

\(\displaystyle \frac {1}{10} \int \frac {2 (a+b \tan (e+f x)) \left (5 a^3+(14 a-3 b) b^2 \tan ^2(e+f x)-b^2 (a+3 b)+5 b \left (3 a^2-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{5} \int \frac {(a+b \tan (e+f x)) \left (5 a^3+(14 a-3 b) b^2 \tan ^2(e+f x)-b^2 (a+3 b)+5 b \left (3 a^2-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \int \frac {(a+b \tan (e+f x)) \left (5 a^3+(14 a-3 b) b^2 \tan (e+f x)^2-b^2 (a+3 b)+5 b \left (3 a^2-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 4120

\(\displaystyle \frac {1}{5} \left (\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}-\frac {1}{6} \int -\frac {3 \left (10 a^4-2 b^2 a^2-20 b^3 a+40 b \left (a^2-b^2\right ) \tan (e+f x) a+3 b^4+b^2 \left (58 a^2-20 b a-7 b^2\right ) \tan ^2(e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \int \frac {10 a^4-2 b^2 a^2-20 b^3 a+40 b \left (a^2-b^2\right ) \tan (e+f x) a+3 b^4+b^2 \left (58 a^2-20 b a-7 b^2\right ) \tan ^2(e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \int \frac {10 a^4-2 b^2 a^2-20 b^3 a+40 b \left (a^2-b^2\right ) \tan (e+f x) a+3 b^4+b^2 \left (58 a^2-20 b a-7 b^2\right ) \tan (e+f x)^2}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 4113

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (\int \frac {10 \left (a^4-6 b^2 a^2+b^4\right )+40 a b \left (a^2-b^2\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (\int \frac {10 \left (a^4-6 b^2 a^2+b^4\right )+40 a b \left (a^2-b^2\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 4019

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (\frac {1}{10} \int \frac {40 \left (\tan (e+f x) \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )+2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )\right )}{\sqrt {4 \tan (e+f x)+3}}dx-\frac {1}{10} \int -\frac {20 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4-2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (4 \int \frac {\tan (e+f x) \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )+2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )}{\sqrt {4 \tan (e+f x)+3}}dx+2 \int \frac {a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4-2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (4 \int \frac {\tan (e+f x) \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )+2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )}{\sqrt {4 \tan (e+f x)+3}}dx+2 \int \frac {a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4-2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right ) \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 4018

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (-\frac {8 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right )^2 \int \frac {1}{4 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right )^2+\frac {4 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4-2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right ) \tan (e+f x)\right )^2}{4 \tan (e+f x)+3}}d\frac {2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4-2 \left (a^4+2 b a^3-6 b^2 a^2-2 b^3 a+b^4\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}}{f}-\frac {16 \left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right )^2 \int \frac {1}{\frac {64 \left (\tan (e+f x) \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )+2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )\right )^2}{4 \tan (e+f x)+3}-64 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )^2}d\frac {8 \left (\tan (e+f x) \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )+2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{f}+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (-\frac {16 \left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right )^2 \int \frac {1}{\frac {64 \left (\tan (e+f x) \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )+2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )\right )^2}{4 \tan (e+f x)+3}-64 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )^2}d\frac {8 \left (\tan (e+f x) \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )+2 \left (a^4-8 b a^3-6 b^2 a^2+8 b^3 a+b^4\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{f}+\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}-\frac {4 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \arctan \left (\frac {a^4+2 a^3 b-6 a^2 b^2-2 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \tan (e+f x)-2 a b^3+b^4}{\left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

\(\Big \downarrow \) 220

\(\displaystyle \frac {1}{5} \left (\frac {1}{2} \left (\frac {b^2 \left (58 a^2-20 a b-7 b^2\right ) \sqrt {4 \tan (e+f x)+3}}{2 f}-\frac {4 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \arctan \left (\frac {a^4+2 a^3 b-6 a^2 b^2-2 \left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \tan (e+f x)-2 a b^3+b^4}{\left (a^4+2 a^3 b-6 a^2 b^2-2 a b^3+b^4\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{f}+\frac {2 \left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right ) \text {arctanh}\left (\frac {\left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right ) \tan (e+f x)+2 \left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right )}{\left (a^4-8 a^3 b-6 a^2 b^2+8 a b^3+b^4\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{f}\right )+\frac {b^3 (14 a-3 b) \tan (e+f x) \sqrt {4 \tan (e+f x)+3}}{6 f}\right )+\frac {b^2 \sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2}{10 f}\)

Input:

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

Output:

(b^2*Sqrt[3 + 4*Tan[e + f*x]]*(a + b*Tan[e + f*x])^2)/(10*f) + (((14*a - 3 
*b)*b^3*Tan[e + f*x]*Sqrt[3 + 4*Tan[e + f*x]])/(6*f) + ((-4*(a^4 + 2*a^3*b 
 - 6*a^2*b^2 - 2*a*b^3 + b^4)*ArcTan[(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 
+ b^4 - 2*(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + b^4)*Tan[e + f*x])/((a^4 
+ 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + b^4)*Sqrt[3 + 4*Tan[e + f*x]])])/f + (2* 
(a^4 - 8*a^3*b - 6*a^2*b^2 + 8*a*b^3 + b^4)*ArcTanh[(2*(a^4 - 8*a^3*b - 6* 
a^2*b^2 + 8*a*b^3 + b^4) + (a^4 - 8*a^3*b - 6*a^2*b^2 + 8*a*b^3 + b^4)*Tan 
[e + f*x])/((a^4 - 8*a^3*b - 6*a^2*b^2 + 8*a*b^3 + b^4)*Sqrt[3 + 4*Tan[e + 
 f*x]])])/f + (b^2*(58*a^2 - 20*a*b - 7*b^2)*Sqrt[3 + 4*Tan[e + f*x]])/(2* 
f))/2)/5
 

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 220
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(- 
1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && 
 (LtQ[a, 0] || GtQ[b, 0])
 

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

rule 4018
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + ( 
f_.)*(x_)]], x_Symbol] :> Simp[-2*(d^2/f)   Subst[Int[1/(2*b*c*d - 4*a*d^2 
+ x^2), x], x, (b*c - 2*a*d - b*d*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]]], 
x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0 
] && NeQ[c^2 + d^2, 0] && EqQ[2*a*c*d - b*(c^2 - d^2), 0]
 

rule 4019
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/Sqrt[(a_) + (b_.)*tan[(e_.) + ( 
f_.)*(x_)]], x_Symbol] :> With[{q = Rt[a^2 + b^2, 2]}, Simp[1/(2*q)   Int[( 
a*c + b*d + c*q + (b*c - a*d + d*q)*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]], 
 x], x] - Simp[1/(2*q)   Int[(a*c + b*d - c*q + (b*c - a*d - d*q)*Tan[e + f 
*x])/Sqrt[a + b*Tan[e + f*x]], x], x]] /; FreeQ[{a, b, c, d, e, f}, x] && N 
eQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && NeQ[2*a*c*d - 
 b*(c^2 - d^2), 0] && NiceSqrtQ[a^2 + b^2]
 

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 4113
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) 
+ (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[C*((a + 
 b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Si 
mp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && 
NeQ[A*b^2 - a*b*B + a^2*C, 0] &&  !LeQ[m, -1]
 

rule 4120
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f 
_.)*(x_)]^2), x_Symbol] :> Simp[b*C*Tan[e + f*x]*((c + d*Tan[e + f*x])^(n + 
 1)/(d*f*(n + 2))), x] - Simp[1/(d*(n + 2))   Int[(c + d*Tan[e + f*x])^n*Si 
mp[b*c*C - a*A*d*(n + 2) - (A*b + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C* 
d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, 
b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && 
  !LtQ[n, -1]
 
Maple [A] (verified)

Time = 0.39 (sec) , antiderivative size = 325, normalized size of antiderivative = 1.04

method result size
derivativedivides \(\frac {\frac {b^{4} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {5}{2}}}{160}+\frac {a \,b^{3} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{6}-\frac {b^{4} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{16}+3 \sqrt {3+4 \tan \left (f x +e \right )}\, a^{2} b^{2}-\frac {3 \sqrt {3+4 \tan \left (f x +e \right )}\, a \,b^{3}}{2}-\frac {7 \sqrt {3+4 \tan \left (f x +e \right )}\, b^{4}}{32}+\frac {\left (32 a^{4}-256 a^{3} b -192 a^{2} b^{2}+256 a \,b^{3}+32 b^{4}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{320}+\frac {\left (64 a^{4}+128 a^{3} b -384 a^{2} b^{2}-128 a \,b^{3}+64 b^{4}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{160}+\frac {\left (-32 a^{4}+256 a^{3} b +192 a^{2} b^{2}-256 a \,b^{3}-32 b^{4}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{320}+\frac {\left (64 a^{4}+128 a^{3} b -384 a^{2} b^{2}-128 a \,b^{3}+64 b^{4}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{160}}{f}\) \(325\)
default \(\frac {\frac {b^{4} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {5}{2}}}{160}+\frac {a \,b^{3} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{6}-\frac {b^{4} \left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{16}+3 \sqrt {3+4 \tan \left (f x +e \right )}\, a^{2} b^{2}-\frac {3 \sqrt {3+4 \tan \left (f x +e \right )}\, a \,b^{3}}{2}-\frac {7 \sqrt {3+4 \tan \left (f x +e \right )}\, b^{4}}{32}+\frac {\left (32 a^{4}-256 a^{3} b -192 a^{2} b^{2}+256 a \,b^{3}+32 b^{4}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{320}+\frac {\left (64 a^{4}+128 a^{3} b -384 a^{2} b^{2}-128 a \,b^{3}+64 b^{4}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{160}+\frac {\left (-32 a^{4}+256 a^{3} b +192 a^{2} b^{2}-256 a \,b^{3}-32 b^{4}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{320}+\frac {\left (64 a^{4}+128 a^{3} b -384 a^{2} b^{2}-128 a \,b^{3}+64 b^{4}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{160}}{f}\) \(325\)
parts \(\frac {a^{4} \left (-\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {b^{4} \left (\frac {\left (3+4 \tan \left (f x +e \right )\right )^{\frac {5}{2}}}{160}-\frac {\left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{16}-\frac {7 \sqrt {3+4 \tan \left (f x +e \right )}}{32}-\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}+\frac {2 \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {4 a \,b^{3} \left (\frac {\left (3+4 \tan \left (f x +e \right )\right )^{\frac {3}{2}}}{24}-\frac {3 \sqrt {3+4 \tan \left (f x +e \right )}}{8}-\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {6 a^{2} b^{2} \left (\frac {\sqrt {3+4 \tan \left (f x +e \right )}}{2}+\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}-\frac {2 \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{10}-\frac {2 \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}+\frac {4 a^{3} b \left (\frac {\ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}-\frac {\ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}+\frac {\arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{5}\right )}{f}\) \(574\)

Input:

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

Output:

1/f*(1/160*b^4*(3+4*tan(f*x+e))^(5/2)+1/6*a*b^3*(3+4*tan(f*x+e))^(3/2)-1/1 
6*b^4*(3+4*tan(f*x+e))^(3/2)+3*(3+4*tan(f*x+e))^(1/2)*a^2*b^2-3/2*(3+4*tan 
(f*x+e))^(1/2)*a*b^3-7/32*(3+4*tan(f*x+e))^(1/2)*b^4+1/320*(32*a^4-256*a^3 
*b-192*a^2*b^2+256*a*b^3+32*b^4)*ln(8+4*tan(f*x+e)+4*(3+4*tan(f*x+e))^(1/2 
))+1/160*(64*a^4+128*a^3*b-384*a^2*b^2-128*a*b^3+64*b^4)*arctan(2+(3+4*tan 
(f*x+e))^(1/2))+1/320*(-32*a^4+256*a^3*b+192*a^2*b^2-256*a*b^3-32*b^4)*ln( 
8+4*tan(f*x+e)-4*(3+4*tan(f*x+e))^(1/2))+1/160*(64*a^4+128*a^3*b-384*a^2*b 
^2-128*a*b^3+64*b^4)*arctan(-2+(3+4*tan(f*x+e))^(1/2)))
 

Fricas [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 262, normalized size of antiderivative = 0.84 \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {24 \, {\left (a^{4} + 2 \, a^{3} b - 6 \, a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 24 \, {\left (a^{4} + 2 \, a^{3} b - 6 \, a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + 6 \, {\left (a^{4} - 8 \, a^{3} b - 6 \, a^{2} b^{2} + 8 \, a b^{3} + b^{4}\right )} \log \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + \tan \left (f x + e\right ) + 2\right ) - 6 \, {\left (a^{4} - 8 \, a^{3} b - 6 \, a^{2} b^{2} + 8 \, a b^{3} + b^{4}\right )} \log \left (-\sqrt {4 \, \tan \left (f x + e\right ) + 3} + \tan \left (f x + e\right ) + 2\right ) + {\left (6 \, b^{4} \tan \left (f x + e\right )^{2} + 180 \, a^{2} b^{2} - 60 \, a b^{3} - 21 \, b^{4} + 2 \, {\left (20 \, a b^{3} - 3 \, b^{4}\right )} \tan \left (f x + e\right )\right )} \sqrt {4 \, \tan \left (f x + e\right ) + 3}}{60 \, f} \] Input:

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

Output:

1/60*(24*(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + b^4)*arctan(sqrt(4*tan(f*x 
 + e) + 3) + 2) + 24*(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + b^4)*arctan(sq 
rt(4*tan(f*x + e) + 3) - 2) + 6*(a^4 - 8*a^3*b - 6*a^2*b^2 + 8*a*b^3 + b^4 
)*log(sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 2) - 6*(a^4 - 8*a^3*b - 6* 
a^2*b^2 + 8*a*b^3 + b^4)*log(-sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 2) 
 + (6*b^4*tan(f*x + e)^2 + 180*a^2*b^2 - 60*a*b^3 - 21*b^4 + 2*(20*a*b^3 - 
 3*b^4)*tan(f*x + e))*sqrt(4*tan(f*x + e) + 3))/f
 

Sympy [F]

\[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\int \frac {\left (a + b \tan {\left (e + f x \right )}\right )^{4}}{\sqrt {4 \tan {\left (e + f x \right )} + 3}}\, dx \] Input:

integrate((a+b*tan(f*x+e))**4/(3+4*tan(f*x+e))**(1/2),x)
 

Output:

Integral((a + b*tan(e + f*x))**4/sqrt(4*tan(e + f*x) + 3), x)
 

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 279, normalized size of antiderivative = 0.89 \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {3 \, b^{4} {\left (4 \, \tan \left (f x + e\right ) + 3\right )}^{\frac {5}{2}} + 10 \, {\left (8 \, a b^{3} - 3 \, b^{4}\right )} {\left (4 \, \tan \left (f x + e\right ) + 3\right )}^{\frac {3}{2}} + 192 \, {\left (a^{4} + 2 \, a^{3} b - 6 \, a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} + 2\right ) + 192 \, {\left (a^{4} + 2 \, a^{3} b - 6 \, a^{2} b^{2} - 2 \, a b^{3} + b^{4}\right )} \arctan \left (\sqrt {4 \, \tan \left (f x + e\right ) + 3} - 2\right ) + 48 \, {\left (a^{4} - 8 \, a^{3} b - 6 \, a^{2} b^{2} + 8 \, a b^{3} + b^{4}\right )} \log \left (4 \, \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, \tan \left (f x + e\right ) + 8\right ) - 48 \, {\left (a^{4} - 8 \, a^{3} b - 6 \, a^{2} b^{2} + 8 \, a b^{3} + b^{4}\right )} \log \left (-4 \, \sqrt {4 \, \tan \left (f x + e\right ) + 3} + 4 \, \tan \left (f x + e\right ) + 8\right ) + 15 \, {\left (96 \, a^{2} b^{2} - 48 \, a b^{3} - 7 \, b^{4}\right )} \sqrt {4 \, \tan \left (f x + e\right ) + 3}}{480 \, f} \] Input:

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

Output:

1/480*(3*b^4*(4*tan(f*x + e) + 3)^(5/2) + 10*(8*a*b^3 - 3*b^4)*(4*tan(f*x 
+ e) + 3)^(3/2) + 192*(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + b^4)*arctan(s 
qrt(4*tan(f*x + e) + 3) + 2) + 192*(a^4 + 2*a^3*b - 6*a^2*b^2 - 2*a*b^3 + 
b^4)*arctan(sqrt(4*tan(f*x + e) + 3) - 2) + 48*(a^4 - 8*a^3*b - 6*a^2*b^2 
+ 8*a*b^3 + b^4)*log(4*sqrt(4*tan(f*x + e) + 3) + 4*tan(f*x + e) + 8) - 48 
*(a^4 - 8*a^3*b - 6*a^2*b^2 + 8*a*b^3 + b^4)*log(-4*sqrt(4*tan(f*x + e) + 
3) + 4*tan(f*x + e) + 8) + 15*(96*a^2*b^2 - 48*a*b^3 - 7*b^4)*sqrt(4*tan(f 
*x + e) + 3))/f
 

Giac [F(-2)]

Exception generated. \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\text {Exception raised: TypeError} \] Input:

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

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
 

Mupad [B] (verification not implemented)

Time = 2.17 (sec) , antiderivative size = 2328, normalized size of antiderivative = 7.46 \[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\text {Too large to display} \] Input:

int((a + b*tan(e + f*x))^4/(4*tan(e + f*x) + 3)^(1/2),x)
 

Output:

(b^4/(16*f) + (b^3*(4*a - 3*b))/(24*f))*(4*tan(e + f*x) + 3)^(3/2) + (4*ta 
n(e + f*x) + 3)^(1/2)*((11*b^4)/(32*f) + (3*b^2*(4*a - 3*b)^2)/(16*f) + (3 
*b^3*(4*a - 3*b))/(4*f)) + (b^4*(4*tan(e + f*x) + 3)^(5/2))/(160*f) + (ata 
n(((((256*(4*tan(e + f*x) + 3)^(1/2)*(a^8 + b^8 - 28*a^2*b^6 + 70*a^4*b^4 
- 28*a^6*b^2))/f^2 - (((512*(4*a^4*f^2 + 4*b^4*f^2 + 12*a*b^3*f^2 - 12*a^3 
*b*f^2 - 24*a^2*b^2*f^2))/f^3 - (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b^3*(8 
 - 4i) - a^3*b*(8 - 4i) + a^4*(1 + 2i) + b^4*(1 + 2i) - a^2*b^2*(6 + 12i)) 
)/(5*f))*(a*b^3*(8 - 4i) - a^3*b*(8 - 4i) + a^4*(1 + 2i) + b^4*(1 + 2i) - 
a^2*b^2*(6 + 12i)))/(10*f))*(a*b^3*(8 - 4i) - a^3*b*(8 - 4i) + a^4*(1 + 2i 
) + b^4*(1 + 2i) - a^2*b^2*(6 + 12i))*1i)/(10*f) + (((256*(4*tan(e + f*x) 
+ 3)^(1/2)*(a^8 + b^8 - 28*a^2*b^6 + 70*a^4*b^4 - 28*a^6*b^2))/f^2 + (((51 
2*(4*a^4*f^2 + 4*b^4*f^2 + 12*a*b^3*f^2 - 12*a^3*b*f^2 - 24*a^2*b^2*f^2))/ 
f^3 + (1536*(4*tan(e + f*x) + 3)^(1/2)*(a*b^3*(8 - 4i) - a^3*b*(8 - 4i) + 
a^4*(1 + 2i) + b^4*(1 + 2i) - a^2*b^2*(6 + 12i)))/(5*f))*(a*b^3*(8 - 4i) - 
 a^3*b*(8 - 4i) + a^4*(1 + 2i) + b^4*(1 + 2i) - a^2*b^2*(6 + 12i)))/(10*f) 
)*(a*b^3*(8 - 4i) - a^3*b*(8 - 4i) + a^4*(1 + 2i) + b^4*(1 + 2i) - a^2*b^2 
*(6 + 12i))*1i)/(10*f))/((1024*(a*b^11 - a^11*b + 3*a^3*b^9 + 2*a^5*b^7 - 
2*a^7*b^5 - 3*a^9*b^3))/f^3 + (((256*(4*tan(e + f*x) + 3)^(1/2)*(a^8 + b^8 
 - 28*a^2*b^6 + 70*a^4*b^4 - 28*a^6*b^2))/f^2 - (((512*(4*a^4*f^2 + 4*b^4* 
f^2 + 12*a*b^3*f^2 - 12*a^3*b*f^2 - 24*a^2*b^2*f^2))/f^3 - (1536*(4*tan...
 

Reduce [F]

\[ \int \frac {(a+b \tan (e+f x))^4}{\sqrt {3+4 \tan (e+f x)}} \, dx=\frac {\sqrt {4 \tan \left (f x +e \right )+3}\, a^{4}+2 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{4}}{4 \tan \left (f x +e \right )+3}d x \right ) b^{4} f +8 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{3}}{4 \tan \left (f x +e \right )+3}d x \right ) a \,b^{3} f -2 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{2}}{4 \tan \left (f x +e \right )+3}d x \right ) a^{4} f +12 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )^{2}}{4 \tan \left (f x +e \right )+3}d x \right ) a^{2} b^{2} f +8 \left (\int \frac {\sqrt {4 \tan \left (f x +e \right )+3}\, \tan \left (f x +e \right )}{4 \tan \left (f x +e \right )+3}d x \right ) a^{3} b f}{2 f} \] Input:

int((a+b*tan(f*x+e))^4/(3+4*tan(f*x+e))^(1/2),x)
 

Output:

(sqrt(4*tan(e + f*x) + 3)*a**4 + 2*int((sqrt(4*tan(e + f*x) + 3)*tan(e + f 
*x)**4)/(4*tan(e + f*x) + 3),x)*b**4*f + 8*int((sqrt(4*tan(e + f*x) + 3)*t 
an(e + f*x)**3)/(4*tan(e + f*x) + 3),x)*a*b**3*f - 2*int((sqrt(4*tan(e + f 
*x) + 3)*tan(e + f*x)**2)/(4*tan(e + f*x) + 3),x)*a**4*f + 12*int((sqrt(4* 
tan(e + f*x) + 3)*tan(e + f*x)**2)/(4*tan(e + f*x) + 3),x)*a**2*b**2*f + 8 
*int((sqrt(4*tan(e + f*x) + 3)*tan(e + f*x))/(4*tan(e + f*x) + 3),x)*a**3* 
b*f)/(2*f)