\(\int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx\) [17]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 18 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left (a^2-b^2 \cos ^2(x)\right )}{b^2} \]

[Out]

ln(a^2-b^2*cos(x)^2)/b^2

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.22, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {12, 266} \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left (a^2+b^2 \sin ^2(x)-b^2\right )}{b^2} \]

[In]

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

[Out]

Log[a^2 - b^2 + b^2*Sin[x]^2]/b^2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {2 x}{a^2-b^2+b^2 x^2} \, dx,x,\sin (x)\right ) \\ & = 2 \text {Subst}\left (\int \frac {x}{a^2-b^2+b^2 x^2} \, dx,x,\sin (x)\right ) \\ & = \frac {\log \left (a^2-b^2+b^2 \sin ^2(x)\right )}{b^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.22 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left (a^2-b^2+b^2 \sin ^2(x)\right )}{b^2} \]

[In]

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

[Out]

Log[a^2 - b^2 + b^2*Sin[x]^2]/b^2

Maple [A] (verified)

Time = 9.13 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06

method result size
derivativedivides \(\frac {\ln \left (a^{2}-b^{2} \left (\cos ^{2}\left (x \right )\right )\right )}{b^{2}}\) \(19\)
default \(\frac {\ln \left (a^{2}-b^{2} \left (\cos ^{2}\left (x \right )\right )\right )}{b^{2}}\) \(19\)
risch \(-\frac {2 i x}{b^{2}}+\frac {\ln \left ({\mathrm e}^{4 i x}-\frac {2 \left (2 a^{2}-b^{2}\right ) {\mathrm e}^{2 i x}}{b^{2}}+1\right )}{b^{2}}\) \(42\)

[In]

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

[Out]

ln(a^2-b^2*cos(x)^2)/b^2

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left (b^{2} \cos \left (x\right )^{2} - a^{2}\right )}{b^{2}} \]

[In]

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

[Out]

log(b^2*cos(x)^2 - a^2)/b^2

Sympy [A] (verification not implemented)

Time = 0.94 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.78 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=2 \left (\begin {cases} - \frac {\cos ^{2}{\left (x \right )}}{2 a^{2}} & \text {for}\: b^{2} = 0 \\\frac {\log {\left (a^{2} - b^{2} \cos ^{2}{\left (x \right )} \right )}}{2 b^{2}} & \text {otherwise} \end {cases}\right ) \]

[In]

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

[Out]

2*Piecewise((-cos(x)**2/(2*a**2), Eq(b**2, 0)), (log(a**2 - b**2*cos(x)**2)/(2*b**2), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left (b^{2} \cos \left (x\right )^{2} - a^{2}\right )}{b^{2}} \]

[In]

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

[Out]

log(b^2*cos(x)^2 - a^2)/b^2

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.11 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=\frac {\log \left ({\left | b^{2} \cos \left (x\right )^{2} - a^{2} \right |}\right )}{b^{2}} \]

[In]

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

[Out]

log(abs(b^2*cos(x)^2 - a^2))/b^2

Mupad [B] (verification not implemented)

Time = 0.47 (sec) , antiderivative size = 58, normalized size of antiderivative = 3.22 \[ \int \frac {\sin (2 x)}{a^2-b^2 \cos ^2(x)} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {b^2}{-2\,a^2+b^2\,{\cos \left (x\right )}^2+b^2}-\frac {b^2\,{\cos \left (x\right )}^2}{-2\,a^2+b^2\,{\cos \left (x\right )}^2+b^2}\right )}{b^2} \]

[In]

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

[Out]

-(2*atanh(b^2/(b^2*cos(x)^2 - 2*a^2 + b^2) - (b^2*cos(x)^2)/(b^2*cos(x)^2 - 2*a^2 + b^2)))/b^2