\(\int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx\) [145]

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

Optimal result

Integrand size = 36, antiderivative size = 297 \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\frac {\left (\frac {1}{16}-\frac {i}{16}\right ) ((47+2 i) A+(2+23 i) B) \arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2} a^2 d}-\frac {\left (\frac {1}{16}-\frac {i}{16}\right ) ((47+2 i) A+(2+23 i) B) \arctan \left (1+\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2} a^2 d}-\frac {\left (\frac {1}{16}-\frac {i}{16}\right ) ((2+47 i) A-(23+2 i) B) \text {arctanh}\left (\frac {\sqrt {2} \sqrt {\tan (c+d x)}}{1+\tan (c+d x)}\right )}{\sqrt {2} a^2 d}-\frac {7 (7 A+3 i B)}{24 a^2 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {9 A+5 i B}{8 a^2 d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}+\frac {5 (9 i A-5 B)}{8 a^2 d \sqrt {\tan (c+d x)}}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2} \] Output:

(-1/32+1/32*I)*((47+2*I)*A+(2+23*I)*B)*arctan(-1+2^(1/2)*tan(d*x+c)^(1/2)) 
*2^(1/2)/a^2/d+(-1/32+1/32*I)*((47+2*I)*A+(2+23*I)*B)*arctan(1+2^(1/2)*tan 
(d*x+c)^(1/2))*2^(1/2)/a^2/d+(-1/32+1/32*I)*((2+47*I)*A-(23+2*I)*B)*arctan 
h(2^(1/2)*tan(d*x+c)^(1/2)/(1+tan(d*x+c)))*2^(1/2)/a^2/d-7/24*(7*A+3*I*B)/ 
a^2/d/tan(d*x+c)^(3/2)+1/8*(9*A+5*I*B)/a^2/d/(1+I*tan(d*x+c))/tan(d*x+c)^( 
3/2)+5/8*(9*I*A-5*B)/a^2/d/tan(d*x+c)^(1/2)+1/4*(A+I*B)/d/tan(d*x+c)^(3/2) 
/(a+I*a*tan(d*x+c))^2
                                                                                    
                                                                                    
 

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 1.30 (sec) , antiderivative size = 180, normalized size of antiderivative = 0.61 \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\frac {\sec ^2(c+d x) \left (-6 \cos (c+d x) ((11 A+7 i B) \cos (c+d x)+(9 i A-5 B) \sin (c+d x))+2 (47 A+23 i B) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-i \tan (c+d x)\right ) (\cos (2 (c+d x))+i \sin (2 (c+d x)))+4 (A-i B) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},i \tan (c+d x)\right ) (\cos (2 (c+d x))+i \sin (2 (c+d x)))\right )}{48 a^2 d \tan ^{\frac {3}{2}}(c+d x) (-i+\tan (c+d x))^2} \] Input:

Integrate[(A + B*Tan[c + d*x])/(Tan[c + d*x]^(5/2)*(a + I*a*Tan[c + d*x])^ 
2),x]
 

Output:

(Sec[c + d*x]^2*(-6*Cos[c + d*x]*((11*A + (7*I)*B)*Cos[c + d*x] + ((9*I)*A 
 - 5*B)*Sin[c + d*x]) + 2*(47*A + (23*I)*B)*Hypergeometric2F1[-3/2, 1, -1/ 
2, (-I)*Tan[c + d*x]]*(Cos[2*(c + d*x)] + I*Sin[2*(c + d*x)]) + 4*(A - I*B 
)*Hypergeometric2F1[-3/2, 1, -1/2, I*Tan[c + d*x]]*(Cos[2*(c + d*x)] + I*S 
in[2*(c + d*x)])))/(48*a^2*d*Tan[c + d*x]^(3/2)*(-I + Tan[c + d*x])^2)
 

Rubi [A] (verified)

Time = 1.24 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.06, number of steps used = 22, number of rules used = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {3042, 4079, 27, 3042, 4079, 3042, 4012, 25, 3042, 4012, 3042, 4017, 27, 1482, 1476, 1082, 217, 1479, 25, 27, 1103}

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 (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {A+B \tan (c+d x)}{\tan (c+d x)^{5/2} (a+i a \tan (c+d x))^2}dx\)

\(\Big \downarrow \) 4079

\(\displaystyle \frac {\int \frac {a (11 A+3 i B)-7 a (i A-B) \tan (c+d x)}{2 \tan ^{\frac {5}{2}}(c+d x) (i \tan (c+d x) a+a)}dx}{4 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\int \frac {a (11 A+3 i B)-7 a (i A-B) \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (i \tan (c+d x) a+a)}dx}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {a (11 A+3 i B)-7 a (i A-B) \tan (c+d x)}{\tan (c+d x)^{5/2} (i \tan (c+d x) a+a)}dx}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 4079

\(\displaystyle \frac {\frac {\int \frac {7 a^2 (7 A+3 i B)-5 a^2 (9 i A-5 B) \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x)}dx}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {\int \frac {7 a^2 (7 A+3 i B)-5 a^2 (9 i A-5 B) \tan (c+d x)}{\tan (c+d x)^{5/2}}dx}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 4012

\(\displaystyle \frac {\frac {\int -\frac {5 (9 i A-5 B) a^2+7 (7 A+3 i B) \tan (c+d x) a^2}{\tan ^{\frac {3}{2}}(c+d x)}dx-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {-\int \frac {5 (9 i A-5 B) a^2+7 (7 A+3 i B) \tan (c+d x) a^2}{\tan ^{\frac {3}{2}}(c+d x)}dx-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {-\int \frac {5 (9 i A-5 B) a^2+7 (7 A+3 i B) \tan (c+d x) a^2}{\tan (c+d x)^{3/2}}dx-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 4012

\(\displaystyle \frac {\frac {-\int \frac {7 a^2 (7 A+3 i B)-5 a^2 (9 i A-5 B) \tan (c+d x)}{\sqrt {\tan (c+d x)}}dx-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {-\int \frac {7 a^2 (7 A+3 i B)-5 a^2 (9 i A-5 B) \tan (c+d x)}{\sqrt {\tan (c+d x)}}dx-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 4017

\(\displaystyle \frac {\frac {-\frac {2 \int \frac {a^2 (7 (7 A+3 i B)-5 (9 i A-5 B) \tan (c+d x))}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {-\frac {2 a^2 \int \frac {7 (7 A+3 i B)-5 (9 i A-5 B) \tan (c+d x)}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 1482

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \int \frac {1-\tan (c+d x)}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \int \frac {\tan (c+d x)+1}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 1476

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \int \frac {1-\tan (c+d x)}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {1}{2} \int \frac {1}{\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}+\frac {1}{2} \int \frac {1}{\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 1082

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \int \frac {1-\tan (c+d x)}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\int \frac {1}{-\tan (c+d x)-1}d\left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}-\frac {\int \frac {1}{-\tan (c+d x)-1}d\left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 217

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \int \frac {1-\tan (c+d x)}{\tan ^2(c+d x)+1}d\sqrt {\tan (c+d x)}+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 1479

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \left (-\frac {\int -\frac {\sqrt {2}-2 \sqrt {\tan (c+d x)}}{\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}}{2 \sqrt {2}}-\frac {\int -\frac {\sqrt {2} \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}}{2 \sqrt {2}}\right )+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \left (\frac {\int \frac {\sqrt {2}-2 \sqrt {\tan (c+d x)}}{\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}}{2 \sqrt {2}}+\frac {\int \frac {\sqrt {2} \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}}{2 \sqrt {2}}\right )+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\frac {1}{2} ((49+45 i) A-(25-21 i) B) \left (\frac {\int \frac {\sqrt {2}-2 \sqrt {\tan (c+d x)}}{\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}}{2 \sqrt {2}}+\frac {1}{2} \int \frac {\sqrt {2} \sqrt {\tan (c+d x)}+1}{\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1}d\sqrt {\tan (c+d x)}\right )+\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

\(\Big \downarrow \) 1103

\(\displaystyle \frac {\frac {-\frac {2 a^2 \left (\left (\frac {1}{2}-\frac {i}{2}\right ) ((47+2 i) A+(2+23 i) B) \left (\frac {\arctan \left (\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\sqrt {2} \sqrt {\tan (c+d x)}\right )}{\sqrt {2}}\right )+\frac {1}{2} ((49+45 i) A-(25-21 i) B) \left (\frac {\log \left (\tan (c+d x)+\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{2 \sqrt {2}}-\frac {\log \left (\tan (c+d x)-\sqrt {2} \sqrt {\tan (c+d x)}+1\right )}{2 \sqrt {2}}\right )\right )}{d}-\frac {14 a^2 (7 A+3 i B)}{3 d \tan ^{\frac {3}{2}}(c+d x)}+\frac {10 a^2 (-5 B+9 i A)}{d \sqrt {\tan (c+d x)}}}{2 a^2}+\frac {9 A+5 i B}{d (1+i \tan (c+d x)) \tan ^{\frac {3}{2}}(c+d x)}}{8 a^2}+\frac {A+i B}{4 d \tan ^{\frac {3}{2}}(c+d x) (a+i a \tan (c+d x))^2}\)

Input:

Int[(A + B*Tan[c + d*x])/(Tan[c + d*x]^(5/2)*(a + I*a*Tan[c + d*x])^2),x]
 

Output:

(((-2*a^2*((1/2 - I/2)*((47 + 2*I)*A + (2 + 23*I)*B)*(-(ArcTan[1 - Sqrt[2] 
*Sqrt[Tan[c + d*x]]]/Sqrt[2]) + ArcTan[1 + Sqrt[2]*Sqrt[Tan[c + d*x]]]/Sqr 
t[2]) + (((49 + 45*I)*A - (25 - 21*I)*B)*(-1/2*Log[1 - Sqrt[2]*Sqrt[Tan[c 
+ d*x]] + Tan[c + d*x]]/Sqrt[2] + Log[1 + Sqrt[2]*Sqrt[Tan[c + d*x]] + Tan 
[c + d*x]]/(2*Sqrt[2])))/2))/d - (14*a^2*(7*A + (3*I)*B))/(3*d*Tan[c + d*x 
]^(3/2)) + (10*a^2*((9*I)*A - 5*B))/(d*Sqrt[Tan[c + d*x]]))/(2*a^2) + (9*A 
 + (5*I)*B)/(d*(1 + I*Tan[c + d*x])*Tan[c + d*x]^(3/2)))/(8*a^2) + (A + I* 
B)/(4*d*Tan[c + d*x]^(3/2)*(a + I*a*Tan[c + d*x])^2)
 

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

rule 1082
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*S 
implify[a*(c/b^2)]}, Simp[-2/b   Subst[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b 
)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /; Fre 
eQ[{a, b, c}, x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, 
e}, x] && EqQ[2*c*d - b*e, 0]
 

rule 1476
Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[ 
2*(d/e), 2]}, Simp[e/(2*c)   Int[1/Simp[d/e + q*x + x^2, x], x], x] + Simp[ 
e/(2*c)   Int[1/Simp[d/e - q*x + x^2, x], x], x]] /; FreeQ[{a, c, d, e}, x] 
 && EqQ[c*d^2 - a*e^2, 0] && PosQ[d*e]
 

rule 1479
Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[ 
-2*(d/e), 2]}, Simp[e/(2*c*q)   Int[(q - 2*x)/Simp[d/e + q*x - x^2, x], x], 
 x] + Simp[e/(2*c*q)   Int[(q + 2*x)/Simp[d/e - q*x - x^2, x], x], x]] /; F 
reeQ[{a, c, d, e}, x] && EqQ[c*d^2 - a*e^2, 0] && NegQ[d*e]
 

rule 1482
Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[ 
a*c, 2]}, Simp[(d*q + a*e)/(2*a*c)   Int[(q + c*x^2)/(a + c*x^4), x], x] + 
Simp[(d*q - a*e)/(2*a*c)   Int[(q - c*x^2)/(a + c*x^4), x], x]] /; FreeQ[{a 
, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && NeQ[c*d^2 - a*e^2, 0] && NegQ[(- 
a)*c]
 

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

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

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

rule 4079
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
(f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim 
p[(a*A + b*B)*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(2*f*m*( 
b*c - a*d))), x] + Simp[1/(2*a*m*(b*c - a*d))   Int[(a + b*Tan[e + f*x])^(m 
 + 1)*(c + d*Tan[e + f*x])^n*Simp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m 
- b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x] /; Free 
Q[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] 
 && LtQ[m, 0] &&  !GtQ[n, 0]
 
Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 176, normalized size of antiderivative = 0.59

method result size
derivativedivides \(\frac {-\frac {i \left (\frac {\left (-\frac {13 A}{2}-\frac {9 i B}{2}\right ) \tan \left (d x +c \right )^{\frac {3}{2}}+\left (\frac {15 i A}{2}-\frac {11 B}{2}\right ) \sqrt {\tan \left (d x +c \right )}}{\left (-i+\tan \left (d x +c \right )\right )^{2}}-\frac {\left (23 i B +47 A \right ) \arctan \left (\frac {2 \sqrt {\tan \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{\sqrt {2}-i \sqrt {2}}\right )}{4}-\frac {i \left (-i B +A \right ) \arctan \left (\frac {2 \sqrt {\tan \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{2 \left (\sqrt {2}+i \sqrt {2}\right )}-\frac {2 A}{3 \tan \left (d x +c \right )^{\frac {3}{2}}}-\frac {2 \left (-2 i A +B \right )}{\sqrt {\tan \left (d x +c \right )}}}{d \,a^{2}}\) \(176\)
default \(\frac {-\frac {i \left (\frac {\left (-\frac {13 A}{2}-\frac {9 i B}{2}\right ) \tan \left (d x +c \right )^{\frac {3}{2}}+\left (\frac {15 i A}{2}-\frac {11 B}{2}\right ) \sqrt {\tan \left (d x +c \right )}}{\left (-i+\tan \left (d x +c \right )\right )^{2}}-\frac {\left (23 i B +47 A \right ) \arctan \left (\frac {2 \sqrt {\tan \left (d x +c \right )}}{\sqrt {2}-i \sqrt {2}}\right )}{\sqrt {2}-i \sqrt {2}}\right )}{4}-\frac {i \left (-i B +A \right ) \arctan \left (\frac {2 \sqrt {\tan \left (d x +c \right )}}{\sqrt {2}+i \sqrt {2}}\right )}{2 \left (\sqrt {2}+i \sqrt {2}\right )}-\frac {2 A}{3 \tan \left (d x +c \right )^{\frac {3}{2}}}-\frac {2 \left (-2 i A +B \right )}{\sqrt {\tan \left (d x +c \right )}}}{d \,a^{2}}\) \(176\)

Input:

int((A+B*tan(d*x+c))/tan(d*x+c)^(5/2)/(a+I*a*tan(d*x+c))^2,x,method=_RETUR 
NVERBOSE)
 

Output:

1/d/a^2*(-1/4*I*(((-13/2*A-9/2*I*B)*tan(d*x+c)^(3/2)+(15/2*I*A-11/2*B)*tan 
(d*x+c)^(1/2))/(-I+tan(d*x+c))^2-(47*A+23*I*B)/(2^(1/2)-I*2^(1/2))*arctan( 
2*tan(d*x+c)^(1/2)/(2^(1/2)-I*2^(1/2))))-1/2*I*(A-I*B)/(2^(1/2)+I*2^(1/2)) 
*arctan(2*tan(d*x+c)^(1/2)/(2^(1/2)+I*2^(1/2)))-2/3*A/tan(d*x+c)^(3/2)-2*( 
-2*I*A+B)/tan(d*x+c)^(1/2))
 

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 861 vs. \(2 (220) = 440\).

Time = 0.12 (sec) , antiderivative size = 861, normalized size of antiderivative = 2.90 \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\text {Too large to display} \] Input:

integrate((A+B*tan(d*x+c))/tan(d*x+c)^(5/2)/(a+I*a*tan(d*x+c))^2,x, algori 
thm="fricas")
 

Output:

1/96*(6*(a^2*d*e^(8*I*d*x + 8*I*c) - 2*a^2*d*e^(6*I*d*x + 6*I*c) + a^2*d*e 
^(4*I*d*x + 4*I*c))*sqrt((-I*A^2 - 2*A*B + I*B^2)/(a^4*d^2))*log(-2*((I*a^ 
2*d*e^(2*I*d*x + 2*I*c) + I*a^2*d)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2 
*I*d*x + 2*I*c) + 1))*sqrt((-I*A^2 - 2*A*B + I*B^2)/(a^4*d^2)) - (A - I*B) 
*e^(2*I*d*x + 2*I*c))*e^(-2*I*d*x - 2*I*c)/(I*A + B)) - 6*(a^2*d*e^(8*I*d* 
x + 8*I*c) - 2*a^2*d*e^(6*I*d*x + 6*I*c) + a^2*d*e^(4*I*d*x + 4*I*c))*sqrt 
((-I*A^2 - 2*A*B + I*B^2)/(a^4*d^2))*log(-2*((-I*a^2*d*e^(2*I*d*x + 2*I*c) 
 - I*a^2*d)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1))*s 
qrt((-I*A^2 - 2*A*B + I*B^2)/(a^4*d^2)) - (A - I*B)*e^(2*I*d*x + 2*I*c))*e 
^(-2*I*d*x - 2*I*c)/(I*A + B)) - 3*(a^2*d*e^(8*I*d*x + 8*I*c) - 2*a^2*d*e^ 
(6*I*d*x + 6*I*c) + a^2*d*e^(4*I*d*x + 4*I*c))*sqrt((2209*I*A^2 - 2162*A*B 
 - 529*I*B^2)/(a^4*d^2))*log(-1/8*((a^2*d*e^(2*I*d*x + 2*I*c) + a^2*d)*sqr 
t((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1))*sqrt((2209*I*A^2 
 - 2162*A*B - 529*I*B^2)/(a^4*d^2)) + 47*I*A - 23*B)*e^(-2*I*d*x - 2*I*c)/ 
(a^2*d)) + 3*(a^2*d*e^(8*I*d*x + 8*I*c) - 2*a^2*d*e^(6*I*d*x + 6*I*c) + a^ 
2*d*e^(4*I*d*x + 4*I*c))*sqrt((2209*I*A^2 - 2162*A*B - 529*I*B^2)/(a^4*d^2 
))*log(1/8*((a^2*d*e^(2*I*d*x + 2*I*c) + a^2*d)*sqrt((-I*e^(2*I*d*x + 2*I* 
c) + I)/(e^(2*I*d*x + 2*I*c) + 1))*sqrt((2209*I*A^2 - 2162*A*B - 529*I*B^2 
)/(a^4*d^2)) - 47*I*A + 23*B)*e^(-2*I*d*x - 2*I*c)/(a^2*d)) - 2*(2*(101*A 
+ 63*I*B)*e^(8*I*d*x + 8*I*c) - (103*A + 27*I*B)*e^(6*I*d*x + 6*I*c) - ...
 

Sympy [F(-1)]

Timed out. \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\text {Timed out} \] Input:

integrate((A+B*tan(d*x+c))/tan(d*x+c)**(5/2)/(a+I*a*tan(d*x+c))**2,x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:

integrate((A+B*tan(d*x+c))/tan(d*x+c)^(5/2)/(a+I*a*tan(d*x+c))^2,x, algori 
thm="maxima")
 

Output:

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negati 
ve exponent.
 

Giac [A] (verification not implemented)

Time = 0.59 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.50 \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\frac {3 \, \sqrt {2} {\left (-\left (47 i - 47\right ) \, A + \left (23 i + 23\right ) \, B\right )} \arctan \left (\left (\frac {1}{2} i + \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right ) + 6 \, \sqrt {2} {\left (\left (i + 1\right ) \, A - \left (i - 1\right ) \, B\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right ) + \frac {32 \, {\left (-6 i \, A \tan \left (d x + c\right ) + 3 \, B \tan \left (d x + c\right ) + A\right )}}{\tan \left (d x + c\right )^{\frac {3}{2}}} + \frac {6 \, {\left (-13 i \, A \tan \left (d x + c\right )^{\frac {3}{2}} + 9 \, B \tan \left (d x + c\right )^{\frac {3}{2}} - 15 \, A \sqrt {\tan \left (d x + c\right )} - 11 i \, B \sqrt {\tan \left (d x + c\right )}\right )}}{{\left (\tan \left (d x + c\right ) - i\right )}^{2}}}{48 \, a^{2} d} \] Input:

integrate((A+B*tan(d*x+c))/tan(d*x+c)^(5/2)/(a+I*a*tan(d*x+c))^2,x, algori 
thm="giac")
 

Output:

-1/48*(3*sqrt(2)*(-(47*I - 47)*A + (23*I + 23)*B)*arctan((1/2*I + 1/2)*sqr 
t(2)*sqrt(tan(d*x + c))) + 6*sqrt(2)*((I + 1)*A - (I - 1)*B)*arctan(-(1/2* 
I - 1/2)*sqrt(2)*sqrt(tan(d*x + c))) + 32*(-6*I*A*tan(d*x + c) + 3*B*tan(d 
*x + c) + A)/tan(d*x + c)^(3/2) + 6*(-13*I*A*tan(d*x + c)^(3/2) + 9*B*tan( 
d*x + c)^(3/2) - 15*A*sqrt(tan(d*x + c)) - 11*I*B*sqrt(tan(d*x + c)))/(tan 
(d*x + c) - I)^2)/(a^2*d)
 

Mupad [B] (verification not implemented)

Time = 7.84 (sec) , antiderivative size = 373, normalized size of antiderivative = 1.26 \[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=-\mathrm {atan}\left (\frac {8\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-\frac {A^2\,1{}\mathrm {i}}{64\,a^4\,d^2}}}{A}\right )\,\sqrt {-\frac {A^2\,1{}\mathrm {i}}{64\,a^4\,d^2}}\,2{}\mathrm {i}+\mathrm {atan}\left (\frac {16\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {\frac {A^2\,2209{}\mathrm {i}}{256\,a^4\,d^2}}}{47\,A}\right )\,\sqrt {\frac {A^2\,2209{}\mathrm {i}}{256\,a^4\,d^2}}\,2{}\mathrm {i}+2\,\mathrm {atanh}\left (\frac {8\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {\frac {B^2\,1{}\mathrm {i}}{64\,a^4\,d^2}}}{B}\right )\,\sqrt {\frac {B^2\,1{}\mathrm {i}}{64\,a^4\,d^2}}+2\,\mathrm {atanh}\left (\frac {16\,a^2\,d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\sqrt {-\frac {B^2\,529{}\mathrm {i}}{256\,a^4\,d^2}}}{23\,B}\right )\,\sqrt {-\frac {B^2\,529{}\mathrm {i}}{256\,a^4\,d^2}}+\frac {\frac {8\,A\,\mathrm {tan}\left (c+d\,x\right )}{3\,a^2\,d}-\frac {45\,A\,{\mathrm {tan}\left (c+d\,x\right )}^3}{8\,a^2\,d}+\frac {A\,2{}\mathrm {i}}{3\,a^2\,d}+\frac {A\,{\mathrm {tan}\left (c+d\,x\right )}^2\,221{}\mathrm {i}}{24\,a^2\,d}}{2\,{\mathrm {tan}\left (c+d\,x\right )}^{5/2}-{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^{7/2}\,1{}\mathrm {i}}-\frac {\frac {43\,B\,\mathrm {tan}\left (c+d\,x\right )}{8\,a^2\,d}-\frac {B\,2{}\mathrm {i}}{a^2\,d}+\frac {B\,{\mathrm {tan}\left (c+d\,x\right )}^2\,25{}\mathrm {i}}{8\,a^2\,d}}{2\,{\mathrm {tan}\left (c+d\,x\right )}^{3/2}-\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,1{}\mathrm {i}+{\mathrm {tan}\left (c+d\,x\right )}^{5/2}\,1{}\mathrm {i}} \] Input:

int((A + B*tan(c + d*x))/(tan(c + d*x)^(5/2)*(a + a*tan(c + d*x)*1i)^2),x)
 

Output:

atan((16*a^2*d*tan(c + d*x)^(1/2)*((A^2*2209i)/(256*a^4*d^2))^(1/2))/(47*A 
))*((A^2*2209i)/(256*a^4*d^2))^(1/2)*2i - atan((8*a^2*d*tan(c + d*x)^(1/2) 
*(-(A^2*1i)/(64*a^4*d^2))^(1/2))/A)*(-(A^2*1i)/(64*a^4*d^2))^(1/2)*2i + 2* 
atanh((8*a^2*d*tan(c + d*x)^(1/2)*((B^2*1i)/(64*a^4*d^2))^(1/2))/B)*((B^2* 
1i)/(64*a^4*d^2))^(1/2) + 2*atanh((16*a^2*d*tan(c + d*x)^(1/2)*(-(B^2*529i 
)/(256*a^4*d^2))^(1/2))/(23*B))*(-(B^2*529i)/(256*a^4*d^2))^(1/2) + ((A*2i 
)/(3*a^2*d) + (8*A*tan(c + d*x))/(3*a^2*d) + (A*tan(c + d*x)^2*221i)/(24*a 
^2*d) - (45*A*tan(c + d*x)^3)/(8*a^2*d))/(2*tan(c + d*x)^(5/2) - tan(c + d 
*x)^(3/2)*1i + tan(c + d*x)^(7/2)*1i) - ((43*B*tan(c + d*x))/(8*a^2*d) - ( 
B*2i)/(a^2*d) + (B*tan(c + d*x)^2*25i)/(8*a^2*d))/(2*tan(c + d*x)^(3/2) - 
tan(c + d*x)^(1/2)*1i + tan(c + d*x)^(5/2)*1i)
 

Reduce [F]

\[ \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \, dx=\frac {-\left (\int \frac {1}{\sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )^{4}-2 \sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )^{3} i -\sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )^{2}}d x \right ) a -\left (\int \frac {1}{\sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )^{3}-2 \sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )^{2} i -\sqrt {\tan \left (d x +c \right )}\, \tan \left (d x +c \right )}d x \right ) b}{a^{2}} \] Input:

int((A+B*tan(d*x+c))/tan(d*x+c)^(5/2)/(a+I*a*tan(d*x+c))^2,x)
 

Output:

( - (int(1/(sqrt(tan(c + d*x))*tan(c + d*x)**4 - 2*sqrt(tan(c + d*x))*tan( 
c + d*x)**3*i - sqrt(tan(c + d*x))*tan(c + d*x)**2),x)*a + int(1/(sqrt(tan 
(c + d*x))*tan(c + d*x)**3 - 2*sqrt(tan(c + d*x))*tan(c + d*x)**2*i - sqrt 
(tan(c + d*x))*tan(c + d*x)),x)*b))/a**2