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

Optimal. Leaf size=227 $\frac{i f^2 \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \sin \left (2 e-\frac{2 c f}{d}\right )}{a d^3}-\frac{f^2 \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac{2 c f}{d}\right )}{a d^3}+\frac{f^2 \sin \left (2 e-\frac{2 c f}{d}\right ) \text{Si}\left (2 x f+\frac{2 c f}{d}\right )}{a d^3}+\frac{i f^2 \cos \left (2 e-\frac{2 c f}{d}\right ) \text{Si}\left (2 x f+\frac{2 c f}{d}\right )}{a d^3}+\frac{i f}{d^2 (c+d x) (a+i a \tan (e+f x))}-\frac{i f}{2 a d^2 (c+d x)}-\frac{1}{2 d (c+d x)^2 (a+i a \tan (e+f x))}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.321541, antiderivative size = 227, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 23, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.217, Rules used = {3725, 3724, 3303, 3299, 3302} $\frac{i f^2 \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \sin \left (2 e-\frac{2 c f}{d}\right )}{a d^3}-\frac{f^2 \text{CosIntegral}\left (\frac{2 c f}{d}+2 f x\right ) \cos \left (2 e-\frac{2 c f}{d}\right )}{a d^3}+\frac{f^2 \sin \left (2 e-\frac{2 c f}{d}\right ) \text{Si}\left (2 x f+\frac{2 c f}{d}\right )}{a d^3}+\frac{i f^2 \cos \left (2 e-\frac{2 c f}{d}\right ) \text{Si}\left (2 x f+\frac{2 c f}{d}\right )}{a d^3}+\frac{i f}{d^2 (c+d x) (a+i a \tan (e+f x))}-\frac{i f}{2 a d^2 (c+d x)}-\frac{1}{2 d (c+d x)^2 (a+i a \tan (e+f x))}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3725

Int[((c_.) + (d_.)*(x_))^(m_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(f*(c + d*x)^(m + 2))/
(b*d^2*(m + 1)*(m + 2)), x] + (Dist[(2*b*f)/(a*d*(m + 1)), Int[(c + d*x)^(m + 1)/(a + b*Tan[e + f*x]), x], x]
+ Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + b*Tan[e + f*x])), x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^
2, 0] && LtQ[m, -1] && NeQ[m, -2]

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

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(Sec[e + f*x]*(Cos[(c*f)/d] + I*Sin[(c*f)/d])*(d*(I*d*Cos[e + f*(-(c/d) + x)] + (I*d + 2*c*f + 2*d*f*x)*Cos[e
+ f*(c/d + x)] - d*Sin[e + f*(-(c/d) + x)] + d*Sin[e + f*(c/d + x)] - (2*I)*c*f*Sin[e + f*(c/d + x)] - (2*I)*d
*f*x*Sin[e + f*(c/d + x)]) + 4*f^2*(c + d*x)^2*CosIntegral[(2*f*(c + d*x))/d]*(I*Cos[e - (f*(c + d*x))/d] + Si
n[e - (f*(c + d*x))/d]) + 4*f^2*(c + d*x)^2*(Cos[e - (f*(c + d*x))/d] - I*Sin[e - (f*(c + d*x))/d])*SinIntegra
l[(2*f*(c + d*x))/d]))/(4*a*d^3*(c + d*x)^2*(-I + Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.217, size = 216, normalized size = 1. \begin{align*} -{\frac{1}{4\,ad \left ( dx+c \right ) ^{2}}}+{\frac{{\frac{i}{2}}{f}^{3}{{\rm e}^{-2\,i \left ( fx+e \right ) }}x}{ad \left ({d}^{2}{x}^{2}{f}^{2}+2\,cd{f}^{2}x+{c}^{2}{f}^{2} \right ) }}-{\frac{{f}^{2}{{\rm e}^{-2\,i \left ( fx+e \right ) }}}{4\,ad \left ({d}^{2}{x}^{2}{f}^{2}+2\,cd{f}^{2}x+{c}^{2}{f}^{2} \right ) }}+{\frac{{\frac{i}{2}}{f}^{3}{{\rm e}^{-2\,i \left ( fx+e \right ) }}c}{a{d}^{2} \left ({d}^{2}{x}^{2}{f}^{2}+2\,cd{f}^{2}x+{c}^{2}{f}^{2} \right ) }}+{\frac{{f}^{2}}{a{d}^{3}}{{\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)^3/(a+I*a*tan(f*x+e)),x)

[Out]

-1/4/a/d/(d*x+c)^2+1/2*I/a*f^3*exp(-2*I*(f*x+e))/d/(d^2*f^2*x^2+2*c*d*f^2*x+c^2*f^2)*x-1/4/a*f^2*exp(-2*I*(f*x
+e))/d/(d^2*f^2*x^2+2*c*d*f^2*x+c^2*f^2)+1/2*I/a*f^3*exp(-2*I*(f*x+e))/d^2/(d^2*f^2*x^2+2*c*d*f^2*x+c^2*f^2)*c
+1/a*f^2/d^3*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.56882, size = 211, normalized size = 0.93 \begin{align*} -\frac{2 \, f^{3} \cos \left (-\frac{2 \,{\left (d e - c f\right )}}{d}\right ) E_{3}\left (\frac{2 i \,{\left (f x + e\right )} d - 2 i \, d e + 2 i \, c f}{d}\right ) + 2 i \, f^{3} E_{3}\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 ) + f^{3}}{4 \,{\left ({\left (f x + e\right )}^{2} a d^{3} + a d^{3} e^{2} - 2 \, a c d^{2} e f + a c^{2} d f^{2} - 2 \,{\left (a d^{3} e - a c d^{2} f\right )}{\left (f x + e\right )}\right )} f} \end{align*}

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

[In]

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

[Out]

-1/4*(2*f^3*cos(-2*(d*e - c*f)/d)*exp_integral_e(3, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d) + 2*I*f^3*exp_int
egral_e(3, (2*I*(f*x + e)*d - 2*I*d*e + 2*I*c*f)/d)*sin(-2*(d*e - c*f)/d) + f^3)/(((f*x + e)^2*a*d^3 + a*d^3*e
^2 - 2*a*c*d^2*e*f + a*c^2*d*f^2 - 2*(a*d^3*e - a*c*d^2*f)*(f*x + e))*f)

________________________________________________________________________________________

Fricas [A]  time = 1.6385, size = 300, normalized size = 1.32 \begin{align*} \frac{{\left (2 i \, d^{2} f x + 2 i \, c d f - d^{2} -{\left (4 \,{\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2}\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^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{4 \,{\left (a d^{5} x^{2} + 2 \, a c d^{4} x + a c^{2} d^{3}\right )}} \end{align*}

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

[In]

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

[Out]

1/4*(2*I*d^2*f*x + 2*I*c*d*f - d^2 - (4*(d^2*f^2*x^2 + 2*c*d*f^2*x + c^2*f^2)*Ei((-2*I*d*f*x - 2*I*c*f)/d)*e^(
(-2*I*d*e + 2*I*c*f)/d) + d^2)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/(a*d^5*x^2 + 2*a*c*d^4*x + a*c^2*d^3)

________________________________________________________________________________________

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)**3/(a+I*a*tan(f*x+e)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.20679, size = 732, normalized size = 3.22 \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)^3/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

-(4*d^2*f^2*x^2*cos(2*c*f/d)*cos_integral(-2*(d*f*x + c*f)/d) + 4*I*d^2*f^2*x^2*cos_integral(-2*(d*f*x + c*f)/
d)*sin(2*c*f/d) - 4*I*d^2*f^2*x^2*cos(2*c*f/d)*sin_integral(2*(d*f*x + c*f)/d) + 4*d^2*f^2*x^2*sin(2*c*f/d)*si
n_integral(2*(d*f*x + c*f)/d) + 8*c*d*f^2*x*cos(2*c*f/d)*cos_integral(-2*(d*f*x + c*f)/d) + 8*I*c*d*f^2*x*cos_
integral(-2*(d*f*x + c*f)/d)*sin(2*c*f/d) - 8*I*c*d*f^2*x*cos(2*c*f/d)*sin_integral(2*(d*f*x + c*f)/d) + 8*c*d
*f^2*x*sin(2*c*f/d)*sin_integral(2*(d*f*x + c*f)/d) + 4*c^2*f^2*cos(2*c*f/d)*cos_integral(-2*(d*f*x + c*f)/d)
+ 4*I*c^2*f^2*cos_integral(-2*(d*f*x + c*f)/d)*sin(2*c*f/d) - 4*I*c^2*f^2*cos(2*c*f/d)*sin_integral(2*(d*f*x +
c*f)/d) + 4*c^2*f^2*sin(2*c*f/d)*sin_integral(2*(d*f*x + c*f)/d) - 2*I*d^2*f*x*cos(2*f*x) - 2*d^2*f*x*sin(2*f
*x) - 2*I*c*d*f*cos(2*f*x) - 2*c*d*f*sin(2*f*x) + d^2*cos(2*f*x) + d^2*cos(2*e) - I*d^2*sin(2*f*x) + I*d^2*sin
(2*e))/(4*a*d^5*x^2*cos(2*e) + 4*I*a*d^5*x^2*sin(2*e) + 8*a*c*d^4*x*cos(2*e) + 8*I*a*c*d^4*x*sin(2*e) + 4*a*c^
2*d^3*cos(2*e) + 4*I*a*c^2*d^3*sin(2*e))