3.62 \(\int \csc (2 x) (1-\tan (x)) \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0339943, antiderivative size = 14, normalized size of antiderivative = 1., 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} \[ \frac{1}{2} \log (\tan (x))-\frac{\tan (x)}{2} \]

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 &=\operatorname{Subst}\left (\int \frac{1}{2} \left (-1+\frac{1}{x}\right ) \, dx,x,\tan (x)\right )\\ &=\frac{1}{2} \operatorname{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.0148639, size = 21, normalized size = 1.5 \[ -\frac{\tan (x)}{2}+\frac{1}{2} \log (\sin (x))-\frac{1}{2} \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.047, size = 11, normalized size = 0.8 \begin{align*}{\frac{\ln \left ( \tan \left ( x \right ) \right ) }{2}}-{\frac{\tan \left ( x \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 0.953807, size = 63, normalized size = 4.5 \begin{align*} -\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{align*}

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]  time = 2.04071, size = 101, normalized size = 7.21 \begin{align*} \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{align*}

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]  time = 1.64234, size = 27, normalized size = 1.93 \begin{align*} \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{align*}

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 = 1.07706, size = 15, normalized size = 1.07 \begin{align*} \frac{1}{2} \, \log \left ({\left | \tan \left (x\right ) \right |}\right ) - \frac{1}{2} \, \tan \left (x\right ) \end{align*}

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)