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

Optimal. Leaf size=151 $\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{x (c+d x)}{4 a^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}$

[Out]

(((-3*I)/16)*d*x)/(a^2*f) - (d*x^2)/(8*a^2) + (x*(c + d*x))/(4*a^2) + d/(16*f^2*(a + I*a*Tan[e + f*x])^2) + ((
I/4)*(c + d*x))/(f*(a + I*a*Tan[e + f*x])^2) + (3*d)/(16*f^2*(a^2 + I*a^2*Tan[e + f*x])) + ((I/4)*(c + d*x))/(
f*(a^2 + I*a^2*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.141943, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 3, integrand size = 21, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.143, Rules used = {3479, 8, 3730} $\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{x (c+d x)}{4 a^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(((-3*I)/16)*d*x)/(a^2*f) - (d*x^2)/(8*a^2) + (x*(c + d*x))/(4*a^2) + d/(16*f^2*(a + I*a*Tan[e + f*x])^2) + ((
I/4)*(c + d*x))/(f*(a + I*a*Tan[e + f*x])^2) + (3*d)/(16*f^2*(a^2 + I*a^2*Tan[e + f*x])) + ((I/4)*(c + d*x))/(
f*(a^2 + I*a^2*Tan[e + f*x]))

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3730

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> With[{u = IntHide[(a
+ b*Tan[e + f*x])^n, x]}, Dist[(c + d*x)^m, u, x] - Dist[d*m, Int[Dist[(c + d*x)^(m - 1), u, x], x], x]] /; Fr
eeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0] && ILtQ[n, -1] && GtQ[m, 0]

Rubi steps

\begin{align*} \int \frac{c+d x}{(a+i a \tan (e+f x))^2} \, dx &=\frac{x (c+d x)}{4 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-d \int \left (\frac{x}{4 a^2}+\frac{i}{4 f (a+i a \tan (e+f x))^2}+\frac{i}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\right ) \, dx\\ &=-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int \frac{1}{(a+i a \tan (e+f x))^2} \, dx}{4 f}-\frac{(i d) \int \frac{1}{a^2+i a^2 \tan (e+f x)} \, dx}{4 f}\\ &=-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{d}{8 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int 1 \, dx}{8 a^2 f}-\frac{(i d) \int \frac{1}{a+i a \tan (e+f x)} \, dx}{8 a f}\\ &=-\frac{i d x}{8 a^2 f}-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}-\frac{(i d) \int 1 \, dx}{16 a^2 f}\\ &=-\frac{3 i d x}{16 a^2 f}-\frac{d x^2}{8 a^2}+\frac{x (c+d x)}{4 a^2}+\frac{d}{16 f^2 (a+i a \tan (e+f x))^2}+\frac{i (c+d x)}{4 f (a+i a \tan (e+f x))^2}+\frac{3 d}{16 f^2 \left (a^2+i a^2 \tan (e+f x)\right )}+\frac{i (c+d x)}{4 f \left (a^2+i a^2 \tan (e+f x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.462507, size = 130, normalized size = 0.86 $-\frac{\sec ^2(e+f x) \left (\left (4 c f (1+4 i f x)+d \left (8 i f^2 x^2+4 f x-i\right )\right ) \sin (2 (e+f x))+\left (4 c f (4 f x+i)+d \left (8 f^2 x^2+4 i f x+1\right )\right ) \cos (2 (e+f x))+8 (2 i c f+2 i d f x+d)\right )}{64 a^2 f^2 (\tan (e+f x)-i)^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(Sec[e + f*x]^2*(8*(d + (2*I)*c*f + (2*I)*d*f*x) + (4*c*f*(I + 4*f*x) + d*(1 + (4*I)*f*x + 8*f^2*x^2))*Cos[2*
(e + f*x)] + (4*c*f*(1 + (4*I)*f*x) + d*(-I + 4*f*x + (8*I)*f^2*x^2))*Sin[2*(e + f*x)]))/(64*a^2*f^2*(-I + Tan
[e + f*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.22, size = 82, normalized size = 0.5 \begin{align*}{\frac{d{x}^{2}}{8\,{a}^{2}}}+{\frac{cx}{4\,{a}^{2}}}+{\frac{{\frac{i}{8}} \left ( 2\,dfx-id+2\,cf \right ){{\rm e}^{-2\,i \left ( fx+e \right ) }}}{{a}^{2}{f}^{2}}}+{\frac{{\frac{i}{64}} \left ( 4\,dfx-id+4\,cf \right ){{\rm e}^{-4\,i \left ( fx+e \right ) }}}{{a}^{2}{f}^{2}}} \end{align*}

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

[In]

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

[Out]

1/8*d*x^2/a^2+1/4/a^2*c*x+1/8*I*(2*d*f*x-I*d+2*c*f)/a^2/f^2*exp(-2*I*(f*x+e))+1/64*I*(4*d*f*x-I*d+4*c*f)/a^2/f
^2*exp(-4*I*(f*x+e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

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

[In]

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

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.58873, size = 220, normalized size = 1.46 \begin{align*} \frac{{\left (4 i \, d f x + 4 i \, c f + 8 \,{\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (16 i \, d f x + 16 i \, c f + 8 \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end{align*}

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

[In]

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

[Out]

1/64*(4*I*d*f*x + 4*I*c*f + 8*(d*f^2*x^2 + 2*c*f^2*x)*e^(4*I*f*x + 4*I*e) + (16*I*d*f*x + 16*I*c*f + 8*d)*e^(2
*I*f*x + 2*I*e) + d)*e^(-4*I*f*x - 4*I*e)/(a^2*f^2)

________________________________________________________________________________________

Sympy [A]  time = 0.764843, size = 228, normalized size = 1.51 \begin{align*} \begin{cases} \frac{\left (\left (32 i a^{6} c f^{5} e^{8 i e} + 32 i a^{6} d f^{5} x e^{8 i e} + 8 a^{6} d f^{4} e^{8 i e}\right ) e^{- 4 i f x} + \left (128 i a^{6} c f^{5} e^{10 i e} + 128 i a^{6} d f^{5} x e^{10 i e} + 64 a^{6} d f^{4} e^{10 i e}\right ) e^{- 2 i f x}\right ) e^{- 12 i e}}{512 a^{8} f^{6}} & \text{for}\: 512 a^{8} f^{6} e^{12 i e} \neq 0 \\\frac{x^{2} \left (2 d e^{2 i e} + d\right ) e^{- 4 i e}}{8 a^{2}} + \frac{x \left (2 c e^{2 i e} + c\right ) e^{- 4 i e}}{4 a^{2}} & \text{otherwise} \end{cases} + \frac{c x}{4 a^{2}} + \frac{d x^{2}}{8 a^{2}} \end{align*}

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

[In]

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

[Out]

Piecewise((((32*I*a**6*c*f**5*exp(8*I*e) + 32*I*a**6*d*f**5*x*exp(8*I*e) + 8*a**6*d*f**4*exp(8*I*e))*exp(-4*I*
f*x) + (128*I*a**6*c*f**5*exp(10*I*e) + 128*I*a**6*d*f**5*x*exp(10*I*e) + 64*a**6*d*f**4*exp(10*I*e))*exp(-2*I
*f*x))*exp(-12*I*e)/(512*a**8*f**6), Ne(512*a**8*f**6*exp(12*I*e), 0)), (x**2*(2*d*exp(2*I*e) + d)*exp(-4*I*e)
/(8*a**2) + x*(2*c*exp(2*I*e) + c)*exp(-4*I*e)/(4*a**2), True)) + c*x/(4*a**2) + d*x**2/(8*a**2)

________________________________________________________________________________________

Giac [A]  time = 1.16078, size = 144, normalized size = 0.95 \begin{align*} \frac{{\left (8 \, d f^{2} x^{2} e^{\left (4 i \, f x + 4 i \, e\right )} + 16 \, c f^{2} x e^{\left (4 i \, f x + 4 i \, e\right )} + 16 i \, d f x e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d f x + 16 i \, c f e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, c f + 8 \, d e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} f^{2}} \end{align*}

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

[In]

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

[Out]

1/64*(8*d*f^2*x^2*e^(4*I*f*x + 4*I*e) + 16*c*f^2*x*e^(4*I*f*x + 4*I*e) + 16*I*d*f*x*e^(2*I*f*x + 2*I*e) + 4*I*
d*f*x + 16*I*c*f*e^(2*I*f*x + 2*I*e) + 4*I*c*f + 8*d*e^(2*I*f*x + 2*I*e) + d)*e^(-4*I*f*x - 4*I*e)/(a^2*f^2)