3.1.37 \(\int \frac {\sin (x)}{1+\sin ^2(x)} \, dx\) [37]

Optimal. Leaf size=16 \[ -\frac {\tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2}}\right )}{\sqrt {2}} \]

[Out]

-1/2*arctanh(1/2*cos(x)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3265, 212} \begin {gather*} -\frac {\tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2}}\right )}{\sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-(ArcTanh[Cos[x]/Sqrt[2]]/Sqrt[2])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3265

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x], x, Cos
[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\sin (x)}{1+\sin ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{2-x^2} \, dx,x,\cos (x)\right )\\ &=-\frac {\tanh ^{-1}\left (\frac {\cos (x)}{\sqrt {2}}\right )}{\sqrt {2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.04, size = 46, normalized size = 2.88 \begin {gather*} -\frac {i \left (\tan ^{-1}\left (\frac {-i+\tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right )-\tan ^{-1}\left (\frac {i+\tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right )\right )}{\sqrt {2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((-I)*(ArcTan[(-I + Tan[x/2])/Sqrt[2]] - ArcTan[(I + Tan[x/2])/Sqrt[2]]))/Sqrt[2]

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 14, normalized size = 0.88

method result size
default \(-\frac {\arctanh \left (\frac {\cos \left (x \right ) \sqrt {2}}{2}\right ) \sqrt {2}}{2}\) \(14\)
risch \(\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}\, {\mathrm e}^{i x}+1\right )}{4}\) \(48\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*arctanh(1/2*cos(x)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 3.95, size = 24, normalized size = 1.50 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \cos \left (x\right )}{\sqrt {2} + \cos \left (x\right )}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (13) = 26\).
time = 0.42, size = 29, normalized size = 1.81 \begin {gather*} \frac {1}{4} \, \sqrt {2} \log \left (-\frac {\cos \left (x\right )^{2} - 2 \, \sqrt {2} \cos \left (x\right ) + 2}{\cos \left (x\right )^{2} - 2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 46 vs. \(2 (19) = 38\).
time = 8.70, size = 46, normalized size = 2.88 \begin {gather*} \frac {\sqrt {2} \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} - 2 \sqrt {2} + 3 \right )}}{4} - \frac {\sqrt {2} \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 2 \sqrt {2} + 3 \right )}}{4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*log(tan(x/2)**2 - 2*sqrt(2) + 3)/4 - sqrt(2)*log(tan(x/2)**2 + 2*sqrt(2) + 3)/4

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (13) = 26\).
time = 0.49, size = 27, normalized size = 1.69 \begin {gather*} -\frac {1}{4} \, \sqrt {2} \log \left (\sqrt {2} + \cos \left (x\right )\right ) + \frac {1}{4} \, \sqrt {2} \log \left (\sqrt {2} - \cos \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.21, size = 13, normalized size = 0.81 \begin {gather*} -\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\cos \left (x\right )}{2}\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(2^(1/2)*atanh((2^(1/2)*cos(x))/2))/2

________________________________________________________________________________________