3.1.62 \(\int \csc (2 x) (1-\tan (x)) \, dx\) [62]

Optimal. Leaf size=14 \[ \frac {1}{2} \log (\tan (x))-\frac {\tan (x)}{2} \]

[Out]

1/2*ln(tan(x))-1/2*tan(x)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {12} \begin {gather*} \frac {1}{2} \log (\tan (x))-\frac {\tan (x)}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[2*x]*(1 - Tan[x]),x]

[Out]

Log[Tan[x]]/2 - Tan[x]/2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rubi steps

\begin {align*} \int \csc (2 x) (1-\tan (x)) \, dx &=\text {Subst}\left (\int \frac {1}{2} \left (-1+\frac {1}{x}\right ) \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \text {Subst}\left (\int \left (-1+\frac {1}{x}\right ) \, dx,x,\tan (x)\right )\\ &=\frac {1}{2} \log (\tan (x))-\frac {\tan (x)}{2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 21, normalized size = 1.50 \begin {gather*} -\frac {1}{2} \log (\cos (x))+\frac {1}{2} \log (\sin (x))-\frac {\tan (x)}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[2*x]*(1 - Tan[x]),x]

[Out]

-1/2*Log[Cos[x]] + Log[Sin[x]]/2 - Tan[x]/2

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 11, normalized size = 0.79

method result size
default \(\frac {\ln \left (\tan \left (x \right )\right )}{2}-\frac {\tan \left (x \right )}{2}\) \(11\)
norman \(\frac {\ln \left (\tan \left (x \right )\right )}{2}-\frac {\tan \left (x \right )}{2}\) \(11\)
risch \(-\frac {i}{{\mathrm e}^{2 i x}+1}-\frac {\ln \left ({\mathrm e}^{2 i x}+1\right )}{2}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{2}\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1-tan(x))/sin(2*x),x,method=_RETURNVERBOSE)

[Out]

1/2*ln(tan(x))-1/2*tan(x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (10) = 20\).
time = 2.32, size = 47, normalized size = 3.36 \begin {gather*} -\frac {\sin \left (2 \, x\right )}{\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1} - \frac {1}{4} \, \log \left (\cos \left (2 \, x\right ) + 1\right ) + \frac {1}{4} \, \log \left (\cos \left (2 \, x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-tan(x))/sin(2*x),x, algorithm="maxima")

[Out]

-sin(2*x)/(cos(2*x)^2 + sin(2*x)^2 + 2*cos(2*x) + 1) - 1/4*log(cos(2*x) + 1) + 1/4*log(cos(2*x) - 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 32 vs. \(2 (10) = 20\).
time = 0.97, size = 32, normalized size = 2.29 \begin {gather*} \frac {1}{4} \, \log \left (\frac {\tan \left (x\right )^{2}}{\tan \left (x\right )^{2} + 1}\right ) - \frac {1}{4} \, \log \left (\frac {1}{\tan \left (x\right )^{2} + 1}\right ) - \frac {1}{2} \, \tan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-tan(x))/sin(2*x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (10) = 20\).
time = 0.69, size = 27, normalized size = 1.93 \begin {gather*} \frac {\log {\left (\cos {\left (2 x \right )} - 1 \right )}}{4} - \frac {\log {\left (\cos {\left (2 x \right )} + 1 \right )}}{4} - \frac {\sin {\left (x \right )}}{2 \cos {\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-tan(x))/sin(2*x),x)

[Out]

log(cos(2*x) - 1)/4 - log(cos(2*x) + 1)/4 - sin(x)/(2*cos(x))

________________________________________________________________________________________

Giac [A]
time = 0.95, size = 11, normalized size = 0.79 \begin {gather*} \frac {1}{2} \, \log \left ({\left | \tan \left (x\right ) \right |}\right ) - \frac {1}{2} \, \tan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1-tan(x))/sin(2*x),x, algorithm="giac")

[Out]

1/2*log(abs(tan(x))) - 1/2*tan(x)

________________________________________________________________________________________

Mupad [B]
time = 0.21, size = 10, normalized size = 0.71 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (x\right )\right )}{2}-\frac {\mathrm {tan}\left (x\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(tan(x) - 1)/sin(2*x),x)

[Out]

log(tan(x))/2 - tan(x)/2

________________________________________________________________________________________