Integrand size = 25, antiderivative size = 85 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=\frac {3 e^{2 (a-i d)+i (d+b x)}}{2 b}+\frac {e^{2 (a-i d)+3 i (d+b x)}}{6 b}-\frac {2 e^{2 a-2 i d} \text {arctanh}\left (e^{i (d+b x)}\right )}{b} \] Output:
3/2*exp(2*a-2*I*d+I*(b*x+d))/b+1/6*exp(2*a-2*I*d+3*I*(b*x+d))/b-2*exp(2*a- 2*I*d)*arctanh(exp(I*(b*x+d)))/b
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(275\) vs. \(2(85)=170\).
Time = 0.24 (sec) , antiderivative size = 275, normalized size of antiderivative = 3.24 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=\frac {e^{2 a} \left (9 e^{i b x} \cos (d)+e^{3 i b x} \cos (d)+3 \cos (2 d) \log \left (1+e^{2 i b x}-2 e^{i b x} \cos (d)\right )-3 \cos (2 d) \log \left (1+e^{2 i b x}+2 e^{i b x} \cos (d)\right )-9 i e^{i b x} \sin (d)+i e^{3 i b x} \sin (d)+\arctan \left (\frac {\left (-1+e^{i b x}\right ) \tan \left (\frac {d}{2}\right )}{1+e^{i b x}}\right ) (-6 i \cos (2 d)-6 \sin (2 d))-3 i \log \left (1+e^{2 i b x}-2 e^{i b x} \cos (d)\right ) \sin (2 d)+3 i \log \left (1+e^{2 i b x}+2 e^{i b x} \cos (d)\right ) \sin (2 d)+6 \arctan \left (\frac {\left (1+e^{i b x}\right ) \tan \left (\frac {d}{2}\right )}{-1+e^{i b x}}\right ) (i \cos (2 d)+\sin (2 d))\right )}{6 b} \] Input:
Integrate[E^(2*(a + I*b*x))*Cos[d + b*x]*Cot[d + b*x],x]
Output:
(E^(2*a)*(9*E^(I*b*x)*Cos[d] + E^((3*I)*b*x)*Cos[d] + 3*Cos[2*d]*Log[1 + E ^((2*I)*b*x) - 2*E^(I*b*x)*Cos[d]] - 3*Cos[2*d]*Log[1 + E^((2*I)*b*x) + 2* E^(I*b*x)*Cos[d]] - (9*I)*E^(I*b*x)*Sin[d] + I*E^((3*I)*b*x)*Sin[d] + ArcT an[((-1 + E^(I*b*x))*Tan[d/2])/(1 + E^(I*b*x))]*((-6*I)*Cos[2*d] - 6*Sin[2 *d]) - (3*I)*Log[1 + E^((2*I)*b*x) - 2*E^(I*b*x)*Cos[d]]*Sin[2*d] + (3*I)* Log[1 + E^((2*I)*b*x) + 2*E^(I*b*x)*Cos[d]]*Sin[2*d] + 6*ArcTan[((1 + E^(I *b*x))*Tan[d/2])/(-1 + E^(I*b*x))]*(I*Cos[2*d] + Sin[2*d])))/(6*b)
Time = 0.31 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.05, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, 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 (b x+d) \, dx\) |
\(\Big \downarrow \) 4974 |
\(\displaystyle \int \left (\frac {3}{2} i e^{2 a+i b x-i d}+\frac {1}{2} i e^{2 a+2 i (b x+d)+i b x-i d}+\frac {2 i e^{2 a+i b x-i d}}{-1+e^{2 i (b x+d)}}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {2 e^{2 a-2 i d} \text {arctanh}\left (e^{i b x+i d}\right )}{b}+\frac {3 e^{2 a+i b x-i d}}{2 b}+\frac {e^{2 a+2 i (b x+d)+i b x-i d}}{6 b}\) |
Input:
Int[E^(2*(a + I*b*x))*Cos[d + b*x]*Cot[d + b*x],x]
Output:
(3*E^(2*a - I*d + I*b*x))/(2*b) + E^(2*a - I*d + I*b*x + (2*I)*(d + b*x))/ (6*b) - (2*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 )d x\]
Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x)
Output:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x)
Time = 0.08 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.92 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=-\frac {6 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (i \, b x + i \, d\right )} + 1\right ) - 6 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (e^{\left (i \, b x + i \, d\right )} - 1\right ) - e^{\left (3 i \, b x + 2 \, a + i \, d\right )} - 9 \, e^{\left (i \, b x + 2 \, a - i \, d\right )}}{6 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x, algorithm="fricas")
Output:
-1/6*(6*e^(2*a - 2*I*d)*log(e^(I*b*x + I*d) + 1) - 6*e^(2*a - 2*I*d)*log(e ^(I*b*x + I*d) - 1) - e^(3*I*b*x + 2*a + I*d) - 9*e^(I*b*x + 2*a - I*d))/b
Time = 0.27 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.52 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=\begin {cases} \frac {\left (2 b e^{2 a} e^{2 i d} e^{3 i b x} + 18 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 (i e^{2 a} e^{2 i d} + 3 i e^{2 a}\right ) e^{- i d}}{2} & \text {otherwise} \end {cases} + \frac {\left (\log {\left (e^{i b x} - e^{- i d} \right )} - \log {\left (e^{i b x} + e^{- i d} \right )}\right ) e^{2 a} e^{- 2 i d}}{b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x)
Output:
Piecewise(((2*b*exp(2*a)*exp(2*I*d)*exp(3*I*b*x) + 18*b*exp(2*a)*exp(I*b*x ))*exp(-I*d)/(12*b**2), Ne(b**2*exp(I*d), 0)), (x*(I*exp(2*a)*exp(2*I*d) + 3*I*exp(2*a))*exp(-I*d)/2, True)) + (log(exp(I*b*x) - exp(-I*d)) - log(ex p(I*b*x) + exp(-I*d)))*exp(2*a)*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. 258 vs. \(2 (58) = 116\).
Time = 0.05 (sec) , antiderivative size = 258, normalized size of antiderivative = 3.04 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=\frac {6 \, {\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 ) + 6 \, {\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 ) + \cos \left (3 \, b x + d\right ) e^{\left (2 \, a\right )} + 9 \, \cos \left (b x - d\right ) e^{\left (2 \, a\right )} - 3 \, {\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 ) + 3 \, {\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 ) + i \, e^{\left (2 \, a\right )} \sin \left (3 \, b x + d\right ) + 9 i \, e^{\left (2 \, a\right )} \sin \left (b x - d\right )}{6 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x, algorithm="maxima")
Output:
1/6*(6*(I*cos(2*d)*e^(2*a) + e^(2*a)*sin(2*d))*arctan2(sin(b*x) + sin(d), cos(b*x) - cos(d)) + 6*(-I*cos(2*d)*e^(2*a) - e^(2*a)*sin(2*d))*arctan2(si n(b*x) - sin(d), cos(b*x) + cos(d)) + cos(3*b*x + d)*e^(2*a) + 9*cos(b*x - d)*e^(2*a) - 3*(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) + 3*(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) + I*e^(2*a)*si n(3*b*x + d) + 9*I*e^(2*a)*sin(b*x - d))/b
Time = 0.15 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.96 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=-\frac {6 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (i \, e^{\left (i \, b x + i \, d\right )} + i\right ) - 6 \, e^{\left (2 \, a - 2 i \, d\right )} \log \left (-i \, e^{\left (i \, b x + i \, d\right )} + i\right ) - e^{\left (3 i \, b x + 2 \, a + i \, d\right )} - 9 \, e^{\left (i \, b x + 2 \, a - i \, d\right )}}{6 \, b} \] Input:
integrate(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x, algorithm="giac")
Output:
-1/6*(6*e^(2*a - 2*I*d)*log(I*e^(I*b*x + I*d) + I) - 6*e^(2*a - 2*I*d)*log (-I*e^(I*b*x + I*d) + I) - e^(3*I*b*x + 2*a + I*d) - 9*e^(I*b*x + 2*a - I* d))/b
Time = 16.04 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.86 \[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (d+b x) \, dx=\frac {3\,{\mathrm {e}}^{2\,a-d\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}}{2\,b}+\frac {{\mathrm {e}}^{2\,a+d\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}}}{6\,b}-\frac {\sqrt {{\mathrm {e}}^{4\,a-d\,4{}\mathrm {i}}}\,\ln \left (-{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,3{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,2{}\mathrm {i}-{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{-d\,2{}\mathrm {i}}\,\sqrt {{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,4{}\mathrm {i}}}\,2{}\mathrm {i}\right )}{b}+\frac {\sqrt {{\mathrm {e}}^{4\,a-d\,4{}\mathrm {i}}}\,\ln \left (-{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,3{}\mathrm {i}}\,{\mathrm {e}}^{b\,x\,1{}\mathrm {i}}\,2{}\mathrm {i}+{\mathrm {e}}^{2\,a}\,{\mathrm {e}}^{-d\,2{}\mathrm {i}}\,\sqrt {{\mathrm {e}}^{4\,a}\,{\mathrm {e}}^{-d\,4{}\mathrm {i}}}\,2{}\mathrm {i}\right )}{b} \] Input:
int(cos(d + b*x)*cot(d + b*x)*exp(2*a + b*x*2i),x)
Output:
(3*exp(2*a - d*1i + b*x*1i))/(2*b) + exp(2*a + d*1i + b*x*3i)/(6*b) - (exp (4*a - d*4i)^(1/2)*log(- exp(4*a)*exp(-d*3i)*exp(b*x*1i)*2i - exp(2*a)*exp (-d*2i)*(exp(4*a)*exp(-d*4i))^(1/2)*2i))/b + (exp(4*a - d*4i)^(1/2)*log(ex p(2*a)*exp(-d*2i)*(exp(4*a)*exp(-d*4i))^(1/2)*2i - exp(4*a)*exp(-d*3i)*exp (b*x*1i)*2i))/b
\[ \int e^{2 (a+i b x)} \cos (d+b x) \cot (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 )d x \right ) \] Input:
int(exp(2*a+2*I*b*x)*cos(b*x+d)*cot(b*x+d),x)
Output:
e**(2*a)*int(e**(2*b*i*x)*cos(b*x + d)*cot(b*x + d),x)