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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 6, normalized size of antiderivative = 1.00, 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.03, size = 6, normalized size = 1.00 \[ \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]]

________________________________________________________________________________________

fricas [A]  time = 0.82, size = 11, normalized size = 1.83 \[ \frac {1}{2} \, \log \left (2 \, \cos \relax (x) \sin \relax (x) + 1\right ) \]

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)

________________________________________________________________________________________

giac [B]  time = 0.18, size = 16, normalized size = 2.67 \[ -\frac {1}{2} \, \log \left (\tan \relax (x)^{2} + 1\right ) + \log \left ({\left | \tan \relax (x) + 1 \right |}\right ) \]

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

________________________________________________________________________________________

maple [A]  time = 0.06, size = 7, normalized size = 1.17 \[ \ln \left (\cos \relax (x )+\sin \relax (x )\right ) \]

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.31, size = 6, normalized size = 1.00 \[ \log \left (\cos \relax (x) + \sin \relax (x)\right ) \]

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

________________________________________________________________________________________

mupad [B]  time = 2.92, size = 32, normalized size = 5.33 \[ 2\,\mathrm {atanh}\left (\frac {128\,\mathrm {tan}\left (\frac {x}{2}\right )+128}{16\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+32\,\mathrm {tan}\left (\frac {x}{2}\right )+48}-3\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*atanh((128*tan(x/2) + 128)/(32*tan(x/2) + 16*tan(x/2)^2 + 48) - 3)

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 7, normalized size = 1.17 \[ \log {\left (\sin {\relax (x )} + \cos {\relax (x )} \right )} \]

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

________________________________________________________________________________________