\(\int \frac {\sqrt {c+d \tan (e+f x)} (A+B \tan (e+f x)+C \tan ^2(e+f x))}{(a+b \tan (e+f x))^2} \, dx\) [95]

Optimal result
Mathematica [A] (verified)
Rubi [A] (warning: unable to verify)
Maple [B] (verified)
Fricas [F(-1)]
Sympy [F]
Maxima [F(-2)]
Giac [F(-2)]
Mupad [B] (verification not implemented)
Reduce [F]

Optimal result

Integrand size = 47, antiderivative size = 317 \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=-\frac {(i A+B-i C) \sqrt {c-i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(a-i b)^2 f}-\frac {(B-i (A-C)) \sqrt {c+i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{(a+i b)^2 f}-\frac {\left (a^3 b B d+a^4 C d+b^4 (2 B c+A d)+a b^3 (4 A c-4 c C-3 B d)-a^2 b^2 (2 B c+3 A d-5 C d)\right ) \text {arctanh}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{b^{3/2} \left (a^2+b^2\right )^2 \sqrt {b c-a d} f}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b \left (a^2+b^2\right ) f (a+b \tan (e+f x))} \] Output:

-(I*A+B-I*C)*(c-I*d)^(1/2)*arctanh((c+d*tan(f*x+e))^(1/2)/(c-I*d)^(1/2))/( 
a-I*b)^2/f-(B-I*(A-C))*(c+I*d)^(1/2)*arctanh((c+d*tan(f*x+e))^(1/2)/(c+I*d 
)^(1/2))/(a+I*b)^2/f-(a^3*b*B*d+a^4*C*d+b^4*(A*d+2*B*c)+a*b^3*(4*A*c-3*B*d 
-4*C*c)-a^2*b^2*(3*A*d+2*B*c-5*C*d))*arctanh(b^(1/2)*(c+d*tan(f*x+e))^(1/2 
)/(-a*d+b*c)^(1/2))/b^(3/2)/(a^2+b^2)^2/(-a*d+b*c)^(1/2)/f-(A*b^2-a*(B*b-C 
*a))*(c+d*tan(f*x+e))^(1/2)/b/(a^2+b^2)/f/(a+b*tan(f*x+e))
 

Mathematica [A] (verified)

Time = 4.31 (sec) , antiderivative size = 362, normalized size of antiderivative = 1.14 \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\frac {2 \left (\frac {\frac {i b \left (-(a+i b)^2 (A-i B-C) \sqrt {c-i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )+(a-i b)^2 (A+i B-C) \sqrt {c+i d} \text {arctanh}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )\right )}{2 f}-\frac {\left (a^3 b B d+a^4 C d+b^4 (2 B c+A d)+a b^3 (4 A c-4 c C-3 B d)+a^2 b^2 (-2 B c-3 A d+5 C d)\right ) \text {arctanh}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{2 \sqrt {b} \sqrt {b c-a d} f}}{\left (a^2+b^2\right )^2}-\frac {C \sqrt {c+d \tan (e+f x)}}{f (a+b \tan (e+f x))}+\frac {\left (-A b^2+a b B+a^2 C+2 b^2 C\right ) \sqrt {c+d \tan (e+f x)}}{2 \left (a^2+b^2\right ) f (a+b \tan (e+f x))}\right )}{b} \] Input:

Integrate[(Sqrt[c + d*Tan[e + f*x]]*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2 
))/(a + b*Tan[e + f*x])^2,x]
 

Output:

(2*((((I/2)*b*(-((a + I*b)^2*(A - I*B - C)*Sqrt[c - I*d]*ArcTanh[Sqrt[c + 
d*Tan[e + f*x]]/Sqrt[c - I*d]]) + (a - I*b)^2*(A + I*B - C)*Sqrt[c + I*d]* 
ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c + I*d]]))/f - ((a^3*b*B*d + a^4*C* 
d + b^4*(2*B*c + A*d) + a*b^3*(4*A*c - 4*c*C - 3*B*d) + a^2*b^2*(-2*B*c - 
3*A*d + 5*C*d))*ArcTanh[(Sqrt[b]*Sqrt[c + d*Tan[e + f*x]])/Sqrt[b*c - a*d] 
])/(2*Sqrt[b]*Sqrt[b*c - a*d]*f))/(a^2 + b^2)^2 - (C*Sqrt[c + d*Tan[e + f* 
x]])/(f*(a + b*Tan[e + f*x])) + ((-(A*b^2) + a*b*B + a^2*C + 2*b^2*C)*Sqrt 
[c + d*Tan[e + f*x]])/(2*(a^2 + b^2)*f*(a + b*Tan[e + f*x]))))/b
 

Rubi [A] (warning: unable to verify)

Time = 3.87 (sec) , antiderivative size = 327, normalized size of antiderivative = 1.03, number of steps used = 17, number of rules used = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.340, Rules used = {3042, 4128, 27, 3042, 4136, 27, 3042, 4022, 3042, 4020, 25, 73, 221, 4117, 73, 221}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan (e+f x)^2\right )}{(a+b \tan (e+f x))^2}dx\)

\(\Big \downarrow \) 4128

\(\displaystyle \frac {\int \frac {-\left (\left (-C a^2-b B a+A b^2-2 b^2 C\right ) d \tan ^2(e+f x)\right )-2 b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)+2 (b B-a C) \left (b c-\frac {a d}{2}\right )+2 A b \left (a c+\frac {b d}{2}\right )}{2 (a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{b \left (a^2+b^2\right )}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {-\left (\left (-C a^2-b B a+A b^2-2 b^2 C\right ) d \tan ^2(e+f x)\right )-2 b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)+(b B-a C) (2 b c-a d)+A b (2 a c+b d)}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{2 b \left (a^2+b^2\right )}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {-\left (\left (-C a^2-b B a+A b^2-2 b^2 C\right ) d \tan (e+f x)^2\right )-2 b ((A-C) (b c-a d)-B (a c+b d)) \tan (e+f x)+(b B-a C) (2 b c-a d)+A b (2 a c+b d)}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{2 b \left (a^2+b^2\right )}-\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}\)

\(\Big \downarrow \) 4136

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4022

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {1}{2} b (a-i b)^2 (c+i d) (A+i B-C) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {1}{2} b (a+i b)^2 (c-i d) (A-i B-C) \int \frac {i \tan (e+f x)+1}{\sqrt {c+d \tan (e+f x)}}dx\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {1}{2} b (a-i b)^2 (c+i d) (A+i B-C) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}}dx+\frac {1}{2} b (a+i b)^2 (c-i d) (A-i B-C) \int \frac {i \tan (e+f x)+1}{\sqrt {c+d \tan (e+f x)}}dx\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 4020

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {i b (a+i b)^2 (c-i d) (A-i B-C) \int -\frac {1}{(1-i \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}d(i \tan (e+f x))}{2 f}-\frac {i b (a-i b)^2 (c+i d) (A+i B-C) \int -\frac {1}{(i \tan (e+f x)+1) \sqrt {c+d \tan (e+f x)}}d(-i \tan (e+f x))}{2 f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {i b (a-i b)^2 (c+i d) (A+i B-C) \int \frac {1}{(i \tan (e+f x)+1) \sqrt {c+d \tan (e+f x)}}d(-i \tan (e+f x))}{2 f}-\frac {i b (a+i b)^2 (c-i d) (A-i B-C) \int \frac {1}{(1-i \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}d(i \tan (e+f x))}{2 f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {b (a-i b)^2 (c+i d) (A+i B-C) \int \frac {1}{-\frac {i \tan ^2(e+f x)}{d}-\frac {i c}{d}+1}d\sqrt {c+d \tan (e+f x)}}{d f}+\frac {b (a+i b)^2 (c-i d) (A-i B-C) \int \frac {1}{\frac {i \tan ^2(e+f x)}{d}+\frac {i c}{d}+1}d\sqrt {c+d \tan (e+f x)}}{d f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {\tan (e+f x)^2+1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}dx}{a^2+b^2}+\frac {2 \left (\frac {b (a-i b)^2 \sqrt {c+i d} (A+i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c+i d}}\right )}{f}+\frac {b (a+i b)^2 \sqrt {c-i d} (A-i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c-i d}}\right )}{f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 4117

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {\left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {1}{(a+b \tan (e+f x)) \sqrt {c+d \tan (e+f x)}}d\tan (e+f x)}{f \left (a^2+b^2\right )}+\frac {2 \left (\frac {b (a-i b)^2 \sqrt {c+i d} (A+i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c+i d}}\right )}{f}+\frac {b (a+i b)^2 \sqrt {c-i d} (A-i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c-i d}}\right )}{f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 73

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {\frac {2 \left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \int \frac {1}{a+\frac {b (c+d \tan (e+f x))}{d}-\frac {b c}{d}}d\sqrt {c+d \tan (e+f x)}}{d f \left (a^2+b^2\right )}+\frac {2 \left (\frac {b (a-i b)^2 \sqrt {c+i d} (A+i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c+i d}}\right )}{f}+\frac {b (a+i b)^2 \sqrt {c-i d} (A-i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c-i d}}\right )}{f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

\(\Big \downarrow \) 221

\(\displaystyle -\frac {\left (A b^2-a (b B-a C)\right ) \sqrt {c+d \tan (e+f x)}}{b f \left (a^2+b^2\right ) (a+b \tan (e+f x))}+\frac {-\frac {2 \left (a^4 C d+a^3 b B d-a^2 b^2 (3 A d+2 B c-5 C d)+a b^3 (4 A c-3 B d-4 c C)+b^4 (A d+2 B c)\right ) \text {arctanh}\left (\frac {\sqrt {b} \sqrt {c+d \tan (e+f x)}}{\sqrt {b c-a d}}\right )}{\sqrt {b} f \left (a^2+b^2\right ) \sqrt {b c-a d}}+\frac {2 \left (\frac {b (a-i b)^2 \sqrt {c+i d} (A+i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c+i d}}\right )}{f}+\frac {b (a+i b)^2 \sqrt {c-i d} (A-i B-C) \arctan \left (\frac {\tan (e+f x)}{\sqrt {c-i d}}\right )}{f}\right )}{a^2+b^2}}{2 b \left (a^2+b^2\right )}\)

Input:

Int[(Sqrt[c + d*Tan[e + f*x]]*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(a 
+ b*Tan[e + f*x])^2,x]
 

Output:

((2*(((a + I*b)^2*b*(A - I*B - C)*Sqrt[c - I*d]*ArcTan[Tan[e + f*x]/Sqrt[c 
 - I*d]])/f + ((a - I*b)^2*b*(A + I*B - C)*Sqrt[c + I*d]*ArcTan[Tan[e + f* 
x]/Sqrt[c + I*d]])/f))/(a^2 + b^2) - (2*(a^3*b*B*d + a^4*C*d + b^4*(2*B*c 
+ A*d) + a*b^3*(4*A*c - 4*c*C - 3*B*d) - a^2*b^2*(2*B*c + 3*A*d - 5*C*d))* 
ArcTanh[(Sqrt[b]*Sqrt[c + d*Tan[e + f*x]])/Sqrt[b*c - a*d]])/(Sqrt[b]*(a^2 
 + b^2)*Sqrt[b*c - a*d]*f))/(2*b*(a^2 + b^2)) - ((A*b^2 - a*(b*B - a*C))*S 
qrt[c + d*Tan[e + f*x]])/(b*(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 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

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

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

rule 4022
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2   Int[(a + b*Tan[e + f*x])^m*( 
1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2   Int[(a + b*Tan[e + f*x])^m 
*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c 
 - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] &&  !IntegerQ[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 4128
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^(n_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) 
 + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*d^2 + c*(c*C - B*d))*(a + b*Tan[e + 
 f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - Sim 
p[1/(d*(n + 1)*(c^2 + d^2))   Int[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e 
 + f*x])^(n + 1)*Simp[A*d*(b*d*m - a*c*(n + 1)) + (c*C - B*d)*(b*c*m + a*d* 
(n + 1)) - d*(n + 1)*((A - C)*(b*c - a*d) + B*(a*c + b*d))*Tan[e + f*x] - b 
*(d*(B*c - A*d)*(m + n + 1) - C*(c^2*m - d^2*(n + 1)))*Tan[e + f*x]^2, x], 
x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ 
[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
 

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 [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(5777\) vs. \(2(284)=568\).

Time = 0.21 (sec) , antiderivative size = 5778, normalized size of antiderivative = 18.23

method result size
derivativedivides \(\text {Expression too large to display}\) \(5778\)
default \(\text {Expression too large to display}\) \(5778\)

Input:

int((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e) 
)^2,x,method=_RETURNVERBOSE)
 

Output:

result too large to display
 

Fricas [F(-1)]

Timed out. \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Timed out} \] Input:

integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan( 
f*x+e))^2,x, algorithm="fricas")
 

Output:

Timed out
 

Sympy [F]

\[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\int \frac {\sqrt {c + d \tan {\left (e + f x \right )}} \left (A + B \tan {\left (e + f x \right )} + C \tan ^{2}{\left (e + f x \right )}\right )}{\left (a + b \tan {\left (e + f x \right )}\right )^{2}}\, dx \] Input:

integrate((c+d*tan(f*x+e))**(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(a+b*ta 
n(f*x+e))**2,x)
 

Output:

Integral(sqrt(c + d*tan(e + f*x))*(A + B*tan(e + f*x) + C*tan(e + f*x)**2) 
/(a + b*tan(e + f*x))**2, x)
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Exception raised: ValueError} \] Input:

integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^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(a*d-b*c>0)', see `assume?` for m 
ore detail
 

Giac [F(-2)]

Exception generated. \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Exception raised: TypeError} \] Input:

integrate((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^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:Unable to divide, perhaps due to ro 
unding error%%%{%%%{1,[0,14,6]%%%}+%%%{6,[0,12,6]%%%}+%%%{15,[0,10,6]%%%}+ 
%%%{20,[0
 

Mupad [B] (verification not implemented)

Time = 39.99 (sec) , antiderivative size = 138318, normalized size of antiderivative = 436.33 \[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {Too large to display} \] Input:

int(((c + d*tan(e + f*x))^(1/2)*(A + B*tan(e + f*x) + C*tan(e + f*x)^2))/( 
a + b*tan(e + f*x))^2,x)
 

Output:

atan(((((8*(156*B^3*a^2*b^9*d^12*f^2 - 16*B^3*a^4*b^7*d^12*f^2 - 120*B^3*a 
^6*b^5*d^12*f^2 + 48*B^3*a^8*b^3*d^12*f^2 + 12*B^3*b^11*c^2*d^10*f^2 + 12* 
B^3*b^11*c^4*d^8*f^2 - 4*B^3*a^10*b*d^12*f^2 - 124*B^3*a*b^10*c*d^11*f^2 - 
 124*B^3*a*b^10*c^3*d^9*f^2 + 224*B^3*a^3*b^8*c*d^11*f^2 + 200*B^3*a^5*b^6 
*c*d^11*f^2 - 128*B^3*a^7*b^4*c*d^11*f^2 + 20*B^3*a^9*b^2*c*d^11*f^2 - 4*B 
^3*a^10*b*c^2*d^10*f^2 + 44*B^3*a^2*b^9*c^2*d^10*f^2 - 112*B^3*a^2*b^9*c^4 
*d^8*f^2 + 224*B^3*a^3*b^8*c^3*d^9*f^2 - 40*B^3*a^4*b^7*c^2*d^10*f^2 - 24* 
B^3*a^4*b^7*c^4*d^8*f^2 + 200*B^3*a^5*b^6*c^3*d^9*f^2 - 40*B^3*a^6*b^5*c^2 
*d^10*f^2 + 80*B^3*a^6*b^5*c^4*d^8*f^2 - 128*B^3*a^7*b^4*c^3*d^9*f^2 + 28* 
B^3*a^8*b^3*c^2*d^10*f^2 - 20*B^3*a^8*b^3*c^4*d^8*f^2 + 20*B^3*a^9*b^2*c^3 
*d^9*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) + (((8*(80*B*a*b^14*d^11*f^4 - 48*B*b^15*c*d^10*f^4 + 384*B*a^3*b^12* 
d^11*f^4 + 720*B*a^5*b^10*d^11*f^4 + 640*B*a^7*b^8*d^11*f^4 + 240*B*a^9*b^ 
6*d^11*f^4 - 16*B*a^13*b^2*d^11*f^4 - 48*B*b^15*c^3*d^8*f^4 + 80*B*a*b^14* 
c^2*d^9*f^4 - 224*B*a^2*b^13*c*d^10*f^4 - 400*B*a^4*b^11*c*d^10*f^4 - 320* 
B*a^6*b^9*c*d^10*f^4 - 80*B*a^8*b^7*c*d^10*f^4 + 32*B*a^10*b^5*c*d^10*f^4 
+ 16*B*a^12*b^3*c*d^10*f^4 - 224*B*a^2*b^13*c^3*d^8*f^4 + 384*B*a^3*b^12*c 
^2*d^9*f^4 - 400*B*a^4*b^11*c^3*d^8*f^4 + 720*B*a^5*b^10*c^2*d^9*f^4 - 320 
*B*a^6*b^9*c^3*d^8*f^4 + 640*B*a^7*b^8*c^2*d^9*f^4 - 80*B*a^8*b^7*c^3*d^8* 
f^4 + 240*B*a^9*b^6*c^2*d^9*f^4 + 32*B*a^10*b^5*c^3*d^8*f^4 + 16*B*a^12...
 

Reduce [F]

\[ \int \frac {\sqrt {c+d \tan (e+f x)} \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(a+b \tan (e+f x))^2} \, dx=\text {too large to display} \] Input:

int((c+d*tan(f*x+e))^(1/2)*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(a+b*tan(f*x+e) 
)^2,x)
 

Output:

( - 2*sqrt(tan(e + f*x)*d + c)*a**2*d + 4*sqrt(tan(e + f*x)*d + c)*a*b*c + 
 2*sqrt(tan(e + f*x)*d + c)*b**2*d + int(sqrt(tan(e + f*x)*d + c)/(tan(e + 
 f*x)**3*b**2*d + 2*tan(e + f*x)**2*a*b*d + tan(e + f*x)**2*b**2*c + tan(e 
 + f*x)*a**2*d + 2*tan(e + f*x)*a*b*c + a**2*c),x)*tan(e + f*x)*a**3*b*d** 
2*f - 3*int(sqrt(tan(e + f*x)*d + c)/(tan(e + f*x)**3*b**2*d + 2*tan(e + f 
*x)**2*a*b*d + tan(e + f*x)**2*b**2*c + tan(e + f*x)*a**2*d + 2*tan(e + f* 
x)*a*b*c + a**2*c),x)*tan(e + f*x)*a**2*b**2*c*d*f + 2*int(sqrt(tan(e + f* 
x)*d + c)/(tan(e + f*x)**3*b**2*d + 2*tan(e + f*x)**2*a*b*d + tan(e + f*x) 
**2*b**2*c + tan(e + f*x)*a**2*d + 2*tan(e + f*x)*a*b*c + a**2*c),x)*tan(e 
 + f*x)*a*b**3*c**2*f + int(sqrt(tan(e + f*x)*d + c)/(tan(e + f*x)**3*b**2 
*d + 2*tan(e + f*x)**2*a*b*d + tan(e + f*x)**2*b**2*c + tan(e + f*x)*a**2* 
d + 2*tan(e + f*x)*a*b*c + a**2*c),x)*a**4*d**2*f - 3*int(sqrt(tan(e + f*x 
)*d + c)/(tan(e + f*x)**3*b**2*d + 2*tan(e + f*x)**2*a*b*d + tan(e + f*x)* 
*2*b**2*c + tan(e + f*x)*a**2*d + 2*tan(e + f*x)*a*b*c + a**2*c),x)*a**3*b 
*c*d*f + 2*int(sqrt(tan(e + f*x)*d + c)/(tan(e + f*x)**3*b**2*d + 2*tan(e 
+ f*x)**2*a*b*d + tan(e + f*x)**2*b**2*c + tan(e + f*x)*a**2*d + 2*tan(e + 
 f*x)*a*b*c + a**2*c),x)*a**2*b**2*c**2*f - int(sqrt(tan(e + f*x)*d + c)/( 
tan(e + f*x)**3*a*b**2*d**2 - 2*tan(e + f*x)**3*b**3*c*d + 2*tan(e + f*x)* 
*2*a**2*b*d**2 - 3*tan(e + f*x)**2*a*b**2*c*d - 2*tan(e + f*x)**2*b**3*c** 
2 + tan(e + f*x)*a**3*d**2 - 4*tan(e + f*x)*a*b**2*c**2 + a**3*c*d - 2*...