\(\int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx\) [227]

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

Optimal result

Integrand size = 19, antiderivative size = 32 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\sin (c+d x)}{a d (a \cos (c+d x)+b \sin (c+d x))} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {3154} \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\sin (c+d x)}{a d (a \cos (c+d x)+b \sin (c+d x))} \]

[In]

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

[Out]

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

Rule 3154

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*} \text {integral}& = \frac {\sin (c+d x)}{a d (a \cos (c+d x)+b \sin (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {\sin (c+d x)}{a d (a \cos (c+d x)+b \sin (c+d x))} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.77 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.66

method result size
derivativedivides \(-\frac {1}{d b \left (a +b \tan \left (d x +c \right )\right )}\) \(21\)
default \(-\frac {1}{d b \left (a +b \tan \left (d x +c \right )\right )}\) \(21\)
risch \(\frac {2 i}{d \left (-i b +a \right ) \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+{\mathrm e}^{2 i \left (d x +c \right )} a +i b +a \right )}\) \(47\)
parallelrisch \(\frac {1-\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{b d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}\) \(54\)
norman \(\frac {\frac {1}{b d}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{b d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}\) \(60\)

[In]

int(1/(cos(d*x+c)*a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.78 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )}{{\left (a^{3} + a b^{2}\right )} d \cos \left (d x + c\right ) + {\left (a^{2} b + b^{3}\right )} d \sin \left (d x + c\right )} \]

[In]

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

[Out]

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

Sympy [F]

\[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\int \frac {1}{\left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \]

[In]

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

[Out]

Integral((a*cos(c + d*x) + b*sin(c + d*x))**(-2), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.66 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {1}{{\left (b^{2} \tan \left (d x + c\right ) + a b\right )} d} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.62 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=-\frac {1}{{\left (b \tan \left (d x + c\right ) + a\right )} b d} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 28.65 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.47 \[ \int \frac {1}{(a \cos (c+d x)+b \sin (c+d x))^2} \, dx=\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )} \]

[In]

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

[Out]

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