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

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

Optimal result

Integrand size = 34, antiderivative size = 53 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {2 \sqrt [4]{-1} a (i A+B) \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}-\frac {2 a A}{d \sqrt {\tan (c+d x)}} \] Output:

-2*(-1)^(1/4)*a*(I*A+B)*arctan((-1)^(3/4)*tan(d*x+c)^(1/2))/d-2*a*A/d/tan( 
d*x+c)^(1/2)
                                                                                    
                                                                                    
 

Mathematica [A] (verified)

Time = 0.34 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.02 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {2 i a \left (\sqrt [4]{-1} (A-i B) \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )-\frac {i A}{\sqrt {\tan (c+d x)}}\right )}{d} \] Input:

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

Output:

((-2*I)*a*((-1)^(1/4)*(A - I*B)*ArcTan[(-1)^(3/4)*Sqrt[Tan[c + d*x]]] - (I 
*A)/Sqrt[Tan[c + d*x]]))/d
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {3042, 4074, 3042, 4016, 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 {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4074

\(\displaystyle -\frac {2 a A}{d \sqrt {\tan (c+d x)}}+\int \frac {a (i A+B)-a (A-i B) \tan (c+d x)}{\sqrt {\tan (c+d x)}}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {2 a A}{d \sqrt {\tan (c+d x)}}+\int \frac {a (i A+B)-a (A-i B) \tan (c+d x)}{\sqrt {\tan (c+d x)}}dx\)

\(\Big \downarrow \) 4016

\(\displaystyle -\frac {2 a A}{d \sqrt {\tan (c+d x)}}+\frac {2 a^2 (B+i A)^2 \int \frac {1}{a (i A+B)+a (A-i B) \tan (c+d x)}d\sqrt {\tan (c+d x)}}{d}\)

\(\Big \downarrow \) 218

\(\displaystyle -\frac {2 a A}{d \sqrt {\tan (c+d x)}}-\frac {2 \sqrt [4]{-1} a (B+i A) \arctan \left ((-1)^{3/4} \sqrt {\tan (c+d x)}\right )}{d}\)

Input:

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

Output:

(-2*(-1)^(1/4)*a*(I*A + B)*ArcTan[(-1)^(3/4)*Sqrt[Tan[c + d*x]]])/d - (2*a 
*A)/(d*Sqrt[Tan[c + d*x]])
 

Defintions of rubi rules used

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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

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

rule 4074
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + 
 (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b 
*c - a*d)*(A*b - a*B)*((a + b*Tan[e + f*x])^(m + 1)/(b*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*A*c 
+ b*B*c + A*b*d - a*B*d - (A*b*c - a*B*c - a*A*d - b*B*d)*Tan[e + f*x], x], 
 x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && LtQ[m 
, -1] && NeQ[a^2 + b^2, 0]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (44 ) = 88\).

Time = 0.13 (sec) , antiderivative size = 202, normalized size of antiderivative = 3.81

method result size
derivativedivides \(\frac {a \left (-\frac {2 A}{\sqrt {\tan \left (d x +c \right )}}+\frac {\left (i A +B \right ) \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4}+\frac {\left (i B -A \right ) \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4}\right )}{d}\) \(202\)
default \(\frac {a \left (-\frac {2 A}{\sqrt {\tan \left (d x +c \right )}}+\frac {\left (i A +B \right ) \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4}+\frac {\left (i B -A \right ) \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4}\right )}{d}\) \(202\)
parts \(\frac {\left (i a A +B a \right ) \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4 d}+\frac {a A \left (-\frac {\sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4}-\frac {2}{\sqrt {\tan \left (d x +c \right )}}\right )}{d}+\frac {i a B \sqrt {2}\, \left (\ln \left (\frac {\tan \left (d x +c \right )-\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}{\tan \left (d x +c \right )+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}+1}\right )+2 \arctan \left (1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )+2 \arctan \left (-1+\sqrt {2}\, \sqrt {\tan \left (d x +c \right )}\right )\right )}{4 d}\) \(292\)

Input:

int((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c))/tan(d*x+c)^(3/2),x,method=_RETURNV 
ERBOSE)
 

Output:

1/d*a*(-2*A/tan(d*x+c)^(1/2)+1/4*(I*A+B)*2^(1/2)*(ln((tan(d*x+c)+2^(1/2)*t 
an(d*x+c)^(1/2)+1)/(tan(d*x+c)-2^(1/2)*tan(d*x+c)^(1/2)+1))+2*arctan(1+2^( 
1/2)*tan(d*x+c)^(1/2))+2*arctan(-1+2^(1/2)*tan(d*x+c)^(1/2)))+1/4*(-A+I*B) 
*2^(1/2)*(ln((tan(d*x+c)-2^(1/2)*tan(d*x+c)^(1/2)+1)/(tan(d*x+c)+2^(1/2)*t 
an(d*x+c)^(1/2)+1))+2*arctan(1+2^(1/2)*tan(d*x+c)^(1/2))+2*arctan(-1+2^(1/ 
2)*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. 367 vs. \(2 (43) = 86\).

Time = 0.08 (sec) , antiderivative size = 367, normalized size of antiderivative = 6.92 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=\frac {{\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \log \left (\frac {2 \, {\left ({\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (-i \, A^{2} - 2 \, A B + i \, B^{2}\right )} a^{2}}{d^{2}}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{{\left (i \, A + B\right )} a}\right ) - 4 \, {\left (i \, A a e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A a\right )} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{2 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \] Input:

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c))/tan(d*x+c)^(3/2),x, algorith 
m="fricas")
 

Output:

1/2*((d*e^(2*I*d*x + 2*I*c) - d)*sqrt(-(-I*A^2 - 2*A*B + I*B^2)*a^2/d^2)*l 
og(2*((A - I*B)*a*e^(2*I*d*x + 2*I*c) + (d*e^(2*I*d*x + 2*I*c) + d)*sqrt(- 
(-I*A^2 - 2*A*B + I*B^2)*a^2/d^2)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2* 
I*d*x + 2*I*c) + 1)))*e^(-2*I*d*x - 2*I*c)/((I*A + B)*a)) - (d*e^(2*I*d*x 
+ 2*I*c) - d)*sqrt(-(-I*A^2 - 2*A*B + I*B^2)*a^2/d^2)*log(2*((A - I*B)*a*e 
^(2*I*d*x + 2*I*c) - (d*e^(2*I*d*x + 2*I*c) + d)*sqrt(-(-I*A^2 - 2*A*B + I 
*B^2)*a^2/d^2)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1) 
))*e^(-2*I*d*x - 2*I*c)/((I*A + B)*a)) - 4*(I*A*a*e^(2*I*d*x + 2*I*c) + I* 
A*a)*sqrt((-I*e^(2*I*d*x + 2*I*c) + I)/(e^(2*I*d*x + 2*I*c) + 1)))/(d*e^(2 
*I*d*x + 2*I*c) - d)
                                                                                    
                                                                                    
 

Sympy [F]

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

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

Output:

I*a*(Integral(A/sqrt(tan(c + d*x)), x) + Integral(B*sqrt(tan(c + d*x)), x) 
 + Integral(-I*A/tan(c + d*x)**(3/2), x) + Integral(-I*B/sqrt(tan(c + d*x) 
), x))
 

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (43) = 86\).

Time = 0.14 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.85 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=\frac {{\left (2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) + 2 \, \sqrt {2} {\left (\left (i - 1\right ) \, A + \left (i + 1\right ) \, B\right )} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - 2 \, \sqrt {\tan \left (d x + c\right )}\right )}\right ) - \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right ) + \sqrt {2} {\left (-\left (i + 1\right ) \, A + \left (i - 1\right ) \, B\right )} \log \left (-\sqrt {2} \sqrt {\tan \left (d x + c\right )} + \tan \left (d x + c\right ) + 1\right )\right )} a - \frac {8 \, A a}{\sqrt {\tan \left (d x + c\right )}}}{4 \, d} \] Input:

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c))/tan(d*x+c)^(3/2),x, algorith 
m="maxima")
 

Output:

1/4*((2*sqrt(2)*((I - 1)*A + (I + 1)*B)*arctan(1/2*sqrt(2)*(sqrt(2) + 2*sq 
rt(tan(d*x + c)))) + 2*sqrt(2)*((I - 1)*A + (I + 1)*B)*arctan(-1/2*sqrt(2) 
*(sqrt(2) - 2*sqrt(tan(d*x + c)))) - sqrt(2)*(-(I + 1)*A + (I - 1)*B)*log( 
sqrt(2)*sqrt(tan(d*x + c)) + tan(d*x + c) + 1) + sqrt(2)*(-(I + 1)*A + (I 
- 1)*B)*log(-sqrt(2)*sqrt(tan(d*x + c)) + tan(d*x + c) + 1))*a - 8*A*a/sqr 
t(tan(d*x + c)))/d
 

Giac [A] (verification not implemented)

Time = 0.41 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.85 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=-\frac {\sqrt {2} {\left (-\left (i - 1\right ) \, A a - \left (i + 1\right ) \, B a\right )} \arctan \left (-\left (\frac {1}{2} i - \frac {1}{2}\right ) \, \sqrt {2} \sqrt {\tan \left (d x + c\right )}\right ) + \frac {2 \, A a}{\sqrt {\tan \left (d x + c\right )}}}{d} \] Input:

integrate((a+I*a*tan(d*x+c))*(A+B*tan(d*x+c))/tan(d*x+c)^(3/2),x, algorith 
m="giac")
 

Output:

-(sqrt(2)*(-(I - 1)*A*a - (I + 1)*B*a)*arctan(-(1/2*I - 1/2)*sqrt(2)*sqrt( 
tan(d*x + c))) + 2*A*a/sqrt(tan(d*x + c)))/d
 

Mupad [B] (verification not implemented)

Time = 4.10 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.26 \[ \int \frac {(a+i a \tan (c+d x)) (A+B \tan (c+d x))}{\tan ^{\frac {3}{2}}(c+d x)} \, dx=\frac {2\,{\left (-1\right )}^{1/4}\,A\,a\,\mathrm {atanh}\left ({\left (-1\right )}^{1/4}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\right )}{d}-\frac {2\,A\,a}{d\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}}+\frac {\sqrt {2}\,B\,a\,\mathrm {atan}\left (\sqrt {2}\,\sqrt {\mathrm {tan}\left (c+d\,x\right )}\,\left (\frac {1}{2}-\frac {1}{2}{}\mathrm {i}\right )\right )\,\left (1+1{}\mathrm {i}\right )}{d} \] Input:

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

Output:

(2*(-1)^(1/4)*A*a*atanh((-1)^(1/4)*tan(c + d*x)^(1/2)))/d - (2*A*a)/(d*tan 
(c + d*x)^(1/2)) + (2^(1/2)*B*a*atan(2^(1/2)*tan(c + d*x)^(1/2)*(1/2 - 1i/ 
2))*(1 + 1i))/d
 

Reduce [F]

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

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

Output:

a*(int(sqrt(tan(c + d*x))/tan(c + d*x)**2,x)*a + int(sqrt(tan(c + d*x))/ta 
n(c + d*x),x)*a*i + int(sqrt(tan(c + d*x))/tan(c + d*x),x)*b + int(sqrt(ta 
n(c + d*x)),x)*b*i)