\(\int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx\) [444]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 11, antiderivative size = 22 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\frac {x}{2}-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.36, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3216, 3203, 31} \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\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) \]

[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 31

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

Rule 3203

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 3216

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]

Rubi steps \begin{align*} \text {integral}& = \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))-\text {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] (verified)

Time = 0.08 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\frac {x}{2}-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \]

[In]

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

[Out]

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

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.54 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.91

method result size
risch \(\frac {x}{2}+\frac {i x}{2}-\ln \left (i+{\mathrm e}^{i x}\right )\) \(20\)
default \(\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )}{2}+\arctan \left (\tan \left (\frac {x}{2}\right )\right )-\ln \left (\tan \left (\frac {x}{2}\right )+1\right )\) \(27\)
parallelrisch \(\frac {x}{2}-\ln \left (-\frac {\left (-\csc \left (x \right )+\cot \left (x \right )-1\right ) \sqrt {2}}{2}\right )+\ln \left (\sqrt {\frac {1}{\cos \left (x \right )+1}}\right )\) \(30\)
norman \(\frac {\frac {x}{2}+\frac {x \tan \left (\frac {x}{2}\right )^{2}}{2}}{1+\tan \left (\frac {x}{2}\right )^{2}}-\ln \left (\tan \left (\frac {x}{2}\right )+1\right )+\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )}{2}\) \(46\)

[In]

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

[Out]

1/2*x+1/2*I*x-ln(I+exp(I*x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.50 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\frac {1}{2} \, x - \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\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} \]

[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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (16) = 32\).

Time = 0.30 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.86 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\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 ) \]

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

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.14 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=\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 ) \]

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

Mupad [B] (verification not implemented)

Time = 26.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.55 \[ \int \frac {\sin (x)}{1+\cos (x)+\sin (x)} \, dx=-\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )+\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}\right )\,\left (\frac {1}{2}-\frac {1}{2}{}\mathrm {i}\right )+\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1{}\mathrm {i}\right )\,\left (\frac {1}{2}+\frac {1}{2}{}\mathrm {i}\right ) \]

[In]

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

[Out]

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