3.263 \(\int \frac{-\cos (x)+\sin (x)}{\cos (x)+\sin (x)} \, dx\)

Optimal. Leaf size=8 \[ -\log (\sin (x)+\cos (x)) \]

[Out]

-Log[Cos[x] + Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0225275, antiderivative size = 8, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.067, Rules used = {3133} \[ -\log (\sin (x)+\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[(-Cos[x] + Sin[x])/(Cos[x] + Sin[x]),x]

[Out]

-Log[Cos[x] + Sin[x]]

Rule 3133

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_)]*(
b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[((b*B + c*C)*x)/(b^2 + c^2), x] + Simp[((c*B - b*C)*L
og[a + b*Cos[d + e*x] + c*Sin[d + e*x]])/(e*(b^2 + c^2)), x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2
+ c^2, 0] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rubi steps

\begin{align*} \int \frac{-\cos (x)+\sin (x)}{\cos (x)+\sin (x)} \, dx &=-\log (\cos (x)+\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.0233293, size = 8, normalized size = 1. \[ -\log (\sin (x)+\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[(-Cos[x] + Sin[x])/(Cos[x] + Sin[x]),x]

[Out]

-Log[Cos[x] + Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 9, normalized size = 1.1 \begin{align*} -\ln \left ( \cos \left ( x \right ) +\sin \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-cos(x)+sin(x))/(cos(x)+sin(x)),x)

[Out]

-ln(cos(x)+sin(x))

________________________________________________________________________________________

Maxima [A]  time = 0.953654, size = 11, normalized size = 1.38 \begin{align*} -\log \left (\cos \left (x\right ) + \sin \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sin(x))/(cos(x)+sin(x)),x, algorithm="maxima")

[Out]

-log(cos(x) + sin(x))

________________________________________________________________________________________

Fricas [A]  time = 2.05828, size = 42, normalized size = 5.25 \begin{align*} -\frac{1}{2} \, \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sin(x))/(cos(x)+sin(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.129102, size = 8, normalized size = 1. \begin{align*} - \log{\left (\sin{\left (x \right )} + \cos{\left (x \right )} \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sin(x))/(cos(x)+sin(x)),x)

[Out]

-log(sin(x) + cos(x))

________________________________________________________________________________________

Giac [B]  time = 1.08499, size = 24, normalized size = 3. \begin{align*} \frac{1}{2} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(x)+sin(x))/(cos(x)+sin(x)),x, algorithm="giac")

[Out]

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