3.493 \(\int \frac {x^2}{(x \cos (x)-\sin (x))^2} \, dx\)

Optimal. Leaf size=20 \[ \frac {x \csc (x)}{x \cos (x)-\sin (x)}-\cot (x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4594, 3767, 8} \[ \frac {x \csc (x)}{x \cos (x)-\sin (x)}-\cot (x) \]

Antiderivative was successfully verified.

[In]

Int[x^2/(x*Cos[x] - Sin[x])^2,x]

[Out]

-Cot[x] + (x*Csc[x])/(x*Cos[x] - Sin[x])

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4594

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.24, size = 19, normalized size = 0.95 \[ \frac {x \sin (x)+\cos (x)}{x \cos (x)-\sin (x)} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2/(x*Cos[x] - Sin[x])^2,x]

[Out]

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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {x^2}{(x \cos (x)-\sin (x))^2} \, dx \]

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[x^2/(x*Cos[x] - Sin[x])^2,x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.15, size = 19, normalized size = 0.95 \[ \frac {x \sin \relax (x) + \cos \relax (x)}{x \cos \relax (x) - \sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x*cos(x)-sin(x))^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.63, size = 39, normalized size = 1.95 \[ -\frac {2 \, x \tan \left (\frac {1}{2} \, x\right ) - \tan \left (\frac {1}{2} \, x\right )^{2} + 1}{x \tan \left (\frac {1}{2} \, x\right )^{2} - x + 2 \, \tan \left (\frac {1}{2} \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x*cos(x)-sin(x))^2,x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.25, size = 29, normalized size = 1.45




method result size



risch \(\frac {2 i \left (x -i\right )}{i {\mathrm e}^{2 i x}+x \,{\mathrm e}^{2 i x}-i+x}\) \(29\)
norman \(\frac {-1+\tan ^{2}\left (\frac {x}{2}\right )-2 x \tan \left (\frac {x}{2}\right )}{x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-x +2 \tan \left (\frac {x}{2}\right )}\) \(37\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(x*cos(x)-sin(x))^2,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.70, size = 69, normalized size = 3.45 \[ \frac {2 \, {\left (2 \, x \cos \left (2 \, x\right ) + {\left (x^{2} - 1\right )} \sin \left (2 \, x\right )\right )}}{{\left (x^{2} + 1\right )} \cos \left (2 \, x\right )^{2} + {\left (x^{2} + 1\right )} \sin \left (2 \, x\right )^{2} + x^{2} + 2 \, {\left (x^{2} - 1\right )} \cos \left (2 \, x\right ) - 4 \, x \sin \left (2 \, x\right ) + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2/(x*cos(x)-sin(x))^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.05 \[ \int \frac {x^2}{{\left (\sin \relax (x)-x\,\cos \relax (x)\right )}^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2/(sin(x) - x*cos(x))^2,x)

[Out]

int(x^2/(sin(x) - x*cos(x))^2, x)

________________________________________________________________________________________

sympy [B]  time = 1.47, size = 66, normalized size = 3.30 \[ - \frac {2 x \tan {\left (\frac {x}{2} \right )}}{x \tan ^{2}{\left (\frac {x}{2} \right )} - x + 2 \tan {\left (\frac {x}{2} \right )}} + \frac {\tan ^{2}{\left (\frac {x}{2} \right )}}{x \tan ^{2}{\left (\frac {x}{2} \right )} - x + 2 \tan {\left (\frac {x}{2} \right )}} - \frac {1}{x \tan ^{2}{\left (\frac {x}{2} \right )} - x + 2 \tan {\left (\frac {x}{2} \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2/(x*cos(x)-sin(x))**2,x)

[Out]

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

________________________________________________________________________________________