3.2.10 \(\int \cot (a+b x) \, dx\) [110]

Optimal. Leaf size=11 \[ \frac {\log (\sin (a+b x))}{b} \]

[Out]

ln(sin(b*x+a))/b

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3556} \begin {gather*} \frac {\log (\sin (a+b x))}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[a + b*x],x]

[Out]

Log[Sin[a + b*x]]/b

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \cot (a+b x) \, dx &=\frac {\log (\sin (a+b x))}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 19, normalized size = 1.73 \begin {gather*} \frac {\log (\cos (a+b x))+\log (\tan (a+b x))}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[a + b*x],x]

[Out]

(Log[Cos[a + b*x]] + Log[Tan[a + b*x]])/b

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
time = 2.71, size = 37, normalized size = 3.36 \begin {gather*} \text {Piecewise}\left [\left \{\left \{\frac {\text {Log}\left [\text {Tan}\left [a+b x\right ]\right ]-\frac {\text {Log}\left [1+\text {Tan}\left [a+b x\right ]^2\right ]}{2}}{b},b\text {!=}0\right \}\right \},\frac {x}{\text {Tan}\left [a\right ]}\right ] \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[1/Tan[a+b*x],x]')

[Out]

Piecewise[{{(Log[Tan[a + b x]] - Log[1 + Tan[a + b x] ^ 2] / 2) / b, b != 0}}, x / Tan[a]]

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(25\) vs. \(2(11)=22\).
time = 0.01, size = 26, normalized size = 2.36

method result size
derivativedivides \(\frac {-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2}+\ln \left (\tan \left (b x +a \right )\right )}{b}\) \(26\)
default \(\frac {-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2}+\ln \left (\tan \left (b x +a \right )\right )}{b}\) \(26\)
norman \(\frac {\ln \left (\tan \left (b x +a \right )\right )}{b}-\frac {\ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2 b}\) \(29\)
risch \(-i x -\frac {2 i a}{b}+\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}{b}\) \(29\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/tan(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*(-1/2*ln(1+tan(b*x+a)^2)+ln(tan(b*x+a)))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 11, normalized size = 1.00 \begin {gather*} \frac {\log \left (\sin \left (b x + a\right )\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/tan(b*x+a),x, algorithm="maxima")

[Out]

log(sin(b*x + a))/b

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (11) = 22\).
time = 0.32, size = 27, normalized size = 2.45 \begin {gather*} \frac {\log \left (\frac {\tan \left (b x + a\right )^{2}}{\tan \left (b x + a\right )^{2} + 1}\right )}{2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/tan(b*x+a),x, algorithm="fricas")

[Out]

1/2*log(tan(b*x + a)^2/(tan(b*x + a)^2 + 1))/b

________________________________________________________________________________________

Sympy [A]
time = 0.17, size = 29, normalized size = 2.64 \begin {gather*} \begin {cases} - \frac {\log {\left (\tan ^{2}{\left (a + b x \right )} + 1 \right )}}{2 b} + \frac {\log {\left (\tan {\left (a + b x \right )} \right )}}{b} & \text {for}\: b \neq 0 \\\frac {x}{\tan {\left (a \right )}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/tan(b*x+a),x)

[Out]

Piecewise((-log(tan(a + b*x)**2 + 1)/(2*b) + log(tan(a + b*x))/b, Ne(b, 0)), (x/tan(a), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (11) = 22\).
time = 0.01, size = 57, normalized size = 5.18 \begin {gather*} \frac {2 \left (\frac {\ln \left (\frac {\left |1-\cos \left (a+b x\right )\right |}{\left |1+\cos \left (a+b x\right )\right |}\right )}{4}-\frac {\ln \left |\frac {1-\cos \left (a+b x\right )}{1+\cos \left (a+b x\right )}+1\right |}{2}\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/tan(b*x+a),x)

[Out]

1/2*(log(abs(-cos(b*x + a) + 1)/abs(cos(b*x + a) + 1)) - 2*log(abs(-(cos(b*x + a) - 1)/(cos(b*x + a) + 1) + 1)
))/b

________________________________________________________________________________________

Mupad [B]
time = 0.19, size = 28, normalized size = 2.55 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (a+b\,x\right )\right )}{b}-\frac {\ln \left ({\mathrm {tan}\left (a+b\,x\right )}^2+1\right )}{2\,b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/tan(a + b*x),x)

[Out]

log(tan(a + b*x))/b - log(tan(a + b*x)^2 + 1)/(2*b)

________________________________________________________________________________________