\(\int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx\) [22]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [B] (verification not implemented)
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 23, antiderivative size = 168 \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=-\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 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 d^2}-\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 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 d^2}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))} \] Output:

-I*f*cos(-2*e+2*c*f/d)*Ci(2*c*f/d+2*f*x)/a/d^2+f*Ci(2*c*f/d+2*f*x)*sin(-2* 
e+2*c*f/d)/a/d^2-f*cos(-2*e+2*c*f/d)*Si(2*c*f/d+2*f*x)/a/d^2-I*f*sin(-2*e+ 
2*c*f/d)*Si(2*c*f/d+2*f*x)/a/d^2-1/d/(d*x+c)/(a+I*a*tan(f*x+e))
 

Mathematica [A] (verified)

Time = 0.69 (sec) , antiderivative size = 224, normalized size of antiderivative = 1.33 \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=\frac {\sec (e+f x) \left (\cos \left (\frac {c f}{d}\right )+i \sin \left (\frac {c f}{d}\right )\right ) \left (d \left (i \cos \left (e+f \left (-\frac {c}{d}+x\right )\right )+i \cos \left (e+f \left (\frac {c}{d}+x\right )\right )-\sin \left (e+f \left (-\frac {c}{d}+x\right )\right )+\sin \left (e+f \left (\frac {c}{d}+x\right )\right )\right )-2 f (c+d x) \operatorname {CosIntegral}\left (\frac {2 f (c+d x)}{d}\right ) \left (\cos \left (e-\frac {f (c+d x)}{d}\right )-i \sin \left (e-\frac {f (c+d x)}{d}\right )\right )+2 f (c+d x) \left (i \cos \left (e-\frac {f (c+d x)}{d}\right )+\sin \left (e-\frac {f (c+d x)}{d}\right )\right ) \text {Si}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 a d^2 (c+d x) (-i+\tan (e+f x))} \] Input:

Integrate[1/((c + d*x)^2*(a + I*a*Tan[e + f*x])),x]
 

Output:

(Sec[e + f*x]*(Cos[(c*f)/d] + I*Sin[(c*f)/d])*(d*(I*Cos[e + f*(-(c/d) + x) 
] + I*Cos[e + f*(c/d + x)] - Sin[e + f*(-(c/d) + x)] + Sin[e + f*(c/d + x) 
]) - 2*f*(c + d*x)*CosIntegral[(2*f*(c + d*x))/d]*(Cos[e - (f*(c + d*x))/d 
] - I*Sin[e - (f*(c + d*x))/d]) + 2*f*(c + d*x)*(I*Cos[e - (f*(c + d*x))/d 
] + Sin[e - (f*(c + d*x))/d])*SinIntegral[(2*f*(c + d*x))/d]))/(2*a*d^2*(c 
 + d*x)*(-I + Tan[e + f*x]))
 

Rubi [A] (verified)

Time = 0.76 (sec) , antiderivative size = 167, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 4207, 3042, 3784, 3042, 3780, 3783}

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 \tan (e+f x))} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))}dx\)

\(\Big \downarrow \) 4207

\(\displaystyle -\frac {f \int \frac {\sin (2 e+2 f x)}{c+d x}dx}{a d}-\frac {i f \int \frac {\cos (2 e+2 f x)}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {f \int \frac {\sin (2 e+2 f x)}{c+d x}dx}{a d}-\frac {i f \int \frac {\sin \left (2 e+2 f x+\frac {\pi }{2}\right )}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

\(\Big \downarrow \) 3784

\(\displaystyle -\frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cos \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx+\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cos \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx-\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx-\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

\(\Big \downarrow \) 3780

\(\displaystyle -\frac {i f \left (\cos \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx-\frac {\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {f \left (\sin \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 x f+\frac {2 c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\frac {\cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

\(\Big \downarrow \) 3783

\(\displaystyle -\frac {f \left (\frac {\operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \sin \left (2 e-\frac {2 c f}{d}\right )}{d}+\frac {\cos \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {i f \left (\frac {\operatorname {CosIntegral}\left (2 x f+\frac {2 c f}{d}\right ) \cos \left (2 e-\frac {2 c f}{d}\right )}{d}-\frac {\sin \left (2 e-\frac {2 c f}{d}\right ) \text {Si}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{a d}-\frac {1}{d (c+d x) (a+i a \tan (e+f x))}\)

Input:

Int[1/((c + d*x)^2*(a + I*a*Tan[e + f*x])),x]
 

Output:

-((f*((CosIntegral[(2*c*f)/d + 2*f*x]*Sin[2*e - (2*c*f)/d])/d + (Cos[2*e - 
 (2*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/d))/(a*d)) - (I*f*((Cos[2*e - 
(2*c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*x])/d - (Sin[2*e - (2*c*f)/d]*SinIn 
tegral[(2*c*f)/d + 2*f*x])/d))/(a*d) - 1/(d*(c + d*x)*(a + I*a*Tan[e + f*x 
]))
 

Defintions of rubi rules used

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3780
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinInte 
gral[e + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*e - c*f, 0]
 

rule 3783
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosInte 
gral[e - Pi/2 + f*x]/d, x] /; FreeQ[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - 
c*f, 0]
 

rule 3784
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[Cos[(d* 
e - c*f)/d]   Int[Sin[c*(f/d) + f*x]/(c + d*x), x], x] + Simp[Sin[(d*e - c* 
f)/d]   Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f}, x] 
&& NeQ[d*e - c*f, 0]
 

rule 4207
Int[1/(((c_.) + (d_.)*(x_))^2*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])), x_Sy 
mbol] :> -Simp[(d*(c + d*x)*(a + b*Tan[e + f*x]))^(-1), x] + (-Simp[f/(a*d) 
   Int[Sin[2*e + 2*f*x]/(c + d*x), x], x] + Simp[f/(b*d)   Int[Cos[2*e + 2* 
f*x]/(c + d*x), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0 
]
 
Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.57

method result size
risch \(-\frac {1}{2 d a \left (d x +c \right )}-\frac {f \,{\mathrm e}^{-2 i \left (f x +e \right )}}{2 a \left (d f x +c f \right ) d}+\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 i \left (c f -d e \right )}{d}\right )}{a \,d^{2}}\) \(96\)

Input:

int(1/(d*x+c)^2/(a+I*a*tan(f*x+e)),x,method=_RETURNVERBOSE)
 

Output:

-1/2/d/a/(d*x+c)-1/2/a*f*exp(-2*I*(f*x+e))/(d*f*x+c*f)/d+I/a*f/d^2*exp(2*I 
*(c*f-d*e)/d)*Ei(1,2*I*f*x+2*I*e+2*I*(c*f-d*e)/d)
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.49 \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=-\frac {{\left ({\left (2 \, {\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 )} + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, {\left (a d^{3} x + a c d^{2}\right )}} \] Input:

integrate(1/(d*x+c)^2/(a+I*a*tan(f*x+e)),x, algorithm="fricas")
 

Output:

-1/2*((2*(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) + d)*e^(2*I*f*x + 2*I*e) + d)*e^(-2*I*f*x - 2*I*e)/(a*d^3*x + a*c*d^2 
)
 

Sympy [F]

\[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=- \frac {i \int \frac {1}{c^{2} \tan {\left (e + f x \right )} - i c^{2} + 2 c d x \tan {\left (e + f x \right )} - 2 i c d x + d^{2} x^{2} \tan {\left (e + f x \right )} - i d^{2} x^{2}}\, dx}{a} \] Input:

integrate(1/(d*x+c)**2/(a+I*a*tan(f*x+e)),x)
 

Output:

-I*Integral(1/(c**2*tan(e + f*x) - I*c**2 + 2*c*d*x*tan(e + f*x) - 2*I*c*d 
*x + d**2*x**2*tan(e + f*x) - I*d**2*x**2), x)/a
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 119, normalized size of antiderivative = 0.71 \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=-\frac {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 ) + 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 ) + f^{2}}{2 \, {\left ({\left (f x + e\right )} a d^{2} - a d^{2} e + a c d f\right )} f} \] Input:

integrate(1/(d*x+c)^2/(a+I*a*tan(f*x+e)),x, algorithm="maxima")
 

Output:

-1/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) + 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) + f^2)/(((f*x + e)*a*d^2 - a*d^2*e + a*c*d*f)* 
f)
 

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1013 vs. \(2 (161) = 322\).

Time = 2.13 (sec) , antiderivative size = 1013, normalized size of antiderivative = 6.03 \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=\text {Too large to display} \] Input:

integrate(1/(d*x+c)^2/(a+I*a*tan(f*x+e)),x, algorithm="giac")
 

Output:

1/2*(-2*I*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*cos(-2*(d*e - 
c*f)/d)*cos_integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d* 
e + c*f)/d) + 2*I*d*e*f^2*cos(-2*(d*e - c*f)/d)*cos_integral(2*((d*x + c)* 
(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) - 2*I*c*f^3*cos(-2*(d* 
e - c*f)/d)*cos_integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) 
- d*e + c*f)/d) + 2*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*cos_ 
integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d)* 
sin(-2*(d*e - c*f)/d) - 2*d*e*f^2*cos_integral(2*((d*x + c)*(d*e/(d*x + c) 
 - c*f/(d*x + c) + f) - d*e + c*f)/d)*sin(-2*(d*e - c*f)/d) + 2*c*f^3*cos_ 
integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d)* 
sin(-2*(d*e - c*f)/d) - 2*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^ 
2*cos(-2*(d*e - c*f)/d)*sin_integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d* 
x + c) + f) - d*e + c*f)/d) + 2*d*e*f^2*cos(-2*(d*e - c*f)/d)*sin_integral 
(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d) - 2*c*f^ 
3*cos(-2*(d*e - c*f)/d)*sin_integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d* 
x + c) + f) - d*e + c*f)/d) - 2*I*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) 
 + f)*f^2*sin(-2*(d*e - c*f)/d)*sin_integral(2*((d*x + c)*(d*e/(d*x + c) - 
 c*f/(d*x + c) + f) - d*e + c*f)/d) + 2*I*d*e*f^2*sin(-2*(d*e - c*f)/d)*si 
n_integral(2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d 
) - 2*I*c*f^3*sin(-2*(d*e - c*f)/d)*sin_integral(2*((d*x + c)*(d*e/(d*x...
 

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=\int \frac {1}{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,{\left (c+d\,x\right )}^2} \,d x \] Input:

int(1/((a + a*tan(e + f*x)*1i)*(c + d*x)^2),x)
 

Output:

int(1/((a + a*tan(e + f*x)*1i)*(c + d*x)^2), x)
 

Reduce [F]

\[ \int \frac {1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx=\frac {\int \frac {1}{\tan \left (f x +e \right ) c^{2} i +2 \tan \left (f x +e \right ) c d i x +\tan \left (f x +e \right ) d^{2} i \,x^{2}+c^{2}+2 c d x +d^{2} x^{2}}d x}{a} \] Input:

int(1/(d*x+c)^2/(a+I*a*tan(f*x+e)),x)
 

Output:

int(1/(tan(e + f*x)*c**2*i + 2*tan(e + f*x)*c*d*i*x + tan(e + f*x)*d**2*i* 
x**2 + c**2 + 2*c*d*x + d**2*x**2),x)/a