Integrand size = 28, antiderivative size = 82 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {(i A+B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}+\frac {i A-B}{d \sqrt {a+i a \tan (c+d x)}} \] Output:
-1/2*(I*A+B)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))*2^(1/2) /a^(1/2)/d+(I*A-B)/d/(a+I*a*tan(d*x+c))^(1/2)
Time = 0.29 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.00 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {(i A+B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}+\frac {i A-B}{d \sqrt {a+i a \tan (c+d x)}} \] Input:
Integrate[(A + B*Tan[c + d*x])/Sqrt[a + I*a*Tan[c + d*x]],x]
Output:
-(((I*A + B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/(Sqrt[ 2]*Sqrt[a]*d)) + (I*A - B)/(d*Sqrt[a + I*a*Tan[c + d*x]])
Time = 0.32 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.02, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3042, 4009, 3042, 3961, 219}
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)}{\sqrt {a+i a \tan (c+d x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}}dx\) |
\(\Big \downarrow \) 4009 |
\(\displaystyle \frac {(A-i B) \int \sqrt {i \tan (c+d x) a+a}dx}{2 a}+\frac {-B+i A}{d \sqrt {a+i a \tan (c+d x)}}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(A-i B) \int \sqrt {i \tan (c+d x) a+a}dx}{2 a}+\frac {-B+i A}{d \sqrt {a+i a \tan (c+d x)}}\) |
\(\Big \downarrow \) 3961 |
\(\displaystyle \frac {-B+i A}{d \sqrt {a+i a \tan (c+d x)}}-\frac {i (A-i B) \int \frac {1}{a-i a \tan (c+d x)}d\sqrt {i \tan (c+d x) a+a}}{d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {-B+i A}{d \sqrt {a+i a \tan (c+d x)}}-\frac {i (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}\) |
Input:
Int[(A + B*Tan[c + d*x])/Sqrt[a + I*a*Tan[c + d*x]],x]
Output:
((-I)*(A - I*B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/(Sq rt[2]*Sqrt[a]*d) + (I*A - B)/(d*Sqrt[a + I*a*Tan[c + d*x]])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2*(b/d) Subst[Int[1/(2*a - x^2), x], x, Sqrt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a , b, c, d}, x] && EqQ[a^2 + b^2, 0]
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/(2*a *f*m)), x] + Simp[(b*c + a*d)/(2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1), x ], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 , 0] && LtQ[m, 0]
Time = 0.17 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.87
method | result | size |
derivativedivides | \(\frac {2 i \left (-\frac {\left (-\frac {i B}{2}+\frac {A}{2}\right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {-\frac {A}{2}-\frac {i B}{2}}{\sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d}\) | \(71\) |
default | \(\frac {2 i \left (-\frac {\left (-\frac {i B}{2}+\frac {A}{2}\right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {-\frac {A}{2}-\frac {i B}{2}}{\sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d}\) | \(71\) |
parts | \(\frac {2 i A a \left (-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4 a^{\frac {3}{2}}}+\frac {1}{2 a \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d}+\frac {B \left (-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2 \sqrt {a}}-\frac {1}{\sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d}\) | \(114\) |
Input:
int((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)
Output:
2*I/d*(-1/2*(-1/2*I*B+1/2*A)*2^(1/2)/a^(1/2)*arctanh(1/2*(a+I*a*tan(d*x+c) )^(1/2)*2^(1/2)/a^(1/2))-(-1/2*A-1/2*I*B)/(a+I*a*tan(d*x+c))^(1/2))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 328 vs. \(2 (63) = 126\).
Time = 0.08 (sec) , antiderivative size = 328, normalized size of antiderivative = 4.00 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {{\left (\sqrt {2} a d \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} + {\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - \sqrt {2} a d \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 2 \, \sqrt {2} {\left ({\left (-i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \] Input:
integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")
Output:
1/4*(sqrt(2)*a*d*sqrt(-(A^2 - 2*I*A*B - B^2)/(a*d^2))*e^(I*d*x + I*c)*log( -4*((-I*A - B)*a*e^(I*d*x + I*c) + (a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/ (e^(2*I*d*x + 2*I*c) + 1))*sqrt(-(A^2 - 2*I*A*B - B^2)/(a*d^2)))*e^(-I*d*x - I*c)/(I*A + B)) - sqrt(2)*a*d*sqrt(-(A^2 - 2*I*A*B - B^2)/(a*d^2))*e^(I *d*x + I*c)*log(-4*((-I*A - B)*a*e^(I*d*x + I*c) - (a*d*e^(2*I*d*x + 2*I*c ) + a*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-(A^2 - 2*I*A*B - B^2)/(a* d^2)))*e^(-I*d*x - I*c)/(I*A + B)) - 2*sqrt(2)*((-I*A + B)*e^(2*I*d*x + 2* I*c) - I*A + B)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-I*d*x - I*c)/(a*d)
\[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\int \frac {A + B \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \] Input:
integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))**(1/2),x)
Output:
Integral((A + B*tan(c + d*x))/sqrt(I*a*(tan(c + d*x) - I)), x)
Time = 0.13 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.11 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {i \, {\left (\sqrt {2} {\left (A - i \, B\right )} \sqrt {a} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + \frac {4 \, {\left (A + i \, B\right )} a}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}}{4 \, a d} \] Input:
integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")
Output:
1/4*I*(sqrt(2)*(A - I*B)*sqrt(a)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*x + c) + a))) + 4*(A + I*B)*a /sqrt(I*a*tan(d*x + c) + a))/(a*d)
Exception generated. \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\text {Exception raised: TypeError} \] Input:
integrate((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/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 TypeError: Bad Argument TypeDone
Time = 3.87 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.43 \[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {A\,1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {B}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}+\frac {\sqrt {2}\,A\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d}-\frac {\sqrt {2}\,B\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {a}}\right )}{2\,\sqrt {a}\,d} \] Input:
int((A + B*tan(c + d*x))/(a + a*tan(c + d*x)*1i)^(1/2),x)
Output:
(A*1i)/(d*(a + a*tan(c + d*x)*1i)^(1/2)) - B/(d*(a + a*tan(c + d*x)*1i)^(1 /2)) + (2^(1/2)*A*atan((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2))/(2*(-a)^(1/ 2)))*1i)/(2*(-a)^(1/2)*d) - (2^(1/2)*B*atanh((2^(1/2)*(a + a*tan(c + d*x)* 1i)^(1/2))/(2*a^(1/2))))/(2*a^(1/2)*d)
\[ \int \frac {A+B \tan (c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {\sqrt {a}\, \left (-2 \sqrt {\tan \left (d x +c \right ) i +1}\, a i -\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )^{2}}{\tan \left (d x +c \right )^{2}+1}d x \right ) \tan \left (d x +c \right )^{2} b d i -\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )^{2}}{\tan \left (d x +c \right )^{2}+1}d x \right ) b d i -4 \left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )}{\tan \left (d x +c \right )^{2}+1}d x \right ) \tan \left (d x +c \right )^{2} a d i +\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )}{\tan \left (d x +c \right )^{2}+1}d x \right ) \tan \left (d x +c \right )^{2} b d -4 \left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )}{\tan \left (d x +c \right )^{2}+1}d x \right ) a d i +\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )}{\tan \left (d x +c \right )^{2}+1}d x \right ) b d \right )}{a d \left (\tan \left (d x +c \right )^{2}+1\right )} \] Input:
int((A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x)
Output:
(sqrt(a)*( - 2*sqrt(tan(c + d*x)*i + 1)*a*i - int((sqrt(tan(c + d*x)*i + 1 )*tan(c + d*x)**2)/(tan(c + d*x)**2 + 1),x)*tan(c + d*x)**2*b*d*i - int((s qrt(tan(c + d*x)*i + 1)*tan(c + d*x)**2)/(tan(c + d*x)**2 + 1),x)*b*d*i - 4*int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x))/(tan(c + d*x)**2 + 1),x)*tan (c + d*x)**2*a*d*i + int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x))/(tan(c + d*x)**2 + 1),x)*tan(c + d*x)**2*b*d - 4*int((sqrt(tan(c + d*x)*i + 1)*tan( c + d*x))/(tan(c + d*x)**2 + 1),x)*a*d*i + int((sqrt(tan(c + d*x)*i + 1)*t an(c + d*x))/(tan(c + d*x)**2 + 1),x)*b*d))/(a*d*(tan(c + d*x)**2 + 1))