3.570 \(\int \frac {1}{a+b \cos (c+d x) \sin (c+d x)} \, dx\)

Optimal. Leaf size=48 \[ \frac {2 \tan ^{-1}\left (\frac {2 a \tan (c+d x)+b}{\sqrt {4 a^2-b^2}}\right )}{d \sqrt {4 a^2-b^2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2666, 2660, 618, 204} \[ \frac {2 \tan ^{-1}\left (\frac {2 a \tan (c+d x)+b}{\sqrt {4 a^2-b^2}}\right )}{d \sqrt {4 a^2-b^2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*ArcTan[(b + 2*a*Tan[c + d*x])/Sqrt[4*a^2 - b^2]])/(Sqrt[4*a^2 - b^2]*d)

Rule 204

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

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 2666

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 48, normalized size = 1.00 \[ \frac {2 \tan ^{-1}\left (\frac {2 a \tan (c+d x)+b}{\sqrt {4 a^2-b^2}}\right )}{d \sqrt {4 a^2-b^2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(2*ArcTan[(b + 2*a*Tan[c + d*x])/Sqrt[4*a^2 - b^2]])/(Sqrt[4*a^2 - b^2]*d)

________________________________________________________________________________________

fricas [A]  time = 0.84, size = 290, normalized size = 6.04 \[ \left [-\frac {\sqrt {-4 \, a^{2} + b^{2}} \log \left (-\frac {2 \, {\left (8 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - 4 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, {\left (8 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, a^{2} - b^{2} + {\left (2 \, b \cos \left (d x + c\right )^{2} + 4 \, {\left (2 \, a \cos \left (d x + c\right )^{3} - a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) - b\right )} \sqrt {-4 \, a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{4} - b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - a^{2}}\right )}{2 \, {\left (4 \, a^{2} - b^{2}\right )} d}, -\frac {\arctan \left (-\frac {{\left (4 \, a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b\right )} \sqrt {4 \, a^{2} - b^{2}}}{2 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 4 \, a^{2} + b^{2}}\right )}{\sqrt {4 \, a^{2} - b^{2}} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[-1/2*sqrt(-4*a^2 + b^2)*log(-(2*(8*a^2 - b^2)*cos(d*x + c)^4 - 4*a*b*cos(d*x + c)*sin(d*x + c) - 2*(8*a^2 - b
^2)*cos(d*x + c)^2 + 2*a^2 - b^2 + (2*b*cos(d*x + c)^2 + 4*(2*a*cos(d*x + c)^3 - a*cos(d*x + c))*sin(d*x + c)
- b)*sqrt(-4*a^2 + b^2))/(b^2*cos(d*x + c)^4 - b^2*cos(d*x + c)^2 - 2*a*b*cos(d*x + c)*sin(d*x + c) - a^2))/((
4*a^2 - b^2)*d), -arctan(-(4*a*cos(d*x + c)*sin(d*x + c) + b)*sqrt(4*a^2 - b^2)/(2*(4*a^2 - b^2)*cos(d*x + c)^
2 - 4*a^2 + b^2))/(sqrt(4*a^2 - b^2)*d)]

________________________________________________________________________________________

giac [A]  time = 0.16, size = 61, normalized size = 1.27 \[ \frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {2 \, a \tan \left (d x + c\right ) + b}{\sqrt {4 \, a^{2} - b^{2}}}\right )\right )}}{\sqrt {4 \, a^{2} - b^{2}} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(pi*floor((d*x + c)/pi + 1/2)*sgn(a) + arctan((2*a*tan(d*x + c) + b)/sqrt(4*a^2 - b^2)))/(sqrt(4*a^2 - b^2)*
d)

________________________________________________________________________________________

maple [A]  time = 0.31, size = 45, normalized size = 0.94 \[ \frac {2 \arctan \left (\frac {b +2 a \tan \left (d x +c \right )}{\sqrt {4 a^{2}-b^{2}}}\right )}{d \sqrt {4 a^{2}-b^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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(1/(a+b*cos(d*x+c)*sin(d*x+c)),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(b^2-4*a^2>0)', see `assume?` f
or more details)Is b^2-4*a^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 3.11, size = 44, normalized size = 0.92 \[ \frac {2\,\mathrm {atan}\left (\frac {b+2\,a\,\mathrm {tan}\left (c+d\,x\right )}{\sqrt {4\,a^2-b^2}}\right )}{d\,\sqrt {4\,a^2-b^2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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(1/(a+b*cos(d*x+c)*sin(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________