3.1.41 \(\int \frac {\sin (x)}{1+\sin (x)} \, dx\) [41]

Optimal. Leaf size=11 \[ x+\frac {\cos (x)}{1+\sin (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2814, 2727} \begin {gather*} x+\frac {\cos (x)}{\sin (x)+1} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2727

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

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rubi steps

\begin {align*} \int \frac {\sin (x)}{1+\sin (x)} \, dx &=x-\int \frac {1}{1+\sin (x)} \, dx\\ &=x+\frac {\cos (x)}{1+\sin (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(25\) vs. \(2(11)=22\).
time = 0.03, size = 25, normalized size = 2.27 \begin {gather*} x-\frac {2 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

x - (2*Sin[x/2])/(Cos[x/2] + Sin[x/2])

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 19, normalized size = 1.73

method result size
risch \(x +\frac {2}{{\mathrm e}^{i x}+i}\) \(15\)
default \(2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )+\frac {2}{1+\tan \left (\frac {x}{2}\right )}\) \(19\)
norman \(\frac {x +x \tan \left (\frac {x}{2}\right )+x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+2 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \left (1+\tan \left (\frac {x}{2}\right )\right )}\) \(53\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*arctan(tan(1/2*x))+2/(1+tan(1/2*x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 28 vs. \(2 (11) = 22\).
time = 2.97, size = 28, normalized size = 2.55 \begin {gather*} \frac {2}{\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} + 2 \, \arctan \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2/(sin(x)/(cos(x) + 1) + 1) + 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 24 vs. \(2 (11) = 22\).
time = 0.49, size = 24, normalized size = 2.18 \begin {gather*} \frac {{\left (x + 1\right )} \cos \left (x\right ) + {\left (x - 1\right )} \sin \left (x\right ) + x + 1}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (8) = 16\).
time = 0.23, size = 29, normalized size = 2.64 \begin {gather*} \frac {x \tan {\left (\frac {x}{2} \right )}}{\tan {\left (\frac {x}{2} \right )} + 1} + \frac {x}{\tan {\left (\frac {x}{2} \right )} + 1} + \frac {2}{\tan {\left (\frac {x}{2} \right )} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 1.30, size = 12, normalized size = 1.09 \begin {gather*} x + \frac {2}{\tan \left (\frac {1}{2} \, x\right ) + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.24, size = 12, normalized size = 1.09 \begin {gather*} x+\frac {2}{\mathrm {tan}\left (\frac {x}{2}\right )+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x + 2/(tan(x/2) + 1)

________________________________________________________________________________________