3.508 \(\int \frac {a+b \cos (x)}{b^2+2 a b \cos (x)+a^2 \cos ^2(x)} \, dx\)

Optimal. Leaf size=11 \[ \frac {\sin (x)}{a \cos (x)+b} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3289, 2754, 8} \[ \frac {\sin (x)}{a \cos (x)+b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 8

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

Rule 2754

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 - b^2)), x] + Dist[1/((m + 1)*(a^2 - b^2
)), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[(a*c - b*d)*(m + 1) - (b*c - a*d)*(m + 2)*Sin[e + f*x], x], x], x] /
; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rule 3289

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + cos[(d_.) + (e_.)*(x_)]^2*(c_.) + (a_))^(n_)*(cos[(d_.) + (e_.)*(x_)]*(B_
.) + (A_)), x_Symbol] :> Dist[1/(4^n*c^n), Int[(A + B*Cos[d + e*x])*(b + 2*c*Cos[d + e*x])^(2*n), x], x] /; Fr
eeQ[{a, b, c, d, e, A, B}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[n]

Rubi steps

\begin {align*} \int \frac {a+b \cos (x)}{b^2+2 a b \cos (x)+a^2 \cos ^2(x)} \, dx &=\left (4 a^2\right ) \int \frac {a+b \cos (x)}{\left (2 a b+2 a^2 \cos (x)\right )^2} \, dx\\ &=\frac {\sin (x)}{b+a \cos (x)}+\frac {\int 0 \, dx}{a^2-b^2}\\ &=\frac {\sin (x)}{b+a \cos (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 11, normalized size = 1.00 \[ \frac {\sin (x)}{a \cos (x)+b} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.78, size = 11, normalized size = 1.00 \[ \frac {\sin \relax (x)}{a \cos \relax (x) + b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [B]  time = 0.17, size = 32, normalized size = 2.91 \[ -\frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{a \tan \left (\frac {1}{2} \, x\right )^{2} - b \tan \left (\frac {1}{2} \, x\right )^{2} - a - b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*tan(1/2*x)/(a*tan(1/2*x)^2 - b*tan(1/2*x)^2 - a - b)

________________________________________________________________________________________

maple [B]  time = 0.09, size = 33, normalized size = 3.00 \[ -\frac {2 \tan \left (\frac {x}{2}\right )}{a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-a -b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*tan(1/2*x)/(a*tan(1/2*x)^2-b*tan(1/2*x)^2-a-b)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 2.94, size = 24, normalized size = 2.18 \[ \frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{\left (b-a\right )\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+a+b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*tan(x/2))/(a + b - tan(x/2)^2*(a - b))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________