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

Optimal. Leaf size=168 $-\frac{f \text{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{i f \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac{2 c f}{d}\right )}{a 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 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 d^2}-\frac{1}{d (c+d x) (a+i a \tan (e+f x))}$

[Out]

((-I)*f*Cos[2*e - (2*c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) - (f*CosIntegral[(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]*SinIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) + (I*f*Sin[2*e - (2
*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) - 1/(d*(c + d*x)*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.239729, antiderivative size = 168, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 23, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.174, Rules used = {3724, 3303, 3299, 3302} $-\frac{f \text{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{i f \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac{2 c f}{d}\right )}{a 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 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 d^2}-\frac{1}{d (c+d x) (a+i a \tan (e+f x))}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((-I)*f*Cos[2*e - (2*c*f)/d]*CosIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) - (f*CosIntegral[(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]*SinIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) + (I*f*Sin[2*e - (2
*c*f)/d]*SinIntegral[(2*c*f)/d + 2*f*x])/(a*d^2) - 1/(d*(c + d*x)*(a + I*a*Tan[e + f*x]))

Rule 3724

Int[1/(((c_.) + (d_.)*(x_))^2*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> -Simp[(d*(c + d*x)*(a + b*
Tan[e + f*x]))^(-1), x] + (-Dist[f/(a*d), Int[Sin[2*e + 2*f*x]/(c + d*x), x], x] + Dist[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]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[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 3299

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

Rule 3302

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

Rubi steps

\begin{align*} \int \frac{1}{(c+d x)^2 (a+i a \tan (e+f x))} \, dx &=-\frac{1}{d (c+d x) (a+i a \tan (e+f x))}-\frac{(i f) \int \frac{\cos (2 e+2 f x)}{c+d x} \, dx}{a d}-\frac{f \int \frac{\sin (2 e+2 f x)}{c+d x} \, dx}{a d}\\ &=-\frac{1}{d (c+d x) (a+i a \tan (e+f x))}-\frac{\left (i f \cos \left (2 e-\frac{2 c f}{d}\right )\right ) \int \frac{\cos \left (\frac{2 c f}{d}+2 f x\right )}{c+d x} \, dx}{a d}-\frac{\left (f \cos \left (2 e-\frac{2 c f}{d}\right )\right ) \int \frac{\sin \left (\frac{2 c f}{d}+2 f x\right )}{c+d x} \, dx}{a d}+\frac{\left (i f \sin \left (2 e-\frac{2 c f}{d}\right )\right ) \int \frac{\sin \left (\frac{2 c f}{d}+2 f x\right )}{c+d x} \, dx}{a d}-\frac{\left (f \sin \left (2 e-\frac{2 c f}{d}\right )\right ) \int \frac{\cos \left (\frac{2 c f}{d}+2 f x\right )}{c+d x} \, dx}{a d}\\ &=-\frac{i f \cos \left (2 e-\frac{2 c f}{d}\right ) \text{Ci}\left (\frac{2 c f}{d}+2 f x\right )}{a d^2}-\frac{f \text{Ci}\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))}\\ \end{align*}

Mathematica [A]  time = 0.766762, size = 224, normalized size = 1.33 $\frac{\sec (e+f x) \left (\cos \left (\frac{c f}{d}\right )+i \sin \left (\frac{c f}{d}\right )\right ) \left (-2 f (c+d x) \text{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) \text{Si}\left (\frac{2 f (c+d x)}{d}\right ) \left (\sin \left (e-\frac{f (c+d x)}{d}\right )+i \cos \left (e-\frac{f (c+d x)}{d}\right )\right )+d \left (-\sin \left (f \left (x-\frac{c}{d}\right )+e\right )+\sin \left (f \left (\frac{c}{d}+x\right )+e\right )+i \cos \left (f \left (x-\frac{c}{d}\right )+e\right )+i \cos \left (f \left (\frac{c}{d}+x\right )+e\right )\right )\right )}{2 a d^2 (c+d x) (\tan (e+f x)-i)}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(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])*SinI
ntegral[(2*f*(c + d*x))/d]))/(2*a*d^2*(c + d*x)*(-I + Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.171, size = 96, normalized size = 0.6 \begin{align*} -{\frac{1}{2\,ad \left ( dx+c \right ) }}-{\frac{f{{\rm e}^{-2\,i \left ( fx+e \right ) }}}{2\,a \left ( dfx+cf \right ) d}}+{\frac{if}{a{d}^{2}}{{\rm e}^{{\frac{2\,i \left ( cf-de \right ) }{d}}}}{\it Ei} \left ( 1,2\,ifx+2\,ie+{\frac{2\,i \left ( cf-de \right ) }{d}} \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-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)

________________________________________________________________________________________

Maxima [A]  time = 1.31302, size = 162, normalized size = 0.96 \begin{align*} -\frac{8 \, f^{2} \cos \left (-\frac{2 \,{\left (d e - c f\right )}}{d}\right ) E_{2}\left (\frac{2 i \,{\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) + 8 i \, f^{2} E_{2}\left (\frac{2 i \,{\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) \sin \left (-\frac{2 \,{\left (d e - c f\right )}}{d}\right ) + 8 \, f^{2}}{16 \,{\left ({\left (f x + e\right )} a d^{2} - a d^{2} e + a c d f\right )} f} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/16*(8*f^2*cos(-2*(d*e - c*f)/d)*exp_integral_e(2, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d) + 8*I*f^2*exp_in
tegral_e(2, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d)*sin(-2*(d*e - c*f)/d) + 8*f^2)/(((f*x + e)*a*d^2 - a*d^2*
e + a*c*d*f)*f)

________________________________________________________________________________________

Fricas [A]  time = 1.8012, size = 212, normalized size = 1.26 \begin{align*} \frac{{\left ({\left ({\left (-2 i \, d f x - 2 i \, c f\right )}{\rm Ei}\left (\frac{-2 i \, d f x - 2 i \, c f}{d}\right ) e^{\left (\frac{-2 i \, d e + 2 i \, c f}{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 )}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(((-2*I*d*f*x - 2*I*c*f)*Ei((-2*I*d*f*x - 2*I*c*f)/d)*e^((-2*I*d*e + 2*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(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.44177, size = 797, normalized size = 4.74 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(-2*I*d*f*x*cos(2*c*f/d)*cos(2*e)*cos_integral(-2*(d*f*x + c*f)/d) + 2*d*f*x*cos(2*e)*cos_integral(-2*(d*f
*x + c*f)/d)*sin(2*c*f/d) - 2*d*f*x*cos(2*c*f/d)*cos_integral(-2*(d*f*x + c*f)/d)*sin(2*e) - 2*I*d*f*x*cos_int
egral(-2*(d*f*x + c*f)/d)*sin(2*c*f/d)*sin(2*e) - 2*d*f*x*cos(2*c*f/d)*cos(2*e)*sin_integral(2*(d*f*x + c*f)/d
) - 2*I*d*f*x*cos(2*e)*sin(2*c*f/d)*sin_integral(2*(d*f*x + c*f)/d) + 2*I*d*f*x*cos(2*c*f/d)*sin(2*e)*sin_inte
gral(2*(d*f*x + c*f)/d) - 2*d*f*x*sin(2*c*f/d)*sin(2*e)*sin_integral(2*(d*f*x + c*f)/d) - 2*I*c*f*cos(2*c*f/d)
*cos(2*e)*cos_integral(-2*(d*f*x + c*f)/d) + 2*c*f*cos(2*e)*cos_integral(-2*(d*f*x + c*f)/d)*sin(2*c*f/d) - 2*
c*f*cos(2*c*f/d)*cos_integral(-2*(d*f*x + c*f)/d)*sin(2*e) - 2*I*c*f*cos_integral(-2*(d*f*x + c*f)/d)*sin(2*c*
f/d)*sin(2*e) - 2*c*f*cos(2*c*f/d)*cos(2*e)*sin_integral(2*(d*f*x + c*f)/d) - 2*I*c*f*cos(2*e)*sin(2*c*f/d)*si
n_integral(2*(d*f*x + c*f)/d) + 2*I*c*f*cos(2*c*f/d)*sin(2*e)*sin_integral(2*(d*f*x + c*f)/d) - 2*c*f*sin(2*c*
f/d)*sin(2*e)*sin_integral(2*(d*f*x + c*f)/d) - d*cos(2*f*x)*cos(2*e) + I*d*cos(2*e)*sin(2*f*x) + I*d*cos(2*f*
x)*sin(2*e) + d*sin(2*f*x)*sin(2*e))/((d^3*x + c*d^2)*a) - 1/2/((d*x + c)*a*d)