3.648 \(\int \frac{\sin (x)}{a+b \cos (x)} \, dx\)

Optimal. Leaf size=12 \[ -\frac{\log (a+b \cos (x))}{b} \]

[Out]

-(Log[a + b*Cos[x]]/b)

________________________________________________________________________________________

Rubi [A]  time = 0.0223243, antiderivative size = 12, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {2668, 31} \[ -\frac{\log (a+b \cos (x))}{b} \]

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(a + b*Cos[x]),x]

[Out]

-(Log[a + b*Cos[x]]/b)

Rule 2668

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^m*(b^2 - x^2)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && Integer
Q[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 31

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

Rubi steps

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

Mathematica [A]  time = 0.0182928, size = 12, normalized size = 1. \[ -\frac{\log (a+b \cos (x))}{b} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(a + b*Cos[x]),x]

[Out]

-(Log[a + b*Cos[x]]/b)

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 13, normalized size = 1.1 \begin{align*} -{\frac{\ln \left ( a+b\cos \left ( x \right ) \right ) }{b}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(a+b*cos(x)),x)

[Out]

-ln(a+b*cos(x))/b

________________________________________________________________________________________

Maxima [A]  time = 0.968939, size = 16, normalized size = 1.33 \begin{align*} -\frac{\log \left (b \cos \left (x\right ) + a\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*cos(x)),x, algorithm="maxima")

[Out]

-log(b*cos(x) + a)/b

________________________________________________________________________________________

Fricas [A]  time = 2.06818, size = 31, normalized size = 2.58 \begin{align*} -\frac{\log \left (-b \cos \left (x\right ) - a\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*cos(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.386041, size = 17, normalized size = 1.42 \begin{align*} \begin{cases} - \frac{\log{\left (\frac{a}{b} + \cos{\left (x \right )} \right )}}{b} & \text{for}\: b \neq 0 \\- \frac{\cos{\left (x \right )}}{a} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*cos(x)),x)

[Out]

Piecewise((-log(a/b + cos(x))/b, Ne(b, 0)), (-cos(x)/a, True))

________________________________________________________________________________________

Giac [A]  time = 1.07803, size = 18, normalized size = 1.5 \begin{align*} -\frac{\log \left ({\left | b \cos \left (x\right ) + a \right |}\right )}{b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(a+b*cos(x)),x, algorithm="giac")

[Out]

-log(abs(b*cos(x) + a))/b