Integrand size = 10, antiderivative size = 65 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {(2 a+b) \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} (a+b)^{3/2}}+\frac {b \cos (x) \sin (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )} \] Output:
1/2*(2*a+b)*arctan((a+b)^(1/2)*tan(x)/a^(1/2))/a^(3/2)/(a+b)^(3/2)+1/2*b*c os(x)*sin(x)/a/(a+b)/(a+b*sin(x)^2)
Time = 5.19 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.08 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {(2 a+b) \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} (a+b)^{3/2}}-\frac {b \sin (2 x)}{2 a (a+b) (-2 a-b+b \cos (2 x))} \] Input:
Integrate[(a + b*Sin[x]^2)^(-2),x]
Output:
((2*a + b)*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(2*a^(3/2)*(a + b)^(3/2)) - (b*Sin[2*x])/(2*a*(a + b)*(-2*a - b + b*Cos[2*x]))
Time = 0.30 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.700, Rules used = {3042, 3663, 25, 27, 3042, 3660, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\left (a+b \sin (x)^2\right )^2}dx\) |
\(\Big \downarrow \) 3663 |
\(\displaystyle \frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}-\frac {\int -\frac {2 a+b}{b \sin ^2(x)+a}dx}{2 a (a+b)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\int \frac {2 a+b}{b \sin ^2(x)+a}dx}{2 a (a+b)}+\frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {(2 a+b) \int \frac {1}{b \sin ^2(x)+a}dx}{2 a (a+b)}+\frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {(2 a+b) \int \frac {1}{b \sin (x)^2+a}dx}{2 a (a+b)}+\frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}\) |
\(\Big \downarrow \) 3660 |
\(\displaystyle \frac {(2 a+b) \int \frac {1}{(a+b) \tan ^2(x)+a}d\tan (x)}{2 a (a+b)}+\frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {(2 a+b) \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{2 a^{3/2} (a+b)^{3/2}}+\frac {b \sin (x) \cos (x)}{2 a (a+b) \left (a+b \sin ^2(x)\right )}\) |
Input:
Int[(a + b*Sin[x]^2)^(-2),x]
Output:
((2*a + b)*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(2*a^(3/2)*(a + b)^(3/2)) + (b*Cos[x]*Sin[x])/(2*a*(a + b)*(a + b*Sin[x]^2))
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Subst[Int[1/(a + (a + b)*ff^2*x^ 2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Simp[(-b)*C os[e + f*x]*Sin[e + f*x]*((a + b*Sin[e + f*x]^2)^(p + 1)/(2*a*f*(p + 1)*(a + b))), x] + Simp[1/(2*a*(p + 1)*(a + b)) Int[(a + b*Sin[e + f*x]^2)^(p + 1)*Simp[2*a*(p + 1) + b*(2*p + 3) - 2*b*(p + 2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a + b, 0] && LtQ[p, -1]
Time = 0.42 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.03
method | result | size |
default | \(\frac {b \tan \left (x \right )}{2 a \left (a +b \right ) \left (\tan \left (x \right )^{2} a +b \tan \left (x \right )^{2}+a \right )}+\frac {\left (2 a +b \right ) \arctan \left (\frac {\left (a +b \right ) \tan \left (x \right )}{\sqrt {a \left (a +b \right )}}\right )}{2 a \left (a +b \right ) \sqrt {a \left (a +b \right )}}\) | \(67\) |
risch | \(-\frac {i \left (2 \,{\mathrm e}^{2 i x} a +{\mathrm e}^{2 i x} b -b \right )}{a \left (a +b \right ) \left (-{\mathrm e}^{4 i x} b +4 \,{\mathrm e}^{2 i x} a +2 \,{\mathrm e}^{2 i x} b -b \right )}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-b a}+b \sqrt {-a^{2}-b a}}{b \sqrt {-a^{2}-b a}}\right )}{2 \sqrt {-a^{2}-b a}\, \left (a +b \right )}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-b a}+b \sqrt {-a^{2}-b a}}{b \sqrt {-a^{2}-b a}}\right ) b}{4 \sqrt {-a^{2}-b a}\, \left (a +b \right ) a}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b -2 a \sqrt {-a^{2}-b a}-b \sqrt {-a^{2}-b a}}{b \sqrt {-a^{2}-b a}}\right )}{2 \sqrt {-a^{2}-b a}\, \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b -2 a \sqrt {-a^{2}-b a}-b \sqrt {-a^{2}-b a}}{b \sqrt {-a^{2}-b a}}\right ) b}{4 \sqrt {-a^{2}-b a}\, \left (a +b \right ) a}\) | \(406\) |
Input:
int(1/(a+b*sin(x)^2)^2,x,method=_RETURNVERBOSE)
Output:
1/2*b/a/(a+b)*tan(x)/(tan(x)^2*a+b*tan(x)^2+a)+1/2*(2*a+b)/a/(a+b)/(a*(a+b ))^(1/2)*arctan((a+b)*tan(x)/(a*(a+b))^(1/2))
Leaf count of result is larger than twice the leaf count of optimal. 149 vs. \(2 (53) = 106\).
Time = 0.10 (sec) , antiderivative size = 383, normalized size of antiderivative = 5.89 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\left [\frac {4 \, {\left (a^{2} b + a b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left ({\left (2 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - 3 \, a b - b^{2}\right )} \sqrt {-a^{2} - a b} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - {\left (a + b\right )} \cos \left (x\right )\right )} \sqrt {-a^{2} - a b} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right )}{8 \, {\left (a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3} - {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cos \left (x\right )^{2}\right )}}, \frac {2 \, {\left (a^{2} b + a b^{2}\right )} \cos \left (x\right ) \sin \left (x\right ) + {\left ({\left (2 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - 2 \, a^{2} - 3 \, a b - b^{2}\right )} \sqrt {a^{2} + a b} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b}{2 \, \sqrt {a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right )}{4 \, {\left (a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3} - {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cos \left (x\right )^{2}\right )}}\right ] \] Input:
integrate(1/(a+b*sin(x)^2)^2,x, algorithm="fricas")
Output:
[1/8*(4*(a^2*b + a*b^2)*cos(x)*sin(x) + ((2*a*b + b^2)*cos(x)^2 - 2*a^2 - 3*a*b - b^2)*sqrt(-a^2 - a*b)*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a ^2 + 5*a*b + b^2)*cos(x)^2 + 4*((2*a + b)*cos(x)^3 - (a + b)*cos(x))*sqrt( -a^2 - a*b)*sin(x) + a^2 + 2*a*b + b^2)/(b^2*cos(x)^4 - 2*(a*b + b^2)*cos( x)^2 + a^2 + 2*a*b + b^2)))/(a^5 + 3*a^4*b + 3*a^3*b^2 + a^2*b^3 - (a^4*b + 2*a^3*b^2 + a^2*b^3)*cos(x)^2), 1/4*(2*(a^2*b + a*b^2)*cos(x)*sin(x) + ( (2*a*b + b^2)*cos(x)^2 - 2*a^2 - 3*a*b - b^2)*sqrt(a^2 + a*b)*arctan(1/2*( (2*a + b)*cos(x)^2 - a - b)/(sqrt(a^2 + a*b)*cos(x)*sin(x))))/(a^5 + 3*a^4 *b + 3*a^3*b^2 + a^2*b^3 - (a^4*b + 2*a^3*b^2 + a^2*b^3)*cos(x)^2)]
Timed out. \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\text {Timed out} \] Input:
integrate(1/(a+b*sin(x)**2)**2,x)
Output:
Timed out
Time = 0.11 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.14 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {b \tan \left (x\right )}{2 \, {\left (a^{3} + a^{2} b + {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )} \tan \left (x\right )^{2}\right )}} + \frac {{\left (2 \, a + b\right )} \arctan \left (\frac {{\left (a + b\right )} \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{2 \, \sqrt {{\left (a + b\right )} a} {\left (a^{2} + a b\right )}} \] Input:
integrate(1/(a+b*sin(x)^2)^2,x, algorithm="maxima")
Output:
1/2*b*tan(x)/(a^3 + a^2*b + (a^3 + 2*a^2*b + a*b^2)*tan(x)^2) + 1/2*(2*a + b)*arctan((a + b)*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*(a^2 + a*b))
Time = 0.41 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.32 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (2 \, a + b\right )}}{2 \, {\left (a^{2} + a b\right )}^{\frac {3}{2}}} + \frac {b \tan \left (x\right )}{2 \, {\left (a \tan \left (x\right )^{2} + b \tan \left (x\right )^{2} + a\right )} {\left (a^{2} + a b\right )}} \] Input:
integrate(1/(a+b*sin(x)^2)^2,x, algorithm="giac")
Output:
1/2*(pi*floor(x/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(x) + b*tan(x))/sq rt(a^2 + a*b)))*(2*a + b)/(a^2 + a*b)^(3/2) + 1/2*b*tan(x)/((a*tan(x)^2 + b*tan(x)^2 + a)*(a^2 + a*b))
Time = 37.08 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.94 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx=\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (x\right )\,\left (2\,a+2\,b\right )}{2\,\sqrt {a}\,\sqrt {a+b}}\right )\,\left (2\,a+b\right )}{2\,a^{3/2}\,{\left (a+b\right )}^{3/2}}+\frac {b\,\mathrm {tan}\left (x\right )}{2\,a\,\left (a+b\right )\,\left (\left (a+b\right )\,{\mathrm {tan}\left (x\right )}^2+a\right )} \] Input:
int(1/(a + b*sin(x)^2)^2,x)
Output:
(atan((tan(x)*(2*a + 2*b))/(2*a^(1/2)*(a + b)^(1/2)))*(2*a + b))/(2*a^(3/2 )*(a + b)^(3/2)) + (b*tan(x))/(2*a*(a + b)*(a + tan(x)^2*(a + b)))
Time = 0.29 (sec) , antiderivative size = 1666, normalized size of antiderivative = 25.63 \[ \int \frac {1}{\left (a+b \sin ^2(x)\right )^2} \, dx =\text {Too large to display} \] Input:
int(1/(a+b*sin(x)^2)^2,x)
Output:
( - 4*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*at an((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2 *a*b - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b) *atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x) **2*b**2 - 4*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a* *2 - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*a tan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a*b + 4* sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*s qrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2*a**2*b + 6*sqrt(a)*sqrt(2 *sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)* sqrt(a + b) + a + 2*b)))*sin(x)**2*a*b**2 + 2*sqrt(a)*sqrt(2*sqrt(b)*sqrt( a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*sin(x)**2*b**3 + 4*sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b )*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a**3 + 6*sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt( a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a**2*b + 2*sqrt(a)*sqrt(2*sqrt( b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*sqrt(a + b) + a + 2*b)))*a*b**2 + 2*cos(x)*sin(x)*a**3*b + 2*cos(x)*sin(x)*a**2* b**2 - 2*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) - a - 2...