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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 14 \[ \int \csc (2 x) (1-\tan (x)) \, dx=\frac {1}{2} \log (\tan (x))-\frac {\tan (x)}{2} \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {12} \[ \int \csc (2 x) (1-\tan (x)) \, dx=\frac {1}{2} \log (\tan (x))-\frac {\tan (x)}{2} \]

[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*} \text {integral}& = \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] (verified)

Time = 0.06 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.50 \[ \int \csc (2 x) (1-\tan (x)) \, dx=-\frac {1}{2} \log (\cos (x))+\frac {1}{2} \log (\sin (x))-\frac {\tan (x)}{2} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.79

method result size
derivativedivides \(\frac {\ln \left (\tan \left (x \right )\right )}{2}-\frac {\tan \left (x \right )}{2}\) \(11\)
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\)
parallelrisch \(\ln \left (\sqrt {\tan }\left (x \right )\right )-\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\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 32 vs. \(2 (10) = 20\).

Time = 0.25 (sec) , antiderivative size = 32, normalized size of antiderivative = 2.29 \[ \int \csc (2 x) (1-\tan (x)) \, dx=\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 ) \]

[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] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (10) = 20\).

Time = 0.50 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.93 \[ \int \csc (2 x) (1-\tan (x)) \, dx=\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 )}} \]

[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))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (10) = 20\).

Time = 0.22 (sec) , antiderivative size = 47, normalized size of antiderivative = 3.36 \[ \int \csc (2 x) (1-\tan (x)) \, dx=-\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 ) \]

[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)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.79 \[ \int \csc (2 x) (1-\tan (x)) \, dx=\frac {1}{2} \, \log \left ({\left | \tan \left (x\right ) \right |}\right ) - \frac {1}{2} \, \tan \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.71 \[ \int \csc (2 x) (1-\tan (x)) \, dx=\frac {\ln \left (\mathrm {tan}\left (x\right )\right )}{2}-\frac {\mathrm {tan}\left (x\right )}{2} \]

[In]

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

[Out]

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