Optimal. Leaf size=55 \[ -\frac {\tan (c+d x)}{a^2 d}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}+\frac {2 x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3088, 848, 77} \[ -\frac {\tan (c+d x)}{a^2 d}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}+\frac {2 x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 848
Rule 3088
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^2} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {1+x^2}{x^2 (i a+a x)^2} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {-\frac {i}{a}+\frac {x}{a}}{x^2 (i a+a x)} \, dx,x,\cot (c+d x)\right )}{d}\\ &=-\frac {\operatorname {Subst}\left (\int \left (-\frac {1}{a^2 x^2}-\frac {2 i}{a^2 x}+\frac {2 i}{a^2 (i+x)}\right ) \, dx,x,\cot (c+d x)\right )}{d}\\ &=\frac {2 x}{a^2}+\frac {2 i \log (\sin (c+d x))}{a^2 d}-\frac {2 i \log (\tan (c+d x))}{a^2 d}-\frac {\tan (c+d x)}{a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.42, size = 71, normalized size = 1.29 \[ \frac {4 \tan ^{-1}(\tan (d x))+i \sec (c) \sec (c+d x) \left (\cos (d x) \log \left (\cos ^2(c+d x)\right )+\cos (2 c+d x) \log \left (\cos ^2(c+d x)\right )+2 i \sin (d x)\right )}{2 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.59, size = 68, normalized size = 1.24 \[ \frac {4 \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, d x + {\left (2 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 2 i\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i}{a^{2} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 2.93, size = 100, normalized size = 1.82 \[ \frac {2 \, {\left (\frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{2}} - \frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}{a^{2}} + \frac {i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{2}} + \frac {-i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}}\right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 35, normalized size = 0.64 \[ -\frac {2 i \ln \left (\tan \left (d x +c \right )-i\right )}{a^{2} d}-\frac {\tan \left (d x +c \right )}{a^{2} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 30, normalized size = 0.55 \[ \frac {-\frac {2 i \, \log \left (\tan \left (d x + c\right ) - i\right )}{a^{2}} - \frac {\tan \left (d x + c\right )}{a^{2}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.78, size = 83, normalized size = 1.51 \[ \frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^2\right )}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,4{}\mathrm {i}}{a^2\,d}+\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,2{}\mathrm {i}}{a^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\sec ^{2}{\left (c + d x \right )}}{- \sin ^{2}{\left (c + d x \right )} + 2 i \sin {\left (c + d x \right )} \cos {\left (c + d x \right )} + \cos ^{2}{\left (c + d x \right )}}\, dx}{a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________