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

Optimal. Leaf size=84 $\frac{i (c+d x)}{2 f (a+i a \tan (e+f x))}+\frac{(c+d x)^2}{4 a d}+\frac{d}{4 f^2 (a+i a \tan (e+f x))}-\frac{i d x}{4 a f}$

[Out]

((-I/4)*d*x)/(a*f) + (c + d*x)^2/(4*a*d) + d/(4*f^2*(a + I*a*Tan[e + f*x])) + ((I/2)*(c + d*x))/(f*(a + I*a*Ta
n[e + f*x]))

________________________________________________________________________________________

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((-I/4)*d*x)/(a*f) + (c + d*x)^2/(4*a*d) + d/(4*f^2*(a + I*a*Tan[e + f*x])) + ((I/2)*(c + d*x))/(f*(a + I*a*Ta
n[e + f*x]))

Rule 3723

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

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]

Rubi steps

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

Mathematica [A]  time = 0.357973, size = 96, normalized size = 1.14 $\frac{\left (2 c f (2 f x-i)+d \left (2 f^2 x^2-2 i f x-1\right )\right ) \tan (e+f x)-i \left (2 c f (2 f x+i)+d \left (2 f^2 x^2+2 i f x+1\right )\right )}{8 a f^2 (\tan (e+f x)-i)}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.145, size = 139, normalized size = 1.7 \begin{align*}{\frac{1}{1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2}} \left ({\frac{d{x}^{2}}{4\,a}}+{\frac{2\,icf+d}{4\,a{f}^{2}}}+{\frac{d{x}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{4\,a}}+{\frac{ \left ( -id+2\,cf \right ) \tan \left ( fx+e \right ) }{4\,a{f}^{2}}}+{\frac{ \left ( id+2\,cf \right ) x}{4\,af}}+{\frac{dx\tan \left ( fx+e \right ) }{2\,af}}+{\frac{ \left ( -id+2\,cf \right ) x \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{4\,af}} \right ) } \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)),x)

[Out]

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

________________________________________________________________________________________

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)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.53055, size = 146, normalized size = 1.74 \begin{align*} \frac{{\left (2 i \, d f x + 2 i \, c f + 2 \,{\left (d f^{2} x^{2} + 2 \, c f^{2} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + d\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a 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)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.405821, size = 128, normalized size = 1.52 \begin{align*} \begin{cases} \frac{\left (2 i a c f^{2} e^{2 i e} + 2 i a d f^{2} x e^{2 i e} + a d f e^{2 i e}\right ) e^{- 4 i e} e^{- 2 i f x}}{8 a^{2} f^{3}} & \text{for}\: 8 a^{2} f^{3} e^{4 i e} \neq 0 \\\frac{c x e^{- 2 i e}}{2 a} + \frac{d x^{2} e^{- 2 i e}}{4 a} & \text{otherwise} \end{cases} + \frac{c x}{2 a} + \frac{d x^{2}}{4 a} \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)),x)

[Out]

Piecewise(((2*I*a*c*f**2*exp(2*I*e) + 2*I*a*d*f**2*x*exp(2*I*e) + a*d*f*exp(2*I*e))*exp(-4*I*e)*exp(-2*I*f*x)/
(8*a**2*f**3), Ne(8*a**2*f**3*exp(4*I*e), 0)), (c*x*exp(-2*I*e)/(2*a) + d*x**2*exp(-2*I*e)/(4*a), True)) + c*x
/(2*a) + d*x**2/(4*a)

________________________________________________________________________________________

Giac [A]  time = 1.22761, size = 88, normalized size = 1.05 \begin{align*} \frac{{\left (2 \, d f^{2} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 \, c f^{2} x e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i \, d f x + 2 i \, c f + d\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{8 \, a 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)),x, algorithm="giac")

[Out]

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