Integrand size = 32, antiderivative size = 75 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=2 a^2 (i A+B) x+\frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+\frac {a^2 A \log (\sin (c+d x))}{d}+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d} \] Output:
2*a^2*(I*A+B)*x+a^2*(A-2*I*B)*ln(cos(d*x+c))/d+a^2*A*ln(sin(d*x+c))/d+I*B* (a^2+I*a^2*tan(d*x+c))/d
Time = 0.32 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.61 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {a^2 (A \log (\tan (c+d x))-2 (A-i B) \log (i+\tan (c+d x))-B \tan (c+d x))}{d} \] Input:
Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^2*(A + B*Tan[c + d*x]),x]
Output:
(a^2*(A*Log[Tan[c + d*x]] - 2*(A - I*B)*Log[I + Tan[c + d*x]] - B*Tan[c + d*x]))/d
Time = 0.61 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.03, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {3042, 4077, 3042, 4072, 3042, 3956, 4014, 3042, 25, 3956}
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 \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+i a \tan (c+d x))^2 (A+B \tan (c+d x))}{\tan (c+d x)}dx\) |
\(\Big \downarrow \) 4077 |
\(\displaystyle \int \cot (c+d x) (i \tan (c+d x) a+a) (a A+a (i A+2 B) \tan (c+d x))dx+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(i \tan (c+d x) a+a) (a A+a (i A+2 B) \tan (c+d x))}{\tan (c+d x)}dx+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 4072 |
\(\displaystyle -\left (a^2 (A-2 i B) \int \tan (c+d x)dx\right )+\int \cot (c+d x) \left (A a^2+2 (i A+B) \tan (c+d x) a^2\right )dx+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\left (a^2 (A-2 i B) \int \tan (c+d x)dx\right )+\int \frac {A a^2+2 (i A+B) \tan (c+d x) a^2}{\tan (c+d x)}dx+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \int \frac {A a^2+2 (i A+B) \tan (c+d x) a^2}{\tan (c+d x)}dx+\frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 4014 |
\(\displaystyle a^2 A \int \cot (c+d x)dx+\frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+2 a^2 x (B+i A)+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle a^2 A \int -\tan \left (c+d x+\frac {\pi }{2}\right )dx+\frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+2 a^2 x (B+i A)+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -a^2 A \int \tan \left (\frac {1}{2} (2 c+\pi )+d x\right )dx+\frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+2 a^2 x (B+i A)+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
\(\Big \downarrow \) 3956 |
\(\displaystyle \frac {a^2 (A-2 i B) \log (\cos (c+d x))}{d}+2 a^2 x (B+i A)+\frac {a^2 A \log (-\sin (c+d x))}{d}+\frac {i B \left (a^2+i a^2 \tan (c+d x)\right )}{d}\) |
Input:
Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^2*(A + B*Tan[c + d*x]),x]
Output:
2*a^2*(I*A + B)*x + (a^2*(A - (2*I)*B)*Log[Cos[c + d*x]])/d + (a^2*A*Log[- Sin[c + d*x]])/d + (I*B*(a^2 + I*a^2*Tan[c + d*x]))/d
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d *x], x]]/d, x] /; FreeQ[{c, d}, x]
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a *d)/(a^2 + b^2) Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && N eQ[a*c + b*d, 0]
Int[(((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_ .)*(x_)]))/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B*(d/ b) Int[Tan[e + f*x], x], x] + Simp[1/b Int[Simp[A*b*c + (A*b*d + B*(b*c - a*d))*Tan[e + f*x], x]/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d , e, f, A, B}, x] && NeQ[b*c - a*d, 0]
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[b*B*(a + b*Tan[e + f*x])^(m - 1)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n))), x] + Simp[1/(d*(m + n)) Int[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan [e + f*x])^n*Simp[a*A*d*(m + n) + B*(a*c*(m - 1) - b*d*(n + 1)) - (B*(b*c - a*d)*(m - 1) - d*(A*b + a*B)*(m + n))*Tan[e + f*x], x], x], x] /; FreeQ[{a , b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && GtQ[m, 1] && !LtQ[n, -1]
Time = 0.19 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.84
method | result | size |
parallelrisch | \(\frac {a^{2} \left (i B \ln \left (\sec \left (d x +c \right )^{2}\right )+A \left (\ln \left (\tan \left (d x +c \right )\right )-\ln \left (\sec \left (d x +c \right )^{2}\right )\right )+2 i A x d +2 B d x -B \tan \left (d x +c \right )\right )}{d}\) | \(63\) |
derivativedivides | \(\frac {a^{2} \left (\frac {\left (2 i B -2 A \right ) \ln \left (\cot \left (d x +c \right )^{2}+1\right )}{2}+\left (-2 i A -2 B \right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )-\frac {B}{\cot \left (d x +c \right )}+\left (-2 i B +A \right ) \ln \left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(77\) |
default | \(\frac {a^{2} \left (\frac {\left (2 i B -2 A \right ) \ln \left (\cot \left (d x +c \right )^{2}+1\right )}{2}+\left (-2 i A -2 B \right ) \left (\frac {\pi }{2}-\operatorname {arccot}\left (\cot \left (d x +c \right )\right )\right )-\frac {B}{\cot \left (d x +c \right )}+\left (-2 i B +A \right ) \ln \left (\cot \left (d x +c \right )\right )\right )}{d}\) | \(77\) |
norman | \(\left (2 i A \,a^{2}+2 B \,a^{2}\right ) x -\frac {B \,a^{2} \tan \left (d x +c \right )}{d}+\frac {A \,a^{2} \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {\left (-i B \,a^{2}+A \,a^{2}\right ) \ln \left (1+\tan \left (d x +c \right )^{2}\right )}{d}\) | \(77\) |
risch | \(-\frac {4 i a^{2} A c}{d}-\frac {4 a^{2} B c}{d}-\frac {2 i B \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {A \,a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 i a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A}{d}\) | \(108\) |
Input:
int(cot(d*x+c)*(a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c)),x,method=_RETURNVERBO SE)
Output:
1/d*a^2*(I*B*ln(sec(d*x+c)^2)+A*(ln(tan(d*x+c))-ln(sec(d*x+c)^2))+2*I*A*x* d+2*B*d*x-B*tan(d*x+c))
Time = 0.09 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.29 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {-2 i \, B a^{2} + {\left ({\left (A - 2 i \, B\right )} a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - 2 i \, B\right )} a^{2}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + {\left (A a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + A a^{2}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c)),x, algorithm="f ricas")
Output:
(-2*I*B*a^2 + ((A - 2*I*B)*a^2*e^(2*I*d*x + 2*I*c) + (A - 2*I*B)*a^2)*log( e^(2*I*d*x + 2*I*c) + 1) + (A*a^2*e^(2*I*d*x + 2*I*c) + A*a^2)*log(e^(2*I* d*x + 2*I*c) - 1))/(d*e^(2*I*d*x + 2*I*c) + d)
Time = 1.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.45 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {A a^{2} \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} - \frac {2 i B a^{2}}{d e^{2 i c} e^{2 i d x} + d} + \frac {a^{2} \left (A - 2 i B\right ) \log {\left (e^{2 i d x} + \frac {\left (- i A a^{2} - B a^{2} + i a^{2} \left (A - 2 i B\right )\right ) e^{- 2 i c}}{B a^{2}} \right )}}{d} \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))**2*(A+B*tan(d*x+c)),x)
Output:
A*a**2*log(exp(2*I*d*x) - exp(-2*I*c))/d - 2*I*B*a**2/(d*exp(2*I*c)*exp(2* I*d*x) + d) + a**2*(A - 2*I*B)*log(exp(2*I*d*x) + (-I*A*a**2 - B*a**2 + I* a**2*(A - 2*I*B))*exp(-2*I*c)/(B*a**2))/d
Time = 0.12 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.89 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=-\frac {2 \, {\left (d x + c\right )} {\left (-i \, A - B\right )} a^{2} + {\left (A - i \, B\right )} a^{2} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - A a^{2} \log \left (\tan \left (d x + c\right )\right ) + B a^{2} \tan \left (d x + c\right )}{d} \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c)),x, algorithm="m axima")
Output:
-(2*(d*x + c)*(-I*A - B)*a^2 + (A - I*B)*a^2*log(tan(d*x + c)^2 + 1) - A*a ^2*log(tan(d*x + c)) + B*a^2*tan(d*x + c))/d
Time = 0.42 (sec) , antiderivative size = 58, normalized size of antiderivative = 0.77 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {A a^{2} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{d} - \frac {B a^{2} \tan \left (d x + c\right )}{d} - \frac {2 \, {\left (A a^{2} - i \, B a^{2}\right )} \log \left (\tan \left (d x + c\right ) + i\right )}{d} \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c)),x, algorithm="g iac")
Output:
A*a^2*log(abs(tan(d*x + c)))/d - B*a^2*tan(d*x + c)/d - 2*(A*a^2 - I*B*a^2 )*log(tan(d*x + c) + I)/d
Time = 3.55 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.93 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {A\,a^2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {2\,A\,a^2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{d}-\frac {B\,a^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {B\,a^2\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d} \] Input:
int(cot(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^2,x)
Output:
(A*a^2*log(tan(c + d*x)))/d - (2*A*a^2*log(tan(c + d*x) + 1i))/d + (B*a^2* log(tan(c + d*x) + 1i)*2i)/d - (B*a^2*tan(c + d*x))/d
Time = 0.24 (sec) , antiderivative size = 197, normalized size of antiderivative = 2.63 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^2 (A+B \tan (c+d x)) \, dx=\frac {a^{2} \left (-2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) a +2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) b i +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) a -2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b i +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) a -2 \cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b i +\cos \left (d x +c \right ) \mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 \cos \left (d x +c \right ) a d i x +2 \cos \left (d x +c \right ) b d x -\sin \left (d x +c \right ) b \right )}{\cos \left (d x +c \right ) d} \] Input:
int(cot(d*x+c)*(a+I*a*tan(d*x+c))^2*(A+B*tan(d*x+c)),x)
Output:
(a**2*( - 2*cos(c + d*x)*log(tan((c + d*x)/2)**2 + 1)*a + 2*cos(c + d*x)*l og(tan((c + d*x)/2)**2 + 1)*b*i + cos(c + d*x)*log(tan((c + d*x)/2) - 1)*a - 2*cos(c + d*x)*log(tan((c + d*x)/2) - 1)*b*i + cos(c + d*x)*log(tan((c + d*x)/2) + 1)*a - 2*cos(c + d*x)*log(tan((c + d*x)/2) + 1)*b*i + cos(c + d*x)*log(tan((c + d*x)/2))*a + 2*cos(c + d*x)*a*d*i*x + 2*cos(c + d*x)*b*d *x - sin(c + d*x)*b))/(cos(c + d*x)*d)