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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0122878, antiderivative size = 17, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {3075} \[ \frac{\sin (x)}{b (a \sin (x)+b \cos (x))} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3075

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-2), x_Symbol] :> Simp[Sin[c + d*x]/(a*d*
(a*Cos[c + d*x] + b*Sin[c + d*x])), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin{align*} \int \frac{1}{(b \cos (x)+a \sin (x))^2} \, dx &=\frac{\sin (x)}{b (b \cos (x)+a \sin (x))}\\ \end{align*}

Mathematica [A]  time = 0.02755, size = 17, normalized size = 1. \[ \frac{\sin (x)}{b (a \sin (x)+b \cos (x))} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.077, size = 14, normalized size = 0.8 \begin{align*} -{\frac{1}{a \left ( a\tan \left ( x \right ) +b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/a/(a*tan(x)+b)

________________________________________________________________________________________

Maxima [A]  time = 0.952206, size = 19, normalized size = 1.12 \begin{align*} -\frac{1}{a^{2} \tan \left (x\right ) + a b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 1.00399, size = 95, normalized size = 5.59 \begin{align*} -\frac{a \cos \left (x\right ) - b \sin \left (x\right )}{{\left (a^{2} b + b^{3}\right )} \cos \left (x\right ) +{\left (a^{3} + a b^{2}\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 123.877, size = 228, normalized size = 13.41 \begin{align*} \begin{cases} \frac{\tilde{\infty } \tan{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} - 1} & \text{for}\: a = 0 \wedge b = 0 \\- \frac{2 \tan{\left (\frac{x}{2} \right )}}{b^{2} \left (\tan ^{2}{\left (\frac{x}{2} \right )} - 1\right )} & \text{for}\: a = 0 \\\frac{x \tan ^{2}{\left (x \right )}}{2 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2} \sin{\left (x \right )} \cos{\left (x \right )} \tan{\left (x \right )} + 2 a^{2} \cos ^{2}{\left (x \right )} \tan ^{2}{\left (x \right )}} + \frac{x}{2 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2} \sin{\left (x \right )} \cos{\left (x \right )} \tan{\left (x \right )} + 2 a^{2} \cos ^{2}{\left (x \right )} \tan ^{2}{\left (x \right )}} + \frac{\tan{\left (x \right )}}{2 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2} \sin{\left (x \right )} \cos{\left (x \right )} \tan{\left (x \right )} + 2 a^{2} \cos ^{2}{\left (x \right )} \tan ^{2}{\left (x \right )}} & \text{for}\: b = - a \tan{\left (x \right )} \\\frac{\tan ^{2}{\left (\frac{x}{2} \right )}}{2 a^{2} \tan{\left (\frac{x}{2} \right )} - a b \tan ^{2}{\left (\frac{x}{2} \right )} + a b} - \frac{1}{2 a^{2} \tan{\left (\frac{x}{2} \right )} - a b \tan ^{2}{\left (\frac{x}{2} \right )} + a b} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((zoo*tan(x/2)/(tan(x/2)**2 - 1), Eq(a, 0) & Eq(b, 0)), (-2*tan(x/2)/(b**2*(tan(x/2)**2 - 1)), Eq(a,
0)), (x*tan(x)**2/(2*a**2*sin(x)**2 - 4*a**2*sin(x)*cos(x)*tan(x) + 2*a**2*cos(x)**2*tan(x)**2) + x/(2*a**2*si
n(x)**2 - 4*a**2*sin(x)*cos(x)*tan(x) + 2*a**2*cos(x)**2*tan(x)**2) + tan(x)/(2*a**2*sin(x)**2 - 4*a**2*sin(x)
*cos(x)*tan(x) + 2*a**2*cos(x)**2*tan(x)**2), Eq(b, -a*tan(x))), (tan(x/2)**2/(2*a**2*tan(x/2) - a*b*tan(x/2)*
*2 + a*b) - 1/(2*a**2*tan(x/2) - a*b*tan(x/2)**2 + a*b), True))

________________________________________________________________________________________

Giac [A]  time = 1.10501, size = 18, normalized size = 1.06 \begin{align*} -\frac{1}{{\left (a \tan \left (x\right ) + b\right )} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/((a*tan(x) + b)*a)