Integrand size = 27, antiderivative size = 136 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\frac {5 i e^{2 (a-i d)+i (d+b x)}}{2 b}+\frac {i e^{2 (a-i d)+3 i (d+b x)}}{6 b}+\frac {2 i e^{2 (a-i d)+i (d+b x)}}{b \left (1-e^{2 i (d+b x)}\right )}-\frac {4 i e^{2 a-2 i d} \text {arctanh}\left (e^{i (d+b x)}\right )}{b} \] Output:
5/2*I*exp(2*a-2*I*d+I*(b*x+d))/b+1/6*I*exp(2*a-2*I*d+3*I*(b*x+d))/b+2*I*ex p(2*a-2*I*d+I*(b*x+d))/b/(1-exp(2*I*(b*x+d)))-4*I*exp(2*a-2*I*d)*arctanh(e xp(I*(b*x+d)))/b
Time = 0.30 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.99 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\frac {i e^{2 a-2 i d} \left (e^{i (d+b x)} \left (-27+14 e^{2 i (d+b x)}+e^{4 i (d+b x)}\right )+12 \left (-1+e^{2 i (d+b x)}\right ) \log \left (1-e^{i (d+b x)}\right )-12 \left (-1+e^{2 i (d+b x)}\right ) \log \left (1+e^{i (d+b x)}\right )\right )}{6 b \left (-1+e^{2 i (d+b x)}\right )} \] Input:
Integrate[E^(2*(a + I*b*x))*Cos[d + b*x]*Cot[d + b*x]^2,x]
Output:
((I/6)*E^(2*a - (2*I)*d)*(E^(I*(d + b*x))*(-27 + 14*E^((2*I)*(d + b*x)) + E^((4*I)*(d + b*x))) + 12*(-1 + E^((2*I)*(d + b*x)))*Log[1 - E^(I*(d + b*x ))] - 12*(-1 + E^((2*I)*(d + b*x)))*Log[1 + E^(I*(d + b*x))]))/(b*(-1 + E^ ((2*I)*(d + b*x))))
Time = 0.41 (sec) , antiderivative size = 136, 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 (b x+d) \cot ^2(b x+d) \, dx\) |
\(\Big \downarrow \) 4974 |
\(\displaystyle \int \left (-\frac {5}{2} e^{2 a+i b x-i d}-\frac {1}{2} e^{2 a+2 i (b x+d)+i b x-i d}-\frac {6 e^{2 a+i b x-i d}}{-1+e^{2 i (b x+d)}}-\frac {4 e^{2 a+i b x-i d}}{\left (-1+e^{2 i (b x+d)}\right )^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {4 i e^{2 a-2 i d} \text {arctanh}\left (e^{i b x+i d}\right )}{b}+\frac {5 i e^{2 a+i b x-i d}}{2 b}+\frac {i e^{2 a+2 i (b x+d)+i b x-i d}}{6 b}+\frac {2 i e^{2 a+i b x-i d}}{b \left (1-e^{2 i (b x+d)}\right )}\) |
Input:
Int[E^(2*(a + I*b*x))*Cos[d + b*x]*Cot[d + b*x]^2,x]
Output:
(((5*I)/2)*E^(2*a - I*d + I*b*x))/b + ((I/6)*E^(2*a - I*d + I*b*x + (2*I)* (d + b*x)))/b + ((2*I)*E^(2*a - I*d + I*b*x))/(b*(1 - E^((2*I)*(d + b*x))) ) - ((4*I)*E^(2*a - (2*I)*d)*ArcTanh[E^(I*d + I*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 ) \cot \left (b x +d \right )^{2}d x\]
Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x)
Output:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x)
Time = 0.08 (sec) , antiderivative size = 134, normalized size of antiderivative = 0.99 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=-\frac {12 \, {\left (i \, e^{\left (2 i \, b x + 2 \, a\right )} - i \, e^{\left (2 \, a - 2 i \, d\right )}\right )} \log \left (e^{\left (i \, b x + i \, d\right )} + 1\right ) + 12 \, {\left (-i \, e^{\left (2 i \, b x + 2 \, a\right )} + i \, e^{\left (2 \, a - 2 i \, d\right )}\right )} \log \left (e^{\left (i \, b x + i \, d\right )} - 1\right ) - i \, e^{\left (5 i \, b x + 2 \, a + 3 i \, d\right )} - 14 i \, e^{\left (3 i \, b x + 2 \, a + i \, d\right )} + 27 i \, e^{\left (i \, b x + 2 \, a - i \, d\right )}}{6 \, {\left (b e^{\left (2 i \, b x + 2 i \, d\right )} - b\right )}} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x, algorithm="fricas")
Output:
-1/6*(12*(I*e^(2*I*b*x + 2*a) - I*e^(2*a - 2*I*d))*log(e^(I*b*x + I*d) + 1 ) + 12*(-I*e^(2*I*b*x + 2*a) + I*e^(2*a - 2*I*d))*log(e^(I*b*x + I*d) - 1) - I*e^(5*I*b*x + 2*a + 3*I*d) - 14*I*e^(3*I*b*x + 2*a + I*d) + 27*I*e^(I* b*x + 2*a - I*d))/(b*e^(2*I*b*x + 2*I*d) - b)
Time = 0.27 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.21 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\begin {cases} \frac {\left (2 i b e^{2 a} e^{2 i d} e^{3 i b x} + 30 i b e^{2 a} e^{i b x}\right ) e^{- i d}}{12 b^{2}} & \text {for}\: b^{2} e^{i d} \neq 0 \\\frac {x \left (- e^{2 a} e^{2 i d} - 5 e^{2 a}\right ) e^{- i d}}{2} & \text {otherwise} \end {cases} - \frac {2 i e^{2 a} e^{i b x}}{b e^{3 i d} e^{2 i b x} - b e^{i d}} + \frac {2 e^{2 a} e^{- 2 i d} \operatorname {RootSum} {\left (z^{2} + 1, \left ( i \mapsto i \log {\left (i i e^{- i d} + e^{i b x} \right )} \right )\right )}}{b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)**2,x)
Output:
Piecewise(((2*I*b*exp(2*a)*exp(2*I*d)*exp(3*I*b*x) + 30*I*b*exp(2*a)*exp(I *b*x))*exp(-I*d)/(12*b**2), Ne(b**2*exp(I*d), 0)), (x*(-exp(2*a)*exp(2*I*d ) - 5*exp(2*a))*exp(-I*d)/2, True)) - 2*I*exp(2*a)*exp(I*b*x)/(b*exp(3*I*d )*exp(2*I*b*x) - b*exp(I*d)) + 2*exp(2*a)*exp(-2*I*d)*RootSum(_z**2 + 1, L ambda(_i, _i*log(_i*I*exp(-I*d) + exp(I*b*x))))/b
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 660 vs. \(2 (88) = 176\).
Time = 0.07 (sec) , antiderivative size = 660, normalized size of antiderivative = 4.85 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\text {Too large to display} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x, algorithm="maxima")
Output:
-(12*((-I*cos(2*d)*e^(2*a) - e^(2*a)*sin(2*d))*cos(2*b*x + 3*d) + (I*cos(d )*e^(2*a) - e^(2*a)*sin(d))*cos(2*d) + (cos(2*d)*e^(2*a) - I*e^(2*a)*sin(2 *d))*sin(2*b*x + 3*d) + (cos(d)*e^(2*a) + I*e^(2*a)*sin(d))*sin(2*d))*arct an2(sin(b*x) + sin(d), cos(b*x) - cos(d)) + 12*((I*cos(2*d)*e^(2*a) + e^(2 *a)*sin(2*d))*cos(2*b*x + 3*d) + (-I*cos(d)*e^(2*a) + e^(2*a)*sin(d))*cos( 2*d) - (cos(2*d)*e^(2*a) - I*e^(2*a)*sin(2*d))*sin(2*b*x + 3*d) - (cos(d)* e^(2*a) + I*e^(2*a)*sin(d))*sin(2*d))*arctan2(sin(b*x) - sin(d), cos(b*x) + cos(d)) - cos(5*b*x + 4*d)*e^(2*a) - 14*cos(3*b*x + 2*d)*e^(2*a) + 27*co s(b*x)*e^(2*a) + 6*((cos(2*d)*e^(2*a) - I*e^(2*a)*sin(2*d))*cos(2*b*x + 3* d) - (cos(d)*e^(2*a) + I*e^(2*a)*sin(d))*cos(2*d) + (I*cos(2*d)*e^(2*a) + e^(2*a)*sin(2*d))*sin(2*b*x + 3*d) + (I*cos(d)*e^(2*a) - e^(2*a)*sin(d))*s in(2*d))*log(cos(b*x)^2 + 2*cos(b*x)*cos(d) + cos(d)^2 + sin(b*x)^2 - 2*si n(b*x)*sin(d) + sin(d)^2) - 6*((cos(2*d)*e^(2*a) - I*e^(2*a)*sin(2*d))*cos (2*b*x + 3*d) - (cos(d)*e^(2*a) + I*e^(2*a)*sin(d))*cos(2*d) - (-I*cos(2*d )*e^(2*a) - e^(2*a)*sin(2*d))*sin(2*b*x + 3*d) - (-I*cos(d)*e^(2*a) + e^(2 *a)*sin(d))*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) - I*e^(2*a)*sin(5*b*x + 4*d) - 14*I *e^(2*a)*sin(3*b*x + 2*d) + 27*I*e^(2*a)*sin(b*x))/(-6*I*b*cos(2*b*x + 3*d ) + 6*I*b*cos(d) + 6*b*sin(2*b*x + 3*d) - 6*b*sin(d))
Time = 0.17 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.11 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\frac {-12 i \, e^{\left (2 i \, b x + 2 \, a\right )} \log \left (e^{\left (i \, b x + i \, d\right )} + 1\right ) + 12 i \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (i \, b x + i \, d\right )} + 1\right ) + 12 i \, e^{\left (2 i \, b x + 2 \, a\right )} \log \left (e^{\left (i \, b x + i \, d\right )} - 1\right ) - 12 i \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (i \, b x + i \, d\right )} - 1\right ) + i \, e^{\left (5 i \, b x + 2 \, a + 3 i \, d\right )} + 14 i \, e^{\left (3 i \, b x + 2 \, a + i \, d\right )} - 27 i \, e^{\left (i \, b x + 2 \, a - i \, d\right )}}{6 \, b {\left (e^{\left (2 i \, b x + 2 i \, d\right )} - 1\right )}} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x, algorithm="giac")
Output:
1/6*(-12*I*e^(2*I*b*x + 2*a)*log(e^(I*b*x + I*d) + 1) + 12*I*e^(2*a - 2*I* d)*log(e^(I*b*x + I*d) + 1) + 12*I*e^(2*I*b*x + 2*a)*log(e^(I*b*x + I*d) - 1) - 12*I*e^(2*a - 2*I*d)*log(e^(I*b*x + I*d) - 1) + I*e^(5*I*b*x + 2*a + 3*I*d) + 14*I*e^(3*I*b*x + 2*a + I*d) - 27*I*e^(I*b*x + 2*a - I*d))/(b*(e ^(2*I*b*x + 2*I*d) - 1))
Time = 16.70 (sec) , antiderivative size = 209, normalized size of antiderivative = 1.54 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=\frac {{\mathrm {e}}^{2\,a-d\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,5{}\mathrm {i}}{2\,b}+\frac {{\mathrm {e}}^{2\,a+d\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}}\,1{}\mathrm {i}}{6\,b}+\frac {{\mathrm {e}}^{4\,a-d\,3{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,2{}\mathrm {i}}{b\,\left ({\mathrm {e}}^{2\,a-d\,2{}\mathrm {i}}-{\mathrm {e}}^{2\,a+b\,x\,2{}\mathrm {i}}\right )}-\frac {2\,\sqrt {-{\mathrm {e}}^{4\,a-d\,4{}\mathrm {i}}}\,\ln \left (4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,3{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}-{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{-d\,2{}\mathrm {i}}\,\sqrt {-{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,4{}\mathrm {i}}}\,4{}\mathrm {i}\right )}{b}+\frac {2\,\sqrt {-{\mathrm {e}}^{4\,a-d\,4{}\mathrm {i}}}\,\ln \left (4\,{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,3{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}+{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{-d\,2{}\mathrm {i}}\,\sqrt {-{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,4{}\mathrm {i}}}\,4{}\mathrm {i}\right )}{b} \] Input:
int(cos(d + b*x)*cot(d + b*x)^2*exp(2*a + b*x*2i),x)
Output:
(exp(2*a - d*1i + b*x*1i)*5i)/(2*b) + (exp(2*a + d*1i + b*x*3i)*1i)/(6*b) + (exp(4*a - d*3i + b*x*1i)*2i)/(b*(exp(2*a - d*2i) - exp(2*a + b*x*2i))) - (2*(-exp(4*a - d*4i))^(1/2)*log(4*exp(4*a)*exp(-d*3i)*exp(b*x*1i) - exp( 2*a)*exp(-d*2i)*(-exp(4*a)*exp(-d*4i))^(1/2)*4i))/b + (2*(-exp(4*a - d*4i) )^(1/2)*log(4*exp(4*a)*exp(-d*3i)*exp(b*x*1i) + exp(2*a)*exp(-d*2i)*(-exp( 4*a)*exp(-d*4i))^(1/2)*4i))/b
\[ \int e^{2 (a+i b x)} \cos (d+b x) \cot ^2(d+b x) \, dx=e^{2 a} \left (\int e^{2 b i x} \cos \left (b x +d \right ) \cot \left (b x +d \right )^{2}d x \right ) \] Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d)^2,x)
Output:
e**(2*a)*int(e**(2*b*i*x)*cos(b*x + d)*cot(b*x + d)**2,x)