Integrand size = 27, antiderivative size = 106 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=\frac {e^{2 (a-i d)+2 i (d+b x)}}{2 b}+\frac {e^{2 (a-i d)+4 i (d+b x)}}{16 b}-\frac {1}{4} i e^{2 a-2 i d} x+\frac {e^{2 a-2 i d} \log \left (1-e^{2 i (d+b x)}\right )}{b} \] Output:
1/2*exp(2*a-2*I*d+2*I*(b*x+d))/b+1/16*exp(2*a-2*I*d+4*I*(b*x+d))/b-1/4*I*e xp(2*a-2*I*d)*x+exp(2*a-2*I*d)*ln(1-exp(2*I*(b*x+d)))/b
Time = 0.29 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.68 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=\frac {e^{2 a-2 i d} \left (-4 i d+8 e^{2 i (d+b x)}+e^{4 i (d+b x)}-4 i b x+16 \log \left (1-e^{2 i (d+b x)}\right )\right )}{16 b} \] Input:
Integrate[E^(2*(a + I*b*x))*Cos[d + b*x]^2*Cot[d + b*x],x]
Output:
(E^(2*a - (2*I)*d)*((-4*I)*d + 8*E^((2*I)*(d + b*x)) + E^((4*I)*(d + b*x)) - (4*I)*b*x + 16*Log[1 - E^((2*I)*(d + b*x))]))/(16*b)
Time = 0.31 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.074, Rules used = {4974, 2009}
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 e^{2 (a+i b x)} \cos ^2(b x+d) \cot (b x+d) \, dx\) |
\(\Big \downarrow \) 4974 |
\(\displaystyle \int \left (i e^{2 a+2 i (b x+d)-2 i d}+\frac {1}{4} i e^{2 a+4 i (b x+d)-2 i d}+\frac {2 i e^{2 a-2 i d}}{-1+e^{2 i (b x+d)}}+\frac {7}{4} i e^{2 a-2 i d}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {e^{2 (a-i d)+2 i (b x+d)}}{2 b}+\frac {e^{2 (a-i d)+4 i (b x+d)}}{16 b}+\frac {e^{2 a-2 i d} \log \left (1-e^{2 i (b x+d)}\right )}{b}-\frac {1}{4} i x e^{2 a-2 i d}\) |
Input:
Int[E^(2*(a + I*b*x))*Cos[d + b*x]^2*Cot[d + b*x],x]
Output:
E^(2*(a - I*d) + (2*I)*(d + b*x))/(2*b) + E^(2*(a - I*d) + (4*I)*(d + b*x) )/(16*b) - (I/4)*E^(2*a - (2*I)*d)*x + (E^(2*a - (2*I)*d)*Log[1 - E^((2*I) *(d + b*x))])/b
Int[(F_)^((c_.)*((a_.) + (b_.)*(x_)))*(G_)[(d_.) + (e_.)*(x_)]^(m_.)*(H_)[( d_.) + (e_.)*(x_)]^(n_.), x_Symbol] :> Int[ExpandTrigToExp[F^(c*(a + b*x)), G[d + e*x]^m*H[d + e*x]^n, x], x] /; FreeQ[{F, a, b, c, d, e}, x] && IGtQ[ m, 0] && IGtQ[n, 0] && TrigQ[G] && TrigQ[H]
\[\int {\mathrm e}^{2 i b x +2 a} \cos \left (b x +d \right )^{2} \cot \left (b x +d \right )d x\]
Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x)
Output:
int(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x)
Time = 0.08 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.59 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=\frac {-4 i \, b x e^{\left (2 \, a - 2 i \, d\right )} + 16 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (2 i \, b x + 2 i \, d\right )} - 1\right ) + e^{\left (4 i \, b x + 2 \, a + 2 i \, d\right )} + 8 \, e^{\left (2 i \, b x + 2 \, a\right )}}{16 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x, algorithm="fricas")
Output:
1/16*(-4*I*b*x*e^(2*a - 2*I*d) + 16*e^(2*a - 2*I*d)*log(e^(2*I*b*x + 2*I*d ) - 1) + e^(4*I*b*x + 2*a + 2*I*d) + 8*e^(2*I*b*x + 2*a))/b
Time = 0.23 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.47 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=- \frac {i x e^{2 a} e^{- 2 i d}}{4} + \begin {cases} \frac {2 b e^{2 a} e^{2 i d} e^{4 i b x} + 16 b e^{2 a} e^{2 i b x}}{32 b^{2}} & \text {for}\: b^{2} \neq 0 \\x \left (\frac {\left (i e^{2 a} e^{4 i d} + 4 i e^{2 a} e^{2 i d} - i e^{2 a}\right ) e^{- 2 i d}}{4} + \frac {i e^{2 a} e^{- 2 i d}}{4}\right ) & \text {otherwise} \end {cases} + \frac {e^{2 a} e^{- 2 i d} \log {\left (e^{2 i b x} - e^{- 2 i d} \right )}}{b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)**2*cot(b*x+d),x)
Output:
-I*x*exp(2*a)*exp(-2*I*d)/4 + Piecewise(((2*b*exp(2*a)*exp(2*I*d)*exp(4*I* b*x) + 16*b*exp(2*a)*exp(2*I*b*x))/(32*b**2), Ne(b**2, 0)), (x*((I*exp(2*a )*exp(4*I*d) + 4*I*exp(2*a)*exp(2*I*d) - I*exp(2*a))*exp(-2*I*d)/4 + I*exp (2*a)*exp(-2*I*d)/4), True)) + exp(2*a)*exp(-2*I*d)*log(exp(2*I*b*x) - exp (-2*I*d))/b
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 281 vs. \(2 (69) = 138\).
Time = 0.05 (sec) , antiderivative size = 281, normalized size of antiderivative = 2.65 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=\frac {4 \, {\left (-i \, b \cos \left (2 \, d\right ) e^{\left (2 \, a\right )} - b e^{\left (2 \, a\right )} \sin \left (2 \, d\right )\right )} x + 16 \, {\left (i \, \cos \left (2 \, d\right ) e^{\left (2 \, a\right )} + e^{\left (2 \, a\right )} \sin \left (2 \, d\right )\right )} \arctan \left (\sin \left (b x\right ) + \sin \left (d\right ), \cos \left (b x\right ) - \cos \left (d\right )\right ) + 16 \, {\left (i \, \cos \left (2 \, d\right ) e^{\left (2 \, a\right )} + e^{\left (2 \, a\right )} \sin \left (2 \, d\right )\right )} \arctan \left (\sin \left (b x\right ) - \sin \left (d\right ), \cos \left (b x\right ) + \cos \left (d\right )\right ) + 8 \, \cos \left (2 \, b x\right ) e^{\left (2 \, a\right )} + \cos \left (4 \, b x + 2 \, d\right ) e^{\left (2 \, a\right )} + 8 \, {\left (\cos \left (2 \, d\right ) e^{\left (2 \, a\right )} - i \, e^{\left (2 \, a\right )} \sin \left (2 \, d\right )\right )} \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (d\right ) + \cos \left (d\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (d\right ) + \sin \left (d\right )^{2}\right ) + 8 \, {\left (\cos \left (2 \, d\right ) e^{\left (2 \, a\right )} - i \, e^{\left (2 \, a\right )} \sin \left (2 \, d\right )\right )} \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (d\right ) + \cos \left (d\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (d\right ) + \sin \left (d\right )^{2}\right ) + 8 i \, e^{\left (2 \, a\right )} \sin \left (2 \, b x\right ) + i \, e^{\left (2 \, a\right )} \sin \left (4 \, b x + 2 \, d\right )}{16 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x, algorithm="maxima")
Output:
1/16*(4*(-I*b*cos(2*d)*e^(2*a) - b*e^(2*a)*sin(2*d))*x + 16*(I*cos(2*d)*e^ (2*a) + e^(2*a)*sin(2*d))*arctan2(sin(b*x) + sin(d), cos(b*x) - cos(d)) + 16*(I*cos(2*d)*e^(2*a) + e^(2*a)*sin(2*d))*arctan2(sin(b*x) - sin(d), cos( b*x) + cos(d)) + 8*cos(2*b*x)*e^(2*a) + cos(4*b*x + 2*d)*e^(2*a) + 8*(cos( 2*d)*e^(2*a) - I*e^(2*a)*sin(2*d))*log(cos(b*x)^2 + 2*cos(b*x)*cos(d) + co s(d)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(d) + sin(d)^2) + 8*(cos(2*d)*e^(2*a) - I*e^(2*a)*sin(2*d))*log(cos(b*x)^2 - 2*cos(b*x)*cos(d) + cos(d)^2 + sin( b*x)^2 + 2*sin(b*x)*sin(d) + sin(d)^2) + 8*I*e^(2*a)*sin(2*b*x) + I*e^(2*a )*sin(4*b*x + 2*d))/b
Time = 0.17 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.67 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=-\frac {4 \, {\left (i \, b x + i \, d\right )} e^{\left (2 \, a - 2 i \, d\right )} - 16 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (2 i \, b x + 2 i \, d\right )} - 1\right ) - e^{\left (4 i \, b x + 2 \, a + 2 i \, d\right )} - 8 \, e^{\left (2 i \, b x + 2 \, a\right )}}{16 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x, algorithm="giac")
Output:
-1/16*(4*(I*b*x + I*d)*e^(2*a - 2*I*d) - 16*e^(2*a - 2*I*d)*log(e^(2*I*b*x + 2*I*d) - 1) - e^(4*I*b*x + 2*a + 2*I*d) - 8*e^(2*I*b*x + 2*a))/b
Time = 15.33 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.80 \[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=-\frac {x\,{\mathrm {e}}^{2\,a-d\,2{}\mathrm {i}}\,1{}\mathrm {i}}{4}+\frac {{\mathrm {e}}^{2\,a+d\,2{}\mathrm {i}+b\,x\,4{}\mathrm {i}}}{16\,b}+\frac {{\mathrm {e}}^{2\,a+b\,x\,2{}\mathrm {i}}}{2\,b}+\frac {{\mathrm {e}}^{2\,a-d\,2{}\mathrm {i}}\,\ln \left ({\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{b\,x\,2{}\mathrm {i}}-{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{-d\,2{}\mathrm {i}}\right )}{b} \] Input:
int(cos(d + b*x)^2*cot(d + b*x)*exp(2*a + b*x*2i),x)
Output:
exp(2*a + d*2i + b*x*4i)/(16*b) - (x*exp(2*a - d*2i)*1i)/4 + exp(2*a + b*x *2i)/(2*b) + (exp(2*a - d*2i)*log(exp(2*a)*exp(b*x*2i) - exp(2*a)*exp(-d*2 i)))/b
\[ \int e^{2 (a+i b x)} \cos ^2(d+b x) \cot (d+b x) \, dx=e^{2 a} \left (\int e^{2 b i x} \cos \left (b x +d \right )^{2} \cot \left (b x +d \right )d x \right ) \] Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)^2*cot(b*x+d),x)
Output:
e**(2*a)*int(e**(2*b*i*x)*cos(b*x + d)**2*cot(b*x + d),x)