3.444 \(\int \frac{\sin (x)}{1+\cos (x)+\sin (x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0306626, antiderivative size = 30, normalized size of antiderivative = 1.36, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {3137, 3124, 31} \[ \frac{x}{2}-\frac{1}{2} \log \left (\tan \left (\frac{x}{2}\right )+1\right )-\frac{1}{2} \log (\sin (x)+\cos (x)+1) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3137

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

Rule 3124

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2], x]}, Dist[(2*f)/e, Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d +
e*x)/2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{\sin (x)}{1+\cos (x)+\sin (x)} \, dx &=\frac{x}{2}-\frac{1}{2} \log (1+\cos (x)+\sin (x))-\frac{1}{2} \int \frac{1}{1+\cos (x)+\sin (x)} \, dx\\ &=\frac{x}{2}-\frac{1}{2} \log (1+\cos (x)+\sin (x))-\operatorname{Subst}\left (\int \frac{1}{2+2 x} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=\frac{x}{2}-\frac{1}{2} \log (1+\cos (x)+\sin (x))-\frac{1}{2} \log \left (1+\tan \left (\frac{x}{2}\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.047012, size = 22, normalized size = 1. \[ \frac{x}{2}-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 25, normalized size = 1.1 \begin{align*} -\ln \left ( 1+\tan \left ({\frac{x}{2}} \right ) \right ) +{\frac{1}{2}\ln \left ( 1+ \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2} \right ) }+{\frac{x}{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.48185, size = 55, normalized size = 2.5 \begin{align*} \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) - \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) + \frac{1}{2} \, \log \left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.31174, size = 22, normalized size = 1. \begin{align*} \frac{x}{2} - \log{\left (\tan{\left (\frac{x}{2} \right )} + 1 \right )} + \frac{\log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.1655, size = 34, normalized size = 1.55 \begin{align*} \frac{1}{2} \, x + \frac{1}{2} \, \log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right ) - \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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