3.490 \(\int \frac{1}{\cot ^2(x)+\csc ^2(x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0310605, antiderivative size = 37, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {1130, 203} \[ \sqrt{2} x-x-\sqrt{2} \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right ) \]

Antiderivative was successfully verified.

[In]

Int[(Cot[x]^2 + Csc[x]^2)^(-1),x]

[Out]

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

Rule 1130

Int[((d_.)*(x_))^(m_)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[(
d^2*(b/q + 1))/2, Int[(d*x)^(m - 2)/(b/2 + q/2 + c*x^2), x], x] - Dist[(d^2*(b/q - 1))/2, Int[(d*x)^(m - 2)/(b
/2 - q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[b^2 - 4*a*c, 0] && GeQ[m, 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])

Rubi steps

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

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

Antiderivative was successfully verified.

[In]

Integrate[(Cot[x]^2 + Csc[x]^2)^(-1),x]

[Out]

-x + Sqrt[2]*ArcTan[Tan[x]/Sqrt[2]]

________________________________________________________________________________________

Maple [A]  time = 0.077, size = 17, normalized size = 0.5 \begin{align*} \sqrt{2}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{2}}{2}} \right ) -x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cot(x)^2+csc(x)^2),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.48216, size = 22, normalized size = 0.59 \begin{align*} \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} \tan \left (x\right )\right ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.89927, size = 104, normalized size = 2.81 \begin{align*} -\frac{1}{2} \, \sqrt{2} \arctan \left (\frac{3 \, \sqrt{2} \cos \left (x\right )^{2} - \sqrt{2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{1}{\cot ^{2}{\left (x \right )} + \csc ^{2}{\left (x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cot(x)**2+csc(x)**2),x)

[Out]

Integral(1/(cot(x)**2 + csc(x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.13108, size = 66, normalized size = 1.78 \begin{align*} \sqrt{2}{\left (x + \arctan \left (-\frac{\sqrt{2} \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )}{\sqrt{2} \cos \left (2 \, x\right ) + \sqrt{2} - \cos \left (2 \, x\right ) + 1}\right )\right )} - x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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