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

Optimal result
Mathematica [C] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 274 \[ \int \frac {1}{\sqrt {3+4 \tan (e+f x)} (a+b \tan (e+f x))^2} \, dx=\frac {4 b^{3/2} \left (5 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 )}{(4 a-3 b)^{3/2} \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 )}{5 \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 )}{5 \left (a^2+b^2\right )^2 f}+\frac {b^2 \sqrt {3+4 \tan (e+f x)}}{(4 a-3 b) \left (a^2+b^2\right ) f (a+b \tan (e+f x))} \] Output:

4*b^(3/2)*(5*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)^(3/2)/(a^2+b^2)^2/f-2/5*(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+1/5*(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^2*(3+4*tan(f*x+e))^(1/2)/(4*a-3*b)/(a^2+b^2)/f/(a+b*tan( 
f*x+e))
 

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.54 (sec) , antiderivative size = 219, normalized size of antiderivative = 0.80 \[ \int \frac {1}{\sqrt {3+4 \tan (e+f x)} (a+b \tan (e+f x))^2} \, dx=\frac {-\frac {20 b^{3/2} \left (5 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 )}+\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}-\frac {5 b^2 \sqrt {3+4 \tan (e+f x)}}{a+b \tan (e+f x)}}{5 (-4 a+3 b) \left (a^2+b^2\right ) f} \] Input:

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

Output:

((-20*b^(3/2)*(5*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)) + ((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) 
- (5*b^2*Sqrt[3 + 4*Tan[e + f*x]])/(a + b*Tan[e + f*x]))/(5*(-4*a + 3*b)*( 
a^2 + b^2)*f)
 

Rubi [A] (verified)

Time = 1.82 (sec) , antiderivative size = 392, normalized size of antiderivative = 1.43, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.519, Rules used = {3042, 4052, 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 {1}{\sqrt {4 \tan (e+f x)+3} (a+b \tan (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4052

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4136

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\int \frac {(4 a-3 b) \left (a^2-b^2\right )-2 a (4 a-3 b) b \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\int \frac {(4 a-3 b) \left (a^2-b^2\right )-2 a (4 a-3 b) b \tan (e+f x)}{\sqrt {4 \tan (e+f x)+3}}dx}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 4019

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\frac {1}{10} \int \frac {4 \left (2 (4 a-3 b) \left (a^2-b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2-b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}dx-\frac {1}{10} \int -\frac {2 \left ((4 a-3 b) \left (a^2+4 b a-b^2\right )-2 (4 a-3 b) \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}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\frac {2}{5} \int \frac {2 (4 a-3 b) \left (a^2-b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2-b a-b^2\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {1}{5} \int \frac {(4 a-3 b) \left (a^2+4 b a-b^2\right )-2 (4 a-3 b) \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}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\frac {2}{5} \int \frac {2 (4 a-3 b) \left (a^2-b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2-b a-b^2\right )}{\sqrt {4 \tan (e+f x)+3}}dx+\frac {1}{5} \int \frac {(4 a-3 b) \left (a^2+4 b a-b^2\right )-2 (4 a-3 b) \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}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 4018

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {-\frac {4 (4 a-3 b)^2 \left (a^2-a b-b^2\right )^2 \int \frac {1}{4 (4 a-3 b)^2 \left (a^2-b a-b^2\right )^2+\frac {4 \left ((4 a-3 b) \left (a^2-b a-b^2\right )-2 (4 a-3 b) \left (a^2-b a-b^2\right ) \tan (e+f x)\right )^2}{4 \tan (e+f x)+3}}d\frac {2 \left ((4 a-3 b) \left (a^2-b a-b^2\right )-2 (4 a-3 b) \left (a^2-b a-b^2\right ) \tan (e+f x)\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}-\frac {8 (4 a-3 b)^2 \left (a^2+4 a b-b^2\right )^2 \int \frac {1}{\frac {64 \left (2 (4 a-3 b) \left (a^2+4 b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2+4 b a-b^2\right )\right )^2}{4 \tan (e+f x)+3}-64 (4 a-3 b)^2 \left (a^2+4 b a-b^2\right )^2}d\frac {8 \left (2 (4 a-3 b) \left (a^2+4 b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2+4 b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {-\frac {8 (4 a-3 b)^2 \left (a^2+4 a b-b^2\right )^2 \int \frac {1}{\frac {64 \left (2 (4 a-3 b) \left (a^2+4 b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2+4 b a-b^2\right )\right )^2}{4 \tan (e+f x)+3}-64 (4 a-3 b)^2 \left (a^2+4 b a-b^2\right )^2}d\frac {8 \left (2 (4 a-3 b) \left (a^2+4 b a-b^2\right )+(4 a-3 b) \tan (e+f x) \left (a^2+4 b a-b^2\right )\right )}{\sqrt {4 \tan (e+f x)+3}}}{5 f}-\frac {2 (4 a-3 b) \left (a^2-a b-b^2\right ) \arctan \left (\frac {(4 a-3 b) \left (a^2-a b-b^2\right )-2 (4 a-3 b) \left (a^2-a b-b^2\right ) \tan (e+f x)}{(4 a-3 b) \left (a^2-a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}}{a^2+b^2}+\frac {2 b^2 \left (5 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}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 220

\(\displaystyle \frac {\frac {2 b^2 \left (5 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}+\frac {\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \text {arctanh}\left (\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \tan (e+f x)+2 (4 a-3 b) \left (a^2+4 a b-b^2\right )}{(4 a-3 b) \left (a^2+4 a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}-\frac {2 (4 a-3 b) \left (a^2-a b-b^2\right ) \arctan \left (\frac {(4 a-3 b) \left (a^2-a b-b^2\right )-2 (4 a-3 b) \left (a^2-a b-b^2\right ) \tan (e+f x)}{(4 a-3 b) \left (a^2-a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 4117

\(\displaystyle \frac {\frac {2 b^2 \left (5 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 )}+\frac {\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \text {arctanh}\left (\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \tan (e+f x)+2 (4 a-3 b) \left (a^2+4 a b-b^2\right )}{(4 a-3 b) \left (a^2+4 a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}-\frac {2 (4 a-3 b) \left (a^2-a b-b^2\right ) \arctan \left (\frac {(4 a-3 b) \left (a^2-a b-b^2\right )-2 (4 a-3 b) \left (a^2-a b-b^2\right ) \tan (e+f x)}{(4 a-3 b) \left (a^2-a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {\frac {b^2 \left (5 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 )}+\frac {\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \text {arctanh}\left (\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \tan (e+f x)+2 (4 a-3 b) \left (a^2+4 a b-b^2\right )}{(4 a-3 b) \left (a^2+4 a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}-\frac {2 (4 a-3 b) \left (a^2-a b-b^2\right ) \arctan \left (\frac {(4 a-3 b) \left (a^2-a b-b^2\right )-2 (4 a-3 b) \left (a^2-a b-b^2\right ) \tan (e+f x)}{(4 a-3 b) \left (a^2-a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}}{a^2+b^2}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \text {arctanh}\left (\frac {(4 a-3 b) \left (a^2+4 a b-b^2\right ) \tan (e+f x)+2 (4 a-3 b) \left (a^2+4 a b-b^2\right )}{(4 a-3 b) \left (a^2+4 a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}-\frac {2 (4 a-3 b) \left (a^2-a b-b^2\right ) \arctan \left (\frac {(4 a-3 b) \left (a^2-a b-b^2\right )-2 (4 a-3 b) \left (a^2-a b-b^2\right ) \tan (e+f x)}{(4 a-3 b) \left (a^2-a b-b^2\right ) \sqrt {4 \tan (e+f x)+3}}\right )}{5 f}}{a^2+b^2}+\frac {4 b^{3/2} \left (5 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 )}}{(4 a-3 b) \left (a^2+b^2\right )}+\frac {b^2 \sqrt {4 \tan (e+f x)+3}}{f (4 a-3 b) \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

Input:

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

Output:

((4*b^(3/2)*(5*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*(4*a - 3*b)*(a^ 
2 - a*b - b^2)*ArcTan[((4*a - 3*b)*(a^2 - a*b - b^2) - 2*(4*a - 3*b)*(a^2 
- a*b - b^2)*Tan[e + f*x])/((4*a - 3*b)*(a^2 - a*b - b^2)*Sqrt[3 + 4*Tan[e 
 + f*x]])])/(5*f) + ((4*a - 3*b)*(a^2 + 4*a*b - b^2)*ArcTanh[(2*(4*a - 3*b 
)*(a^2 + 4*a*b - b^2) + (4*a - 3*b)*(a^2 + 4*a*b - b^2)*Tan[e + f*x])/((4* 
a - 3*b)*(a^2 + 4*a*b - b^2)*Sqrt[3 + 4*Tan[e + f*x]])])/(5*f))/(a^2 + b^2 
))/((4*a - 3*b)*(a^2 + b^2)) + (b^2*Sqrt[3 + 4*Tan[e + f*x]])/((4*a - 3*b) 
*(a^2 + b^2)*f*(a + b*Tan[e + f*x]))
 

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 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 4052
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 + 1)*((c 
+ d*Tan[e + f*x])^(n + 1)/(f*(m + 1)*(a^2 + b^2)*(b*c - a*d))), x] + Simp[1 
/((m + 1)*(a^2 + b^2)*(b*c - a*d))   Int[(a + b*Tan[e + f*x])^(m + 1)*(c + 
d*Tan[e + f*x])^n*Simp[a*(b*c - a*d)*(m + 1) - b^2*d*(m + n + 2) - b*(b*c - 
 a*d)*(m + 1)*Tan[e + f*x] - b^2*d*(m + n + 2)*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] && LtQ[m, -1] && (LtQ[n, 0] || Integ 
erQ[m]) &&  !(ILtQ[n, -1] && ( !IntegerQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
 

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 = 330, normalized size of antiderivative = 1.20

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 )}{640 a^{4}+1280 a^{2} b^{2}+640 b^{4}}+\frac {4 b^{2} \left (\frac {\left (a^{2}+b^{2}\right ) \sqrt {3+4 \tan \left (f x +e \right )}}{4 \left (4 a -3 b \right ) \left (\frac {\left (3+4 \tan \left (f x +e \right )\right ) b}{4}+a -\frac {3 b}{4}\right )}+\frac {4 \left (5 a^{2}-3 a b +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 )}{\left (16 a -12 b \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 )}{640 a^{4}+1280 a^{2} b^{2}+640 b^{4}}}{f}\) \(330\)
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 )}{640 a^{4}+1280 a^{2} b^{2}+640 b^{4}}+\frac {4 b^{2} \left (\frac {\left (a^{2}+b^{2}\right ) \sqrt {3+4 \tan \left (f x +e \right )}}{4 \left (4 a -3 b \right ) \left (\frac {\left (3+4 \tan \left (f x +e \right )\right ) b}{4}+a -\frac {3 b}{4}\right )}+\frac {4 \left (5 a^{2}-3 a b +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 )}{\left (16 a -12 b \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 )}{640 a^{4}+1280 a^{2} b^{2}+640 b^{4}}}{f}\) \(330\)

Input:

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

Output:

1/f*(128/(640*a^4+1280*a^2*b^2+640*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^2/(a^4+2*a^2*b^2+b^4)*(1/4*(a^2+b^2)/(4*a-3*b)*(3+4*tan(f*x 
+e))^(1/2)/(1/4*(3+4*tan(f*x+e))*b+a-3/4*b)+4*(5*a^2-3*a*b+b^2)/(16*a-12*b 
)/(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/(640*a^4+1280*a^2*b^2+640*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 [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 529 vs. \(2 (254) = 508\).

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

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

Output:

[-1/10*(20*(5*a^3*b - 3*a^2*b^2 + a*b^3 + (5*a^2*b^2 - 3*a*b^3 + b^4)*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*(4*a^4 - 7*a^3*b - a^2*b^2 + 3*a*b^3 + (4*a^3*b - 7*a^2*b^2 - a*b^3 + 
 3*b^4)*tan(f*x + e))*arctan(sqrt(4*tan(f*x + e) + 3) + 2) - 4*(4*a^4 - 7* 
a^3*b - a^2*b^2 + 3*a*b^3 + (4*a^3*b - 7*a^2*b^2 - a*b^3 + 3*b^4)*tan(f*x 
+ e))*arctan(sqrt(4*tan(f*x + e) + 3) - 2) - (4*a^4 + 13*a^3*b - 16*a^2*b^ 
2 + 3*a*b^3 + (4*a^3*b + 13*a^2*b^2 - 16*a*b^3 + 3*b^4)*tan(f*x + e))*log( 
sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 2) + (4*a^4 + 13*a^3*b - 16*a^2* 
b^2 + 3*a*b^3 + (4*a^3*b + 13*a^2*b^2 - 16*a*b^3 + 3*b^4)*tan(f*x + e))*lo 
g(-sqrt(4*tan(f*x + e) + 3) + tan(f*x + e) + 2) - 10*(a^2*b^2 + b^4)*sqrt( 
4*tan(f*x + e) + 3))/((4*a^5*b - 3*a^4*b^2 + 8*a^3*b^3 - 6*a^2*b^4 + 4*a*b 
^5 - 3*b^6)*f*tan(f*x + e) + (4*a^6 - 3*a^5*b + 8*a^4*b^2 - 6*a^3*b^3 + 4* 
a^2*b^4 - 3*a*b^5)*f), 1/10*(40*(5*a^3*b - 3*a^2*b^2 + a*b^3 + (5*a^2*b^2 
- 3*a*b^3 + b^4)*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*(4*a^4 - 7*a^3*b - a^2*b^2 + 3*a*b^3 + ( 
4*a^3*b - 7*a^2*b^2 - a*b^3 + 3*b^4)*tan(f*x + e))*arctan(sqrt(4*tan(f*x + 
 e) + 3) + 2) + 4*(4*a^4 - 7*a^3*b - a^2*b^2 + 3*a*b^3 + (4*a^3*b - 7*a^2* 
b^2 - a*b^3 + 3*b^4)*tan(f*x + e))*arctan(sqrt(4*tan(f*x + e) + 3) - 2) + 
(4*a^4 + 13*a^3*b - 16*a^2*b^2 + 3*a*b^3 + (4*a^3*b + 13*a^2*b^2 - 16*a...
 

Sympy [F]

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

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

Output:

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

Maxima [F(-2)]

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

integrate(1/(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 {1}{\sqrt {3+4 \tan (e+f x)} (a+b \tan (e+f x))^2} \, dx=\text {Exception raised: TypeError} \] Input:

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

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

Output:

(atan(((((((4194304*(104*b^13*f^2 - 216*a*b^12*f^2 - 456*a^2*b^11*f^2 + 29 
28*a^3*b^10*f^2 - 5224*a^4*b^9*f^2 + 4104*a^5*b^8*f^2 - 3864*a^6*b^7*f^2 + 
 960*a^7*b^6*f^2 + 800*a^8*b^5*f^2))/(16*a^10*f^5 + 9*b^10*f^5 - 24*a*b^9* 
f^5 - 24*a^9*b*f^5 + 52*a^2*b^8*f^5 - 96*a^3*b^7*f^5 + 118*a^4*b^6*f^5 - 1 
44*a^5*b^5*f^5 + 132*a^6*b^4*f^5 - 96*a^7*b^3*f^5 + 73*a^8*b^2*f^5) + (((( 
(4194304*(984*b^17*f^4 - 3688*a*b^16*f^4 + 12288*a^2*b^15*f^4 - 24616*a^3* 
b^14*f^4 + 47064*a^4*b^13*f^4 - 67248*a^5*b^12*f^4 + 85440*a^6*b^11*f^4 - 
96080*a^7*b^10*f^4 + 82440*a^8*b^9*f^4 - 75080*a^9*b^8*f^4 + 41664*a^10*b^ 
7*f^4 - 29448*a^11*b^6*f^4 + 9288*a^12*b^5*f^4 - 3616*a^13*b^4*f^4 + 384*a 
^14*b^3*f^4 + 512*a^15*b^2*f^4))/(16*a^10*f^5 + 9*b^10*f^5 - 24*a*b^9*f^5 
- 24*a^9*b*f^5 + 52*a^2*b^8*f^5 - 96*a^3*b^7*f^5 + 118*a^4*b^6*f^5 - 144*a 
^5*b^5*f^5 + 132*a^6*b^4*f^5 - 96*a^7*b^3*f^5 + 73*a^8*b^2*f^5) - ((4*tan( 
e + f*x) + 3)^(1/2)*(4248*b^19*f^4 - 10464*a*b^18*f^4 + 27784*a^2*b^17*f^4 
 - 52512*a^3*b^16*f^4 + 69944*a^4*b^15*f^4 - 93792*a^5*b^14*f^4 + 74088*a^ 
6*b^13*f^4 - 45984*a^7*b^12*f^4 - 3640*a^8*b^11*f^4 + 71520*a^9*b^10*f^4 - 
 91112*a^10*b^9*f^4 + 122016*a^11*b^8*f^4 - 95256*a^12*b^7*f^4 + 74208*a^1 
3*b^6*f^4 - 43016*a^14*b^5*f^4 + 19488*a^15*b^4*f^4 - 7552*a^16*b^3*f^4 + 
1536*a^17*b^2*f^4)*(1048576/5 + 2097152i/5))/((a^2*f - b^2*f + a*b*f*2i)*( 
16*a^10*f^4 + 9*b^10*f^4 - 24*a*b^9*f^4 - 24*a^9*b*f^4 + 52*a^2*b^8*f^4 - 
96*a^3*b^7*f^4 + 118*a^4*b^6*f^4 - 144*a^5*b^5*f^4 + 132*a^6*b^4*f^4 - ...
 

Reduce [F]

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

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

Output:

( - sqrt(4*tan(e + f*x) + 3) + 8*int(sqrt(4*tan(e + f*x) + 3)/(16*tan(e + 
f*x)**3*a**2*b**2 - 48*tan(e + f*x)**3*a*b**3 + 36*tan(e + f*x)**3*b**4 + 
32*tan(e + f*x)**2*a**3*b - 84*tan(e + f*x)**2*a**2*b**2 + 36*tan(e + f*x) 
**2*a*b**3 + 27*tan(e + f*x)**2*b**4 + 16*tan(e + f*x)*a**4 - 24*tan(e + f 
*x)*a**3*b - 36*tan(e + f*x)*a**2*b**2 + 54*tan(e + f*x)*a*b**3 + 12*a**4 
- 36*a**3*b + 27*a**2*b**2),x)*tan(e + f*x)*a**3*b*f - 36*int(sqrt(4*tan(e 
 + f*x) + 3)/(16*tan(e + f*x)**3*a**2*b**2 - 48*tan(e + f*x)**3*a*b**3 + 3 
6*tan(e + f*x)**3*b**4 + 32*tan(e + f*x)**2*a**3*b - 84*tan(e + f*x)**2*a* 
*2*b**2 + 36*tan(e + f*x)**2*a*b**3 + 27*tan(e + f*x)**2*b**4 + 16*tan(e + 
 f*x)*a**4 - 24*tan(e + f*x)*a**3*b - 36*tan(e + f*x)*a**2*b**2 + 54*tan(e 
 + f*x)*a*b**3 + 12*a**4 - 36*a**3*b + 27*a**2*b**2),x)*tan(e + f*x)*a**2* 
b**2*f + 54*int(sqrt(4*tan(e + f*x) + 3)/(16*tan(e + f*x)**3*a**2*b**2 - 4 
8*tan(e + f*x)**3*a*b**3 + 36*tan(e + f*x)**3*b**4 + 32*tan(e + f*x)**2*a* 
*3*b - 84*tan(e + f*x)**2*a**2*b**2 + 36*tan(e + f*x)**2*a*b**3 + 27*tan(e 
 + f*x)**2*b**4 + 16*tan(e + f*x)*a**4 - 24*tan(e + f*x)*a**3*b - 36*tan(e 
 + f*x)*a**2*b**2 + 54*tan(e + f*x)*a*b**3 + 12*a**4 - 36*a**3*b + 27*a**2 
*b**2),x)*tan(e + f*x)*a*b**3*f - 27*int(sqrt(4*tan(e + f*x) + 3)/(16*tan( 
e + f*x)**3*a**2*b**2 - 48*tan(e + f*x)**3*a*b**3 + 36*tan(e + f*x)**3*b** 
4 + 32*tan(e + f*x)**2*a**3*b - 84*tan(e + f*x)**2*a**2*b**2 + 36*tan(e + 
f*x)**2*a*b**3 + 27*tan(e + f*x)**2*b**4 + 16*tan(e + f*x)*a**4 - 24*ta...