Integrand size = 23, antiderivative size = 434 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=-\frac {1}{4 a^2 d (c+d x)}+\frac {\cos (2 e+2 f x)}{2 a^2 d (c+d x)}-\frac {\cos ^2(2 e+2 f x)}{4 a^2 d (c+d x)}-\frac {i f \cos \left (2 e-\frac {2 c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right )}{a^2 d^2}+\frac {i f \cos \left (4 e-\frac {4 c f}{d}\right ) \operatorname {CosIntegral}\left (\frac {4 c f}{d}+4 f x\right )}{a^2 d^2}-\frac {f \operatorname {CosIntegral}\left (\frac {4 c f}{d}+4 f x\right ) \sin \left (4 e-\frac {4 c f}{d}\right )}{a^2 d^2}+\frac {f \operatorname {CosIntegral}\left (\frac {2 c f}{d}+2 f x\right ) \sin \left (2 e-\frac {2 c f}{d}\right )}{a^2 d^2}+\frac {i \sin (2 e+2 f x)}{2 a^2 d (c+d x)}+\frac {\sin ^2(2 e+2 f x)}{4 a^2 d (c+d x)}-\frac {i \sin (4 e+4 f x)}{4 a^2 d (c+d x)}+\frac {f \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{a^2 d^2}+\frac {i f \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (\frac {2 c f}{d}+2 f x\right )}{a^2 d^2}-\frac {f \cos \left (4 e-\frac {4 c f}{d}\right ) \text {Si}\left (\frac {4 c f}{d}+4 f x\right )}{a^2 d^2}-\frac {i f \sin \left (4 e-\frac {4 c f}{d}\right ) \text {Si}\left (\frac {4 c f}{d}+4 f x\right )}{a^2 d^2} \] Output:
-1/4/a^2/d/(d*x+c)+1/2*cos(2*f*x+2*e)/a^2/d/(d*x+c)-1/4*cos(2*f*x+2*e)^2/a ^2/d/(d*x+c)-I*f*cos(-2*e+2*c*f/d)*Ci(2*c*f/d+2*f*x)/a^2/d^2+I*f*cos(-4*e+ 4*c*f/d)*Ci(4*c*f/d+4*f*x)/a^2/d^2+f*Ci(4*c*f/d+4*f*x)*sin(-4*e+4*c*f/d)/a ^2/d^2-f*Ci(2*c*f/d+2*f*x)*sin(-2*e+2*c*f/d)/a^2/d^2+1/2*I*sin(2*f*x+2*e)/ a^2/d/(d*x+c)+1/4*sin(2*f*x+2*e)^2/a^2/d/(d*x+c)-1/4*I*sin(4*f*x+4*e)/a^2/ d/(d*x+c)+f*cos(-2*e+2*c*f/d)*Si(2*c*f/d+2*f*x)/a^2/d^2-I*f*sin(-2*e+2*c*f /d)*Si(2*c*f/d+2*f*x)/a^2/d^2-f*cos(-4*e+4*c*f/d)*Si(4*c*f/d+4*f*x)/a^2/d^ 2+I*f*sin(-4*e+4*c*f/d)*Si(4*c*f/d+4*f*x)/a^2/d^2
Time = 0.42 (sec) , antiderivative size = 203, normalized size of antiderivative = 0.47 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=\frac {-d+2 d (\cos (2 (e+f x))+i \sin (2 (e+f x)))-d (\cos (4 (e+f x))+i \sin (4 (e+f x)))+4 f (c+d x) \left (-i \cos \left (2 e-\frac {2 c f}{d}\right )+\sin \left (2 e-\frac {2 c f}{d}\right )\right ) \left (\operatorname {CosIntegral}\left (\frac {2 f (c+d x)}{d}\right )+i \text {Si}\left (\frac {2 f (c+d x)}{d}\right )\right )+(c+d x) \left (4 i f \cos \left (4 e-\frac {4 c f}{d}\right )-4 f \sin \left (4 e-\frac {4 c f}{d}\right )\right ) \left (\operatorname {CosIntegral}\left (\frac {4 f (c+d x)}{d}\right )+i \text {Si}\left (\frac {4 f (c+d x)}{d}\right )\right )}{4 a^2 d^2 (c+d x)} \] Input:
Integrate[1/((c + d*x)^2*(a + I*a*Cot[e + f*x])^2),x]
Output:
(-d + 2*d*(Cos[2*(e + f*x)] + I*Sin[2*(e + f*x)]) - d*(Cos[4*(e + f*x)] + I*Sin[4*(e + f*x)]) + 4*f*(c + d*x)*((-I)*Cos[2*e - (2*c*f)/d] + Sin[2*e - (2*c*f)/d])*(CosIntegral[(2*f*(c + d*x))/d] + I*SinIntegral[(2*f*(c + d*x ))/d]) + (c + d*x)*((4*I)*f*Cos[4*e - (4*c*f)/d] - 4*f*Sin[4*e - (4*c*f)/d ])*(CosIntegral[(4*f*(c + d*x))/d] + I*SinIntegral[(4*f*(c + d*x))/d]))/(4 *a^2*d^2*(c + d*x))
Time = 1.05 (sec) , antiderivative size = 434, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3042, 4211, 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 \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(c+d x)^2 \left (a-i a \tan \left (e+f x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 4211 |
\(\displaystyle \int \left (-\frac {\sin ^2(2 e+2 f x)}{4 a^2 (c+d x)^2}-\frac {i \sin (2 e+2 f x)}{2 a^2 (c+d x)^2}+\frac {i \sin (4 e+4 f x)}{4 a^2 (c+d x)^2}+\frac {\cos ^2(2 e+2 f x)}{4 a^2 (c+d x)^2}-\frac {\cos (2 e+2 f x)}{2 a^2 (c+d x)^2}+\frac {1}{4 a^2 (c+d x)^2}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {f \operatorname {CosIntegral}\left (4 x f+\frac {4 c f}{d}\right ) \sin \left (4 e-\frac {4 c f}{d}\right )}{a^2 d^2}+\frac {f \operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \sin \left (2 e-\frac {2 c f}{d}\right )}{a^2 d^2}-\frac {i f \operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{a^2 d^2}+\frac {i f \operatorname {CosIntegral}\left (4 x f+\frac {4 c f}{d}\right ) \cos \left (4 e-\frac {4 c f}{d}\right )}{a^2 d^2}+\frac {i f \sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{a^2 d^2}-\frac {i f \sin \left (4 e-\frac {4 c f}{d}\right ) \text {Si}\left (4 x f+\frac {4 c f}{d}\right )}{a^2 d^2}+\frac {f \cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{a^2 d^2}-\frac {f \cos \left (4 e-\frac {4 c f}{d}\right ) \text {Si}\left (4 x f+\frac {4 c f}{d}\right )}{a^2 d^2}+\frac {\sin ^2(2 e+2 f x)}{4 a^2 d (c+d x)}+\frac {i \sin (2 e+2 f x)}{2 a^2 d (c+d x)}-\frac {i \sin (4 e+4 f x)}{4 a^2 d (c+d x)}-\frac {\cos ^2(2 e+2 f x)}{4 a^2 d (c+d x)}+\frac {\cos (2 e+2 f x)}{2 a^2 d (c+d x)}-\frac {1}{4 a^2 d (c+d x)}\) |
Input:
Int[1/((c + d*x)^2*(a + I*a*Cot[e + f*x])^2),x]
Output:
-1/4*1/(a^2*d*(c + d*x)) + Cos[2*e + 2*f*x]/(2*a^2*d*(c + d*x)) - Cos[2*e + 2*f*x]^2/(4*a^2*d*(c + d*x)) - (I*f*Cos[2*e - (2*c*f)/d]*CosIntegral[(2* c*f)/d + 2*f*x])/(a^2*d^2) + (I*f*Cos[4*e - (4*c*f)/d]*CosIntegral[(4*c*f) /d + 4*f*x])/(a^2*d^2) - (f*CosIntegral[(4*c*f)/d + 4*f*x]*Sin[4*e - (4*c* f)/d])/(a^2*d^2) + (f*CosIntegral[(2*c*f)/d + 2*f*x]*Sin[2*e - (2*c*f)/d]) /(a^2*d^2) + ((I/2)*Sin[2*e + 2*f*x])/(a^2*d*(c + d*x)) + Sin[2*e + 2*f*x] ^2/(4*a^2*d*(c + d*x)) - ((I/4)*Sin[4*e + 4*f*x])/(a^2*d*(c + d*x)) + (f*C os[2*e - (2*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/(a^2*d^2) + (I*f*Sin[2 *e - (2*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/(a^2*d^2) - (f*Cos[4*e - ( 4*c*f)/d]*SinIntegral[(4*c*f)/d + 4*f*x])/(a^2*d^2) - (I*f*Sin[4*e - (4*c* f)/d]*SinIntegral[(4*c*f)/d + 4*f*x])/(a^2*d^2)
Int[((c_.) + (d_.)*(x_))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (1/(2*a) + Cos[2*e + 2*f*x]/( 2*a) + Sin[2*e + 2*f*x]/(2*b))^(-n), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0] && ILtQ[m, 0] && ILtQ[n, 0]
Time = 1.05 (sec) , antiderivative size = 193, normalized size of antiderivative = 0.44
method | result | size |
risch | \(-\frac {1}{4 a^{2} d \left (d x +c \right )}+\frac {i f \,{\mathrm e}^{2 i \left (f x +e \right )}}{2 a^{2} d^{2} \left (i f x +\frac {i c f}{d}\right )}+\frac {i f \,{\mathrm e}^{-\frac {2 i \left (c f -d e \right )}{d}} \operatorname {expIntegral}_{1}\left (-2 i f x -2 i e -\frac {2 \left (i c f -i d e \right )}{d}\right )}{a^{2} d^{2}}-\frac {i f \,{\mathrm e}^{4 i \left (f x +e \right )}}{4 a^{2} d^{2} \left (i f x +\frac {i c f}{d}\right )}-\frac {i f \,{\mathrm e}^{-\frac {4 i \left (c f -d e \right )}{d}} \operatorname {expIntegral}_{1}\left (-4 i f x -4 i e -\frac {4 \left (i c f -i d e \right )}{d}\right )}{a^{2} d^{2}}\) | \(193\) |
Input:
int(1/(d*x+c)^2/(a+I*a*cot(f*x+e))^2,x,method=_RETURNVERBOSE)
Output:
-1/4/a^2/d/(d*x+c)+1/2*I/a^2*f/d^2*exp(2*I*(f*x+e))/(I*f*x+I/d*c*f)+I/a^2* f/d^2*exp(-2*I*(c*f-d*e)/d)*Ei(1,-2*I*f*x-2*I*e-2*(I*c*f-I*d*e)/d)-1/4*I/a ^2*f/d^2*exp(4*I*(f*x+e))/(I*f*x+I/d*c*f)-I/a^2*f/d^2*exp(-4*I*(c*f-d*e)/d )*Ei(1,-4*I*f*x-4*I*e-4*(I*c*f-I*d*e)/d)
Time = 0.08 (sec) , antiderivative size = 132, normalized size of antiderivative = 0.30 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=-\frac {4 \, {\left (i \, d f x + i \, c f\right )} {\rm Ei}\left (-\frac {2 \, {\left (-i \, d f x - i \, c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} + 4 \, {\left (-i \, d f x - i \, c f\right )} {\rm Ei}\left (-\frac {4 \, {\left (-i \, d f x - i \, c f\right )}}{d}\right ) e^{\left (-\frac {4 \, {\left (-i \, d e + i \, c f\right )}}{d}\right )} + d e^{\left (4 i \, f x + 4 i \, e\right )} - 2 \, d e^{\left (2 i \, f x + 2 i \, e\right )} + d}{4 \, {\left (a^{2} d^{3} x + a^{2} c d^{2}\right )}} \] Input:
integrate(1/(d*x+c)^2/(a+I*a*cot(f*x+e))^2,x, algorithm="fricas")
Output:
-1/4*(4*(I*d*f*x + I*c*f)*Ei(-2*(-I*d*f*x - I*c*f)/d)*e^(-2*(-I*d*e + I*c* f)/d) + 4*(-I*d*f*x - I*c*f)*Ei(-4*(-I*d*f*x - I*c*f)/d)*e^(-4*(-I*d*e + I *c*f)/d) + d*e^(4*I*f*x + 4*I*e) - 2*d*e^(2*I*f*x + 2*I*e) + d)/(a^2*d^3*x + a^2*c*d^2)
\[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=- \frac {\int \frac {1}{c^{2} \cot ^{2}{\left (e + f x \right )} - 2 i c^{2} \cot {\left (e + f x \right )} - c^{2} + 2 c d x \cot ^{2}{\left (e + f x \right )} - 4 i c d x \cot {\left (e + f x \right )} - 2 c d x + d^{2} x^{2} \cot ^{2}{\left (e + f x \right )} - 2 i d^{2} x^{2} \cot {\left (e + f x \right )} - d^{2} x^{2}}\, dx}{a^{2}} \] Input:
integrate(1/(d*x+c)**2/(a+I*a*cot(f*x+e))**2,x)
Output:
-Integral(1/(c**2*cot(e + f*x)**2 - 2*I*c**2*cot(e + f*x) - c**2 + 2*c*d*x *cot(e + f*x)**2 - 4*I*c*d*x*cot(e + f*x) - 2*c*d*x + d**2*x**2*cot(e + f* x)**2 - 2*I*d**2*x**2*cot(e + f*x) - d**2*x**2), x)/a**2
Time = 0.12 (sec) , antiderivative size = 211, normalized size of antiderivative = 0.49 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=-\frac {f^{2} \cos \left (-\frac {4 \, {\left (d e - c f\right )}}{d}\right ) E_{2}\left (\frac {4 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) - 2 \, f^{2} \cos \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) E_{2}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) + 2 i \, f^{2} E_{2}\left (\frac {2 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) \sin \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) - i \, f^{2} E_{2}\left (\frac {4 \, {\left (-i \, {\left (f x + e\right )} d + i \, d e - i \, c f\right )}}{d}\right ) \sin \left (-\frac {4 \, {\left (d e - c f\right )}}{d}\right ) + f^{2}}{4 \, {\left ({\left (f x + e\right )} a^{2} d^{2} - a^{2} d^{2} e + a^{2} c d f\right )} f} \] Input:
integrate(1/(d*x+c)^2/(a+I*a*cot(f*x+e))^2,x, algorithm="maxima")
Output:
-1/4*(f^2*cos(-4*(d*e - c*f)/d)*exp_integral_e(2, 4*(-I*(f*x + e)*d + I*d* e - I*c*f)/d) - 2*f^2*cos(-2*(d*e - c*f)/d)*exp_integral_e(2, 2*(-I*(f*x + e)*d + I*d*e - I*c*f)/d) + 2*I*f^2*exp_integral_e(2, 2*(-I*(f*x + e)*d + I*d*e - I*c*f)/d)*sin(-2*(d*e - c*f)/d) - I*f^2*exp_integral_e(2, 4*(-I*(f *x + e)*d + I*d*e - I*c*f)/d)*sin(-4*(d*e - c*f)/d) + f^2)/(((f*x + e)*a^2 *d^2 - a^2*d^2*e + a^2*c*d*f)*f)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2249 vs. \(2 (410) = 820\).
Time = 1.05 (sec) , antiderivative size = 2249, normalized size of antiderivative = 5.18 \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=\text {Too large to display} \] Input:
integrate(1/(d*x+c)^2/(a+I*a*cot(f*x+e))^2,x, algorithm="giac")
Output:
1/4*(4*I*d*f*x*cos(e)^4*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d) - 16* d*f*x*cos(e)^3*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d)*sin(e) - 24*I* d*f*x*cos(e)^2*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d)*sin(e)^2 + 16* d*f*x*cos(e)*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d)*sin(e)^3 + 4*I*d *f*x*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d)*sin(e)^4 + 4*d*f*x*cos(e )^4*cos_integral(4*(d*f*x + c*f)/d)*sin(4*c*f/d) + 16*I*d*f*x*cos(e)^3*cos _integral(4*(d*f*x + c*f)/d)*sin(e)*sin(4*c*f/d) - 24*d*f*x*cos(e)^2*cos_i ntegral(4*(d*f*x + c*f)/d)*sin(e)^2*sin(4*c*f/d) - 16*I*d*f*x*cos(e)*cos_i ntegral(4*(d*f*x + c*f)/d)*sin(e)^3*sin(4*c*f/d) + 4*d*f*x*cos_integral(4* (d*f*x + c*f)/d)*sin(e)^4*sin(4*c*f/d) - 4*d*f*x*cos(e)^4*cos(4*c*f/d)*sin _integral(4*(d*f*x + c*f)/d) - 16*I*d*f*x*cos(e)^3*cos(4*c*f/d)*sin(e)*sin _integral(4*(d*f*x + c*f)/d) + 24*d*f*x*cos(e)^2*cos(4*c*f/d)*sin(e)^2*sin _integral(4*(d*f*x + c*f)/d) + 16*I*d*f*x*cos(e)*cos(4*c*f/d)*sin(e)^3*sin _integral(4*(d*f*x + c*f)/d) - 4*d*f*x*cos(4*c*f/d)*sin(e)^4*sin_integral( 4*(d*f*x + c*f)/d) + 4*I*d*f*x*cos(e)^4*sin(4*c*f/d)*sin_integral(4*(d*f*x + c*f)/d) - 16*d*f*x*cos(e)^3*sin(e)*sin(4*c*f/d)*sin_integral(4*(d*f*x + c*f)/d) - 24*I*d*f*x*cos(e)^2*sin(e)^2*sin(4*c*f/d)*sin_integral(4*(d*f*x + c*f)/d) + 16*d*f*x*cos(e)*sin(e)^3*sin(4*c*f/d)*sin_integral(4*(d*f*x + c*f)/d) + 4*I*d*f*x*sin(e)^4*sin(4*c*f/d)*sin_integral(4*(d*f*x + c*f)/d) + 4*I*c*f*cos(e)^4*cos(4*c*f/d)*cos_integral(4*(d*f*x + c*f)/d) - 16*c...
Timed out. \[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=\int \frac {1}{{\left (a+a\,\mathrm {cot}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2\,{\left (c+d\,x\right )}^2} \,d x \] Input:
int(1/((a + a*cot(e + f*x)*1i)^2*(c + d*x)^2),x)
Output:
int(1/((a + a*cot(e + f*x)*1i)^2*(c + d*x)^2), x)
\[ \int \frac {1}{(c+d x)^2 (a+i a \cot (e+f x))^2} \, dx=-\frac {\int \frac {1}{\cot \left (f x +e \right )^{2} c^{2}+2 \cot \left (f x +e \right )^{2} c d x +\cot \left (f x +e \right )^{2} d^{2} x^{2}-2 \cot \left (f x +e \right ) c^{2} i -4 \cot \left (f x +e \right ) c d i x -2 \cot \left (f x +e \right ) d^{2} i \,x^{2}-c^{2}-2 c d x -d^{2} x^{2}}d x}{a^{2}} \] Input:
int(1/(d*x+c)^2/(a+I*a*cot(f*x+e))^2,x)
Output:
( - int(1/(cot(e + f*x)**2*c**2 + 2*cot(e + f*x)**2*c*d*x + cot(e + f*x)** 2*d**2*x**2 - 2*cot(e + f*x)*c**2*i - 4*cot(e + f*x)*c*d*i*x - 2*cot(e + f *x)*d**2*i*x**2 - c**2 - 2*c*d*x - d**2*x**2),x))/a**2