Optimal. Leaf size=94 \[ -\frac {b^2 \log (a+b \sec (c+d x))}{a d \left (a^2-b^2\right )}+\frac {\log (1-\sec (c+d x))}{2 d (a+b)}+\frac {\log (\sec (c+d x)+1)}{2 d (a-b)}+\frac {\log (\cos (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 94, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3885, 894} \[ -\frac {b^2 \log (a+b \sec (c+d x))}{a d \left (a^2-b^2\right )}+\frac {\log (1-\sec (c+d x))}{2 d (a+b)}+\frac {\log (\sec (c+d x)+1)}{2 d (a-b)}+\frac {\log (\cos (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 894
Rule 3885
Rubi steps
\begin {align*} \int \frac {\cot (c+d x)}{a+b \sec (c+d x)} \, dx &=-\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{x (a+x) \left (b^2-x^2\right )} \, dx,x,b \sec (c+d x)\right )}{d}\\ &=-\frac {b^2 \operatorname {Subst}\left (\int \left (\frac {1}{2 b^2 (a+b) (b-x)}+\frac {1}{a b^2 x}+\frac {1}{a (a-b) (a+b) (a+x)}-\frac {1}{2 (a-b) b^2 (b+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{d}\\ &=\frac {\log (\cos (c+d x))}{a d}+\frac {\log (1-\sec (c+d x))}{2 (a+b) d}+\frac {\log (1+\sec (c+d x))}{2 (a-b) d}-\frac {b^2 \log (a+b \sec (c+d x))}{a \left (a^2-b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 70, normalized size = 0.74 \[ \frac {b^2 (-\log (a \cos (c+d x)+b))+a (a-b) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+a (a+b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{a d (a-b) (a+b)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.52, size = 75, normalized size = 0.80 \[ -\frac {2 \, b^{2} \log \left (a \cos \left (d x + c\right ) + b\right ) - {\left (a^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (a^{2} - a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.31, size = 257, normalized size = 2.73 \[ -\frac {\frac {a \log \left ({\left | -a - b + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} \right |}\right )}{a^{2} - b^{2}} - \frac {{\left (a^{2} - 2 \, b^{2}\right )} \log \left (\frac {{\left | -2 \, b - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - 2 \, {\left | a \right |} \right |}}{{\left | -2 \, b - \frac {2 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {2 \, b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + 2 \, {\left | a \right |} \right |}}\right )}{{\left (a^{2} - b^{2}\right )} {\left | a \right |}} - \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a + b}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.71, size = 80, normalized size = 0.85 \[ -\frac {b^{2} \ln \left (b +a \cos \left (d x +c \right )\right )}{d \left (a +b \right ) \left (a -b \right ) a}+\frac {\ln \left (-1+\cos \left (d x +c \right )\right )}{d \left (2 a +2 b \right )}+\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{d \left (2 a -2 b \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.50, size = 68, normalized size = 0.72 \[ -\frac {\frac {2 \, b^{2} \log \left (a \cos \left (d x + c\right ) + b\right )}{a^{3} - a b^{2}} - \frac {\log \left (\cos \left (d x + c\right ) + 1\right )}{a - b} - \frac {\log \left (\cos \left (d x + c\right ) - 1\right )}{a + b}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.75, size = 93, normalized size = 0.99 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d\,\left (a+b\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a\,d}+\frac {b^2\,\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d\,\left (a\,b^2-a^3\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cot {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________