Integrand size = 36, antiderivative size = 159 \[ \int \frac {\tan ^2(c+d x) (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) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {4 (i A-B) \sqrt {a+i a \tan (c+d x)}}{a d}+\frac {(3 i A-5 B) (a+i a \tan (c+d x))^{3/2}}{3 a^2 d} \] 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)*tan(d*x+c)^2/d/(a+I*a*tan(d*x+c))^(1/2)-4*(I*A-B)*(a+I*a *tan(d*x+c))^(1/2)/a/d+1/3*(3*I*A-5*B)*(a+I*a*tan(d*x+c))^(3/2)/a^2/d
Time = 1.12 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.70 \[ \int \frac {\tan ^2(c+d x) (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 {-9 i A+7 B+(6 A+2 i B) \tan (c+d x)+2 B \tan ^2(c+d x)}{3 d \sqrt {a+i a \tan (c+d x)}} \] Input:
Integrate[(Tan[c + d*x]^2*(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) + ((-9*I)*A + 7*B + (6*A + (2*I)*B)*Tan[c + d*x] + 2*B*Tan[c + d*x]^2)/(3*d*Sqrt[a + I*a*Tan[c + d*x]])
Time = 0.78 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.04, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3042, 4078, 27, 3042, 4075, 3042, 4010, 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 {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (c+d x)^2 (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}}dx\) |
\(\Big \downarrow \) 4078 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \frac {1}{2} \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a (i A-B)+a (3 A+5 i B) \tan (c+d x))dx}{a^2}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a (i A-B)+a (3 A+5 i B) \tan (c+d x))dx}{2 a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a (i A-B)+a (3 A+5 i B) \tan (c+d x))dx}{2 a^2}\) |
\(\Big \downarrow \) 4075 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \sqrt {i \tan (c+d x) a+a} (4 a (i A-B) \tan (c+d x)-a (3 A+5 i B))dx-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{2 a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {\int \sqrt {i \tan (c+d x) a+a} (4 a (i A-B) \tan (c+d x)-a (3 A+5 i B))dx-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{2 a^2}\) |
\(\Big \downarrow \) 4010 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a (A-i B) \int \sqrt {i \tan (c+d x) a+a}dx-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a (-B+i A) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {a (A-i B) \int \sqrt {i \tan (c+d x) a+a}dx-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a (-B+i A) \sqrt {a+i a \tan (c+d x)}}{d}}{2 a^2}\) |
\(\Big \downarrow \) 3961 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {-\frac {2 i a^2 (A-i B) \int \frac {1}{a-i a \tan (c+d x)}d\sqrt {i \tan (c+d x) a+a}}{d}+\frac {8 a (-B+i A) \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{2 a^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {(-B+i A) \tan ^2(c+d x)}{d \sqrt {a+i a \tan (c+d x)}}-\frac {-\frac {i \sqrt {2} a^{3/2} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {8 a (-B+i A) \sqrt {a+i a \tan (c+d x)}}{d}-\frac {2 (-5 B+3 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{2 a^2}\) |
Input:
Int[(Tan[c + d*x]^2*(A + B*Tan[c + d*x]))/Sqrt[a + I*a*Tan[c + d*x]],x]
Output:
((I*A - B)*Tan[c + d*x]^2)/(d*Sqrt[a + I*a*Tan[c + d*x]]) - (((-I)*Sqrt[2] *a^(3/2)*(A - I*B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/ d + (8*a*(I*A - B)*Sqrt[a + I*a*Tan[c + d*x]])/d - (2*((3*I)*A - 5*B)*(a + I*a*Tan[c + d*x])^(3/2))/(3*d))/(2*a^2)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, 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[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Simp [(b*c + a*d)/b Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e , f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && !LtQ[m, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B *d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && !LeQ[m, -1]
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*b - a*B))*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^n/(2*a*f*m)), x] + Simp[1/(2*a^2*m) Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f* x])^(n - 1)*Simp[A*(a*c*m + b*d*n) - B*(b*c*m + a*d*n) - d*(b*B*(m - n) - a *A*(m + n))*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] && GtQ[n, 0]
Time = 0.24 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.81
method | result | size |
derivativedivides | \(\frac {2 i \left (\frac {i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-i a B \sqrt {a +i a \tan \left (d x +c \right )}-a A \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {3}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}-\frac {a^{2} \left (i B +A \right )}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d \,a^{2}}\) | \(128\) |
default | \(\frac {2 i \left (\frac {i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-i a B \sqrt {a +i a \tan \left (d x +c \right )}-a A \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {3}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}-\frac {a^{2} \left (i B +A \right )}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d \,a^{2}}\) | \(128\) |
parts | \(\frac {2 i A \left (-\sqrt {a +i a \tan \left (d x +c \right )}+\frac {\sqrt {a}\, \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}-\frac {a}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d a}+\frac {2 B \left (-\frac {\left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+a \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {3}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}+\frac {a^{2}}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d \,a^{2}}\) | \(169\) |
Input:
int(tan(d*x+c)^2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x,method=_RETUR NVERBOSE)
Output:
2*I/d/a^2*(1/3*I*B*(a+I*a*tan(d*x+c))^(3/2)-I*a*B*(a+I*a*tan(d*x+c))^(1/2) -a*A*(a+I*a*tan(d*x+c))^(1/2)+1/4*a^(3/2)*(A-I*B)*2^(1/2)*arctanh(1/2*(a+I *a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))-1/2*a^2*(A+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. 391 vs. \(2 (127) = 254\).
Time = 0.12 (sec) , antiderivative size = 391, normalized size of antiderivative = 2.46 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {3 \, \sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} \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 ) - 3 \, \sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {A^{2} - 2 i \, A B - B^{2}}{a d^{2}}} \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 (15 i \, A - 7 \, B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 18 \, {\left (i \, A - B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i \, A - 3 \, B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{12 \, {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} + a d e^{\left (i \, d x + i \, c\right )}\right )}} \] Input:
integrate(tan(d*x+c)^2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x, algori thm="fricas")
Output:
-1/12*(3*sqrt(2)*(a*d*e^(3*I*d*x + 3*I*c) + a*d*e^(I*d*x + I*c))*sqrt(-(A^ 2 - 2*I*A*B - B^2)/(a*d^2))*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)) - 3*sqrt(2)*(a*d*e^(3*I *d*x + 3*I*c) + a*d*e^(I*d*x + I*c))*sqrt(-(A^2 - 2*I*A*B - B^2)/(a*d^2))* log(-4*((-I*A - B)*a*e^(I*d*x + I*c) - (a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqr t(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)*((15*I*A - 7*B)*e^(4*I*d*x + 4*I*c) + 1 8*(I*A - B)*e^(2*I*d*x + 2*I*c) + 3*I*A - 3*B)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))/(a*d*e^(3*I*d*x + 3*I*c) + a*d*e^(I*d*x + I*c))
\[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx=\int \frac {\left (A + B \tan {\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \] Input:
integrate(tan(d*x+c)**2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))**(1/2),x)
Output:
Integral((A + B*tan(c + d*x))*tan(c + d*x)**2/sqrt(I*a*(tan(c + d*x) - I)) , x)
Time = 0.14 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.84 \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx=-\frac {i \, {\left (3 \, \sqrt {2} {\left (A - i \, B\right )} a^{\frac {5}{2}} \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 ) - 8 i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} B a + 24 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (A + i \, B\right )} a^{2} + \frac {12 \, {\left (A + i \, B\right )} a^{3}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}}{12 \, a^{3} d} \] Input:
integrate(tan(d*x+c)^2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x, algori thm="maxima")
Output:
-1/12*I*(3*sqrt(2)*(A - I*B)*a^(5/2)*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))) - 8*I*(I*a* tan(d*x + c) + a)^(3/2)*B*a + 24*sqrt(I*a*tan(d*x + c) + a)*(A + I*B)*a^2 + 12*(A + I*B)*a^3/sqrt(I*a*tan(d*x + c) + a))/(a^3*d)
Exception generated. \[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx=\text {Exception raised: TypeError} \] Input:
integrate(tan(d*x+c)^2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x, algori thm="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 TypeError: Bad Argument TypeError: Bad Argument TypeDone
Time = 4.35 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.18 \[ \int \frac {\tan ^2(c+d x) (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 {A\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}+\frac {2\,B\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{a\,d}-\frac {2\,B\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}{3\,a^2\,d}-\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 {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2\,\sqrt {a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {a}\,d} \] Input:
int((tan(c + d*x)^2*(A + B*tan(c + d*x)))/(a + a*tan(c + d*x)*1i)^(1/2),x)
Output:
B/(d*(a + a*tan(c + d*x)*1i)^(1/2)) - (A*1i)/(d*(a + a*tan(c + d*x)*1i)^(1 /2)) - (A*(a + a*tan(c + d*x)*1i)^(1/2)*2i)/(a*d) + (2*B*(a + a*tan(c + d* x)*1i)^(1/2))/(a*d) - (2*B*(a + a*tan(c + d*x)*1i)^(3/2))/(3*a^2*d) - (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*atan((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2)*1i )/(2*a^(1/2)))*1i)/(2*a^(1/2)*d)
\[ \int \frac {\tan ^2(c+d x) (A+B \tan (c+d x))}{\sqrt {a+i a \tan (c+d x)}} \, dx=\frac {\sqrt {a}\, \left (-\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )^{4}}{\tan \left (d x +c \right )^{2}+1}d x \right ) b i -\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )^{3}}{\tan \left (d x +c \right )^{2}+1}d x \right ) a i +\left (\int \frac {\sqrt {\tan \left (d x +c \right ) i +1}\, \tan \left (d x +c \right )^{3}}{\tan \left (d x +c \right )^{2}+1}d x \right ) b +\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 ) a \right )}{a} \] Input:
int(tan(d*x+c)^2*(A+B*tan(d*x+c))/(a+I*a*tan(d*x+c))^(1/2),x)
Output:
(sqrt(a)*( - int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x)**4)/(tan(c + d*x)* *2 + 1),x)*b*i - int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x)**3)/(tan(c + d *x)**2 + 1),x)*a*i + int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x)**3)/(tan(c + d*x)**2 + 1),x)*b + int((sqrt(tan(c + d*x)*i + 1)*tan(c + d*x)**2)/(tan (c + d*x)**2 + 1),x)*a))/a