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

Optimal. Leaf size=15 \[ \frac {\tanh ^{-1}\left (\frac {b \sin (x)}{a}\right )}{a b} \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3190, 208} \[ \frac {\tanh ^{-1}\left (\frac {b \sin (x)}{a}\right )}{a b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[(b*Sin[x])/a]/(a*b)

Rule 208

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

Rule 3190

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 15, normalized size = 1.00 \[ \frac {\tanh ^{-1}\left (\frac {b \sin (x)}{a}\right )}{a b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[(b*Sin[x])/a]/(a*b)

________________________________________________________________________________________

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

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 0.87, size = 26, normalized size = 1.73 \[ \frac {\log \left (b \sin \relax (x) + a\right ) - \log \left (-b \sin \relax (x) + a\right )}{2 \, a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*(log(b*sin(x) + a) - log(-b*sin(x) + a))/(a*b)

________________________________________________________________________________________

giac [B]  time = 1.09, size = 35, normalized size = 2.33 \[ \frac {\log \left ({\left | b \sin \relax (x) + a \right |}\right )}{2 \, a b} - \frac {\log \left ({\left | b \sin \relax (x) - a \right |}\right )}{2 \, a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*log(abs(b*sin(x) + a))/(a*b) - 1/2*log(abs(b*sin(x) - a))/(a*b)

________________________________________________________________________________________

maple [B]  time = 0.15, size = 33, normalized size = 2.20




method result size



derivativedivides \(-\frac {\ln \left (-b \sin \relax (x )+a \right )}{2 a b}+\frac {\ln \left (b \sin \relax (x )+a \right )}{2 a b}\) \(33\)
default \(-\frac {\ln \left (-b \sin \relax (x )+a \right )}{2 a b}+\frac {\ln \left (b \sin \relax (x )+a \right )}{2 a b}\) \(33\)
norman \(-\frac {\ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 b \tan \left (\frac {x}{2}\right )+a \right )}{2 a b}+\frac {\ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 b \tan \left (\frac {x}{2}\right )+a \right )}{2 a b}\) \(54\)
risch \(-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a \,{\mathrm e}^{i x}}{b}-1\right )}{2 a b}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a \,{\mathrm e}^{i x}}{b}-1\right )}{2 a b}\) \(58\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2/a/b*ln(-b*sin(x)+a)+1/2/a/b*ln(b*sin(x)+a)

________________________________________________________________________________________

maxima [B]  time = 0.43, size = 33, normalized size = 2.20 \[ \frac {\log \left (b \sin \relax (x) + a\right )}{2 \, a b} - \frac {\log \left (b \sin \relax (x) - a\right )}{2 \, a b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*log(b*sin(x) + a)/(a*b) - 1/2*log(b*sin(x) - a)/(a*b)

________________________________________________________________________________________

mupad [B]  time = 0.18, size = 15, normalized size = 1.00 \[ \frac {\mathrm {atanh}\left (\frac {b\,\sin \relax (x)}{a}\right )}{a\,b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

atanh((b*sin(x))/a)/(a*b)

________________________________________________________________________________________

sympy [A]  time = 0.73, size = 44, normalized size = 2.93 \[ \begin {cases} \frac {\tilde {\infty }}{\sin {\relax (x )}} & \text {for}\: a = 0 \wedge b = 0 \\\frac {1}{b^{2} \sin {\relax (x )}} & \text {for}\: a = 0 \\\frac {\sin {\relax (x )}}{a^{2}} & \text {for}\: b = 0 \\- \frac {\log {\left (- \frac {a}{b} + \sin {\relax (x )} \right )}}{2 a b} + \frac {\log {\left (\frac {a}{b} + \sin {\relax (x )} \right )}}{2 a b} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo/sin(x), Eq(a, 0) & Eq(b, 0)), (1/(b**2*sin(x)), Eq(a, 0)), (sin(x)/a**2, Eq(b, 0)), (-log(-a/b
+ sin(x))/(2*a*b) + log(a/b + sin(x))/(2*a*b), True))

________________________________________________________________________________________