3.202 \(\int \frac {1-\sin ^2(x)}{1+\sin ^2(x)} \, dx\)

Optimal. Leaf size=36 \[ \sqrt {2} x-x+\sqrt {2} \tan ^{-1}\left (\frac {\sin (x) \cos (x)}{\sin ^2(x)+\sqrt {2}+1}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3171, 3181, 203} \[ \sqrt {2} x-x+\sqrt {2} \tan ^{-1}\left (\frac {\sin (x) \cos (x)}{\sin ^2(x)+\sqrt {2}+1}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-x + Sqrt[2]*x + Sqrt[2]*ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Sin[x]^2)]

Rule 203

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

Rule 3171

Int[((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]^2)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(B*x
)/b, x] + Dist[(A*b - a*B)/b, Int[1/(a + b*Sin[e + f*x]^2), x], x] /; FreeQ[{a, b, e, f, A, B}, x]

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 24, normalized size = 0.67 \[ -2 \left (\frac {x}{2}-\frac {\tan ^{-1}\left (\sqrt {2} \tan (x)\right )}{\sqrt {2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.65, size = 35, normalized size = 0.97 \[ -\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \relax (x)^{2} - 2 \, \sqrt {2}}{4 \, \cos \relax (x) \sin \relax (x)}\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sqrt(2)*arctan(1/4*(3*sqrt(2)*cos(x)^2 - 2*sqrt(2))/(cos(x)*sin(x))) - x

________________________________________________________________________________________

giac [A]  time = 0.13, size = 49, normalized size = 1.36 \[ \sqrt {2} {\left (x + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt {2} \cos \left (2 \, x\right ) + \sqrt {2} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )} - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*(x + arctan(-(sqrt(2)*sin(2*x) - 2*sin(2*x))/(sqrt(2)*cos(2*x) + sqrt(2) - 2*cos(2*x) + 2))) - x

________________________________________________________________________________________

maple [A]  time = 0.08, size = 16, normalized size = 0.44 \[ \sqrt {2}\, \arctan \left (\sqrt {2}\, \tan \relax (x )\right )-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2^(1/2)*arctan(2^(1/2)*tan(x))-x

________________________________________________________________________________________

maxima [A]  time = 0.55, size = 15, normalized size = 0.42 \[ \sqrt {2} \arctan \left (\sqrt {2} \tan \relax (x)\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*arctan(sqrt(2)*tan(x)) - x

________________________________________________________________________________________

mupad [B]  time = 2.32, size = 26, normalized size = 0.72 \[ \sqrt {2}\,\left (x-\mathrm {atan}\left (\mathrm {tan}\relax (x)\right )\right )-x+\sqrt {2}\,\mathrm {atan}\left (\sqrt {2}\,\mathrm {tan}\relax (x)\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [B]  time = 48.46, size = 248, normalized size = 6.89 \[ - \frac {22619537 x}{15994428 \sqrt {2} + 22619537} - \frac {15994428 \sqrt {2} x}{15994428 \sqrt {2} + 22619537} + \frac {54608393 \sqrt {2} \sqrt {3 - 2 \sqrt {2}} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {3 - 2 \sqrt {2}}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{15994428 \sqrt {2} + 22619537} + \frac {77227930 \sqrt {3 - 2 \sqrt {2}} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {3 - 2 \sqrt {2}}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{15994428 \sqrt {2} + 22619537} + \frac {9369319 \sqrt {2} \sqrt {2 \sqrt {2} + 3} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {2 \sqrt {2} + 3}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{15994428 \sqrt {2} + 22619537} + \frac {13250218 \sqrt {2 \sqrt {2} + 3} \left (\operatorname {atan}{\left (\frac {\tan {\left (\frac {x}{2} \right )}}{\sqrt {2 \sqrt {2} + 3}} \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{15994428 \sqrt {2} + 22619537} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-22619537*x/(15994428*sqrt(2) + 22619537) - 15994428*sqrt(2)*x/(15994428*sqrt(2) + 22619537) + 54608393*sqrt(2
)*sqrt(3 - 2*sqrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/(15994428*sqrt(2) + 226
19537) + 77227930*sqrt(3 - 2*sqrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/(159944
28*sqrt(2) + 22619537) + 9369319*sqrt(2)*sqrt(2*sqrt(2) + 3)*(atan(tan(x/2)/sqrt(2*sqrt(2) + 3)) + pi*floor((x
/2 - pi/2)/pi))/(15994428*sqrt(2) + 22619537) + 13250218*sqrt(2*sqrt(2) + 3)*(atan(tan(x/2)/sqrt(2*sqrt(2) + 3
)) + pi*floor((x/2 - pi/2)/pi))/(15994428*sqrt(2) + 22619537)

________________________________________________________________________________________