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

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

Optimal result

Integrand size = 27, antiderivative size = 258 \[ \int \frac {\sqrt {3+4 \tan (e+f x)}}{(a+b \tan (e+f x))^2} \, dx=-\frac {4 \sqrt {b} \left (3 a^2-3 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \sqrt {3+4 \tan (e+f x)}}{\sqrt {4 a-3 b}}\right )}{\sqrt {4 a-3 b} \left (a^2+b^2\right )^2 f}-\frac {2 \left (a^2+a b-b^2\right ) \arctan \left (\frac {a^2+a b-b^2-2 \left (a^2+a b-b^2\right ) \tan (e+f x)}{\left (a^2+a b-b^2\right ) \sqrt {3+4 \tan (e+f x)}}\right )}{\left (a^2+b^2\right )^2 f}-\frac {\left (a^2-4 a b-b^2\right ) \text {arctanh}\left (\frac {2+\tan (e+f x)}{\sqrt {3+4 \tan (e+f x)}}\right )}{\left (a^2+b^2\right )^2 f}-\frac {b \sqrt {3+4 \tan (e+f x)}}{\left (a^2+b^2\right ) f (a+b \tan (e+f x))} \] Output:

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

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.68 (sec) , antiderivative size = 244, normalized size of antiderivative = 0.95 \[ \int \frac {\sqrt {3+4 \tan (e+f x)}}{(a+b \tan (e+f x))^2} \, dx=\frac {\frac {4 \sqrt {b} \left (12 a^3-21 a^2 b+5 a b^2+3 b^3\right ) \arctan \left (\frac {\sqrt {b} \sqrt {3+4 \tan (e+f x)}}{\sqrt {4 a-3 b}}\right )}{\sqrt {4 a-3 b} \left (a^2+b^2\right )}-\frac {(4 a-3 b) \left ((2+i) (a-i b)^2 \arctan \left (\left (\frac {1}{5}+\frac {2 i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )-(1+2 i) (a+i b)^2 \text {arctanh}\left (\left (\frac {2}{5}+\frac {i}{5}\right ) \sqrt {3+4 \tan (e+f x)}\right )\right )}{a^2+b^2}+4 b \sqrt {3+4 \tan (e+f x)}-\frac {b^2 (3+4 \tan (e+f x))^{3/2}}{a+b \tan (e+f x)}}{(-4 a+3 b) \left (a^2+b^2\right ) f} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 1.60 (sec) , antiderivative size = 305, normalized size of antiderivative = 1.18, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {3042, 4051, 25, 3042, 4136, 3042, 4019, 27, 3042, 4018, 216, 220, 4117, 73, 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 {\sqrt {4 \tan (e+f x)+3}}{(a+b \tan (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4051

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4136

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4019

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4018

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 220

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

\(\Big \downarrow \) 4117

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

\(\Big \downarrow \) 73

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

\(\Big \downarrow \) 218

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, 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 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 4051
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a + b*Tan[e + f*x])^(m + 1)*((c + 
d*Tan[e + f*x])^n/(f*(m + 1)*(a^2 + b^2))), x] + Simp[1/((m + 1)*(a^2 + b^2 
))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^(n - 1)*Simp[a*c 
*(m + 1) - b*d*n - (b*c - a*d)*(m + 1)*Tan[e + f*x] - b*d*(m + n + 1)*Tan[e 
 + f*x]^2, x], 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] && LtQ[m, -1] && GtQ[n, 0] && Int 
egerQ[2*m]
 

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

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

Time = 0.23 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.22

method result size
derivativedivides \(\frac {\frac {64 \left (-a^{2}+4 a b +b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )+128 \left (2 a^{2}+2 a b -2 b^{2}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{128 a^{4}+256 a^{2} b^{2}+128 b^{4}}-\frac {4 b \left (\frac {\left (\frac {a^{2}}{4}+\frac {b^{2}}{4}\right ) \sqrt {3+4 \tan \left (f x +e \right )}}{\frac {\left (3+4 \tan \left (f x +e \right )\right ) b}{4}+a -\frac {3 b}{4}}+\frac {4 \left (\frac {3}{4} a^{2}-\frac {3}{4} a b -\frac {1}{4} b^{2}\right ) \arctan \left (\frac {\sqrt {3+4 \tan \left (f x +e \right )}\, b}{\sqrt {b \left (4 a -3 b \right )}}\right )}{\sqrt {b \left (4 a -3 b \right )}}\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}+\frac {64 \left (a^{2}-4 a b -b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )+128 \left (2 a^{2}+2 a b -2 b^{2}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{128 a^{4}+256 a^{2} b^{2}+128 b^{4}}}{f}\) \(315\)
default \(\frac {\frac {64 \left (-a^{2}+4 a b +b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )+4 \sqrt {3+4 \tan \left (f x +e \right )}\right )+128 \left (2 a^{2}+2 a b -2 b^{2}\right ) \arctan \left (2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{128 a^{4}+256 a^{2} b^{2}+128 b^{4}}-\frac {4 b \left (\frac {\left (\frac {a^{2}}{4}+\frac {b^{2}}{4}\right ) \sqrt {3+4 \tan \left (f x +e \right )}}{\frac {\left (3+4 \tan \left (f x +e \right )\right ) b}{4}+a -\frac {3 b}{4}}+\frac {4 \left (\frac {3}{4} a^{2}-\frac {3}{4} a b -\frac {1}{4} b^{2}\right ) \arctan \left (\frac {\sqrt {3+4 \tan \left (f x +e \right )}\, b}{\sqrt {b \left (4 a -3 b \right )}}\right )}{\sqrt {b \left (4 a -3 b \right )}}\right )}{a^{4}+2 a^{2} b^{2}+b^{4}}+\frac {64 \left (a^{2}-4 a b -b^{2}\right ) \ln \left (8+4 \tan \left (f x +e \right )-4 \sqrt {3+4 \tan \left (f x +e \right )}\right )+128 \left (2 a^{2}+2 a b -2 b^{2}\right ) \arctan \left (-2+\sqrt {3+4 \tan \left (f x +e \right )}\right )}{128 a^{4}+256 a^{2} b^{2}+128 b^{4}}}{f}\) \(315\)

Input:

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

Output:

1/f*(128/(128*a^4+256*a^2*b^2+128*b^4)*(1/2*(-a^2+4*a*b+b^2)*ln(8+4*tan(f* 
x+e)+4*(3+4*tan(f*x+e))^(1/2))+(2*a^2+2*a*b-2*b^2)*arctan(2+(3+4*tan(f*x+e 
))^(1/2)))-4*b/(a^4+2*a^2*b^2+b^4)*((1/4*a^2+1/4*b^2)*(3+4*tan(f*x+e))^(1/ 
2)/(1/4*(3+4*tan(f*x+e))*b+a-3/4*b)+4*(3/4*a^2-3/4*a*b-1/4*b^2)/(b*(4*a-3* 
b))^(1/2)*arctan((3+4*tan(f*x+e))^(1/2)*b/(b*(4*a-3*b))^(1/2)))+128/(128*a 
^4+256*a^2*b^2+128*b^4)*(1/2*(a^2-4*a*b-b^2)*ln(8+4*tan(f*x+e)-4*(3+4*tan( 
f*x+e))^(1/2))+(2*a^2+2*a*b-2*b^2)*arctan(-2+(3+4*tan(f*x+e))^(1/2))))
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F(-2)]

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

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(3*b-4*a>0)', see `assume?` for m 
ore detail
 

Giac [F(-2)]

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

integrate((3+4*tan(f*x+e))^(1/2)/(a+b*tan(f*x+e))^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 = 6.41 (sec) , antiderivative size = 13546, normalized size of antiderivative = 52.50 \[ \int \frac {\sqrt {3+4 \tan (e+f x)}}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display} \] Input:

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

Output:

(atan((((-b*(4*a - 3*b))^(1/2)*((2097152*(4*tan(e + f*x) + 3)^(1/2)*(720*a 
*b^8 + 681*b^9 + 3666*a^2*b^7 - 192*a^3*b^6 - 5951*a^4*b^5 + 4464*a^5*b^4 
- 504*a^6*b^3))/(a^8*f^4 + b^8*f^4 + 4*a^2*b^6*f^4 + 6*a^4*b^4*f^4 + 4*a^6 
*b^2*f^4) - (2*(-b*(4*a - 3*b))^(1/2)*((104857600*(30*b^11*f^2 - 32*a*b^10 
*f^2 - 384*a^2*b^9*f^2 + 112*a^3*b^8*f^2 + 108*a^4*b^7*f^2 - 168*a^5*b^6*f 
^2 + 528*a^6*b^5*f^2 - 320*a^7*b^4*f^2 + 6*a^8*b^3*f^2 - 8*a^9*b^2*f^2))/( 
a^8*f^5 + b^8*f^5 + 4*a^2*b^6*f^5 + 6*a^4*b^4*f^5 + 4*a^6*b^2*f^5) + (2*(- 
b*(4*a - 3*b))^(1/2)*((2097152*(4*tan(e + f*x) + 3)^(1/2)*(4264*a*b^12*f^2 
 - 462*b^13*f^2 + 4062*a^2*b^11*f^2 + 4312*a^3*b^10*f^2 + 4068*a^4*b^9*f^2 
 + 208*a^5*b^8*f^2 - 7188*a^6*b^7*f^2 + 4592*a^7*b^6*f^2 - 8022*a^8*b^5*f^ 
2 + 4488*a^9*b^4*f^2 - 1290*a^10*b^3*f^2 + 56*a^11*b^2*f^2))/(a^8*f^4 + b^ 
8*f^4 + 4*a^2*b^6*f^4 + 6*a^4*b^4*f^4 + 4*a^6*b^2*f^4) + (2*((104857600*(1 
6*b^15*f^4 + 24*a*b^14*f^4 + 48*a^2*b^13*f^4 + 120*a^3*b^12*f^4 + 240*a^5* 
b^10*f^4 - 160*a^6*b^9*f^4 + 240*a^7*b^8*f^4 - 240*a^8*b^7*f^4 + 120*a^9*b 
^6*f^4 - 144*a^10*b^5*f^4 + 24*a^11*b^4*f^4 - 32*a^12*b^3*f^4))/(a^8*f^5 + 
 b^8*f^5 + 4*a^2*b^6*f^5 + 6*a^4*b^4*f^5 + 4*a^6*b^2*f^5) - (4194304*(4*ta 
n(e + f*x) + 3)^(1/2)*(-b*(4*a - 3*b))^(1/2)*(3*a*b - 3*a^2 + b^2)*(472*b^ 
17*f^4 + 96*a*b^16*f^4 + 2504*a^2*b^15*f^4 + 672*a^3*b^14*f^4 + 5112*a^4*b 
^13*f^4 + 2016*a^5*b^12*f^4 + 4520*a^6*b^11*f^4 + 3360*a^7*b^10*f^4 + 520* 
a^8*b^9*f^4 + 3360*a^9*b^8*f^4 - 2088*a^10*b^7*f^4 + 2016*a^11*b^6*f^4 ...
 

Reduce [F]

\[ \int \frac {\sqrt {3+4 \tan (e+f x)}}{(a+b \tan (e+f x))^2} \, dx=\text {too large to display} \] Input:

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

Output:

(4*sqrt(4*tan(e + f*x) + 3)*a - 3*sqrt(4*tan(e + f*x) + 3)*b - 16*int(sqrt 
(4*tan(e + f*x) + 3)/(8*tan(e + f*x)**3*a*b**2 - 12*tan(e + f*x)**3*b**3 + 
 16*tan(e + f*x)**2*a**2*b - 18*tan(e + f*x)**2*a*b**2 - 9*tan(e + f*x)**2 
*b**3 + 8*tan(e + f*x)*a**3 - 18*tan(e + f*x)*a*b**2 + 6*a**3 - 9*a**2*b), 
x)*tan(e + f*x)*a**3*b*f + 72*int(sqrt(4*tan(e + f*x) + 3)/(8*tan(e + f*x) 
**3*a*b**2 - 12*tan(e + f*x)**3*b**3 + 16*tan(e + f*x)**2*a**2*b - 18*tan( 
e + f*x)**2*a*b**2 - 9*tan(e + f*x)**2*b**3 + 8*tan(e + f*x)*a**3 - 18*tan 
(e + f*x)*a*b**2 + 6*a**3 - 9*a**2*b),x)*tan(e + f*x)*a**2*b**2*f - 108*in 
t(sqrt(4*tan(e + f*x) + 3)/(8*tan(e + f*x)**3*a*b**2 - 12*tan(e + f*x)**3* 
b**3 + 16*tan(e + f*x)**2*a**2*b - 18*tan(e + f*x)**2*a*b**2 - 9*tan(e + f 
*x)**2*b**3 + 8*tan(e + f*x)*a**3 - 18*tan(e + f*x)*a*b**2 + 6*a**3 - 9*a* 
*2*b),x)*tan(e + f*x)*a*b**3*f + 54*int(sqrt(4*tan(e + f*x) + 3)/(8*tan(e 
+ f*x)**3*a*b**2 - 12*tan(e + f*x)**3*b**3 + 16*tan(e + f*x)**2*a**2*b - 1 
8*tan(e + f*x)**2*a*b**2 - 9*tan(e + f*x)**2*b**3 + 8*tan(e + f*x)*a**3 - 
18*tan(e + f*x)*a*b**2 + 6*a**3 - 9*a**2*b),x)*tan(e + f*x)*b**4*f - 16*in 
t(sqrt(4*tan(e + f*x) + 3)/(8*tan(e + f*x)**3*a*b**2 - 12*tan(e + f*x)**3* 
b**3 + 16*tan(e + f*x)**2*a**2*b - 18*tan(e + f*x)**2*a*b**2 - 9*tan(e + f 
*x)**2*b**3 + 8*tan(e + f*x)*a**3 - 18*tan(e + f*x)*a*b**2 + 6*a**3 - 9*a* 
*2*b),x)*a**4*f + 72*int(sqrt(4*tan(e + f*x) + 3)/(8*tan(e + f*x)**3*a*b** 
2 - 12*tan(e + f*x)**3*b**3 + 16*tan(e + f*x)**2*a**2*b - 18*tan(e + f*...