3.1.68 \(\int \frac {\sin (x)}{\cos (x)+\sin (x)} \, dx\) [68]

Optimal. Leaf size=16 \[ \frac {x}{2}-\frac {1}{2} \log (\cos (x)+\sin (x)) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3176, 3212} \begin {gather*} \frac {x}{2}-\frac {1}{2} \log (\sin (x)+\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3176

Int[sin[(c_.) + (d_.)*(x_)]/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Simp
[b*(x/(a^2 + b^2)), x] - Dist[a/(a^2 + b^2), Int[(b*Cos[c + d*x] - a*Sin[c + d*x])/(a*Cos[c + d*x] + b*Sin[c +
 d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3212

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 {\sin (x)}{\cos (x)+\sin (x)} \, dx &=\frac {x}{2}-\frac {1}{2} \int \frac {\cos (x)-\sin (x)}{\cos (x)+\sin (x)} \, dx\\ &=\frac {x}{2}-\frac {1}{2} \log (\cos (x)+\sin (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 16, normalized size = 1.00 \begin {gather*} \frac {x}{2}-\frac {1}{2} \log (\cos (x)+\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 23, normalized size = 1.44

method result size
risch \(\frac {x}{2}+\frac {i x}{2}-\frac {\ln \left ({\mathrm e}^{2 i x}+i\right )}{2}\) \(20\)
default \(-\frac {\ln \left (\tan \left (x \right )+1\right )}{2}+\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{4}+\frac {\arctan \left (\tan \left (x \right )\right )}{2}\) \(23\)
norman \(\frac {\frac {x}{2}+\frac {x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}}{1+\tan ^{2}\left (\frac {x}{2}\right )}+\frac {\ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-\frac {\ln \left (\tan ^{2}\left (\frac {x}{2}\right )-2 \tan \left (\frac {x}{2}\right )-1\right )}{2}\) \(54\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(cos(x)+sin(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*ln(tan(x)+1)+1/4*ln(1+tan(x)^2)+1/2*arctan(tan(x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (12) = 24\).
time = 1.30, size = 53, normalized size = 3.31 \begin {gather*} \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) - \frac {1}{2} \, \log \left (-\frac {2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1\right ) + \frac {1}{2} \, \log \left (\frac {\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.92, size = 15, normalized size = 0.94 \begin {gather*} \frac {1}{2} \, x - \frac {1}{4} \, \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 12, normalized size = 0.75 \begin {gather*} \frac {x}{2} - \frac {\log {\left (\sin {\left (x \right )} + \cos {\left (x \right )} \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.46, size = 21, normalized size = 1.31 \begin {gather*} \frac {1}{2} \, x + \frac {1}{4} \, \log \left (\tan \left (x\right )^{2} + 1\right ) - \frac {1}{2} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 13, normalized size = 0.81 \begin {gather*} \frac {x}{2}-\frac {\ln \left (\cos \left (x-\frac {\pi }{4}\right )\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x/2 - log(cos(x - pi/4))/2

________________________________________________________________________________________