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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0225762, antiderivative size = 6, 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.0262814, size = 6, 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.022, size = 7, normalized size = 1.2 \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.989582, size = 8, normalized size = 1.33 \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 = 1.88883, size = 41, normalized size = 6.83 \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.138288, size = 7, normalized size = 1.17 \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.14849, size = 22, normalized size = 3.67 \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))