Integrand size = 15, antiderivative size = 59 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {(a+2 b) \tan (x)}{(a+b)^2}+\frac {\tan ^3(x)}{3 (a+b)} \] Output:
b^2*arctan((a+b)^(1/2)*tan(x)/a^(1/2))/a^(1/2)/(a+b)^(5/2)+(a+2*b)*tan(x)/ (a+b)^2+tan(x)^3/(3*a+3*b)
Time = 0.30 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {\left (2 a+5 b+(a+b) \sec ^2(x)\right ) \tan (x)}{3 (a+b)^2} \] Input:
Integrate[Sec[x]^4/(a + b*Sin[x]^2),x]
Output:
(b^2*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(5/2)) + ((2*a + 5*b + (a + b)*Sec[x]^2)*Tan[x])/(3*(a + b)^2)
Time = 0.28 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3042, 3670, 300, 2009}
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 {\sec ^4(x)}{a+b \sin ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cos (x)^4 \left (a+b \sin (x)^2\right )}dx\) |
\(\Big \downarrow \) 3670 |
\(\displaystyle \int \frac {\left (\tan ^2(x)+1\right )^2}{(a+b) \tan ^2(x)+a}d\tan (x)\) |
\(\Big \downarrow \) 300 |
\(\displaystyle \int \left (\frac {b^2}{(a+b)^2 \left ((a+b) \tan ^2(x)+a\right )}+\frac {\tan ^2(x)}{a+b}+\frac {a+2 b}{(a+b)^2}\right )d\tan (x)\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b^2 \arctan \left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {\tan ^3(x)}{3 (a+b)}+\frac {(a+2 b) \tan (x)}{(a+b)^2}\) |
Input:
Int[Sec[x]^4/(a + b*Sin[x]^2),x]
Output:
(b^2*ArcTan[(Sqrt[a + b]*Tan[x])/Sqrt[a]])/(Sqrt[a]*(a + b)^(5/2)) + ((a + 2*b)*Tan[x])/(a + b)^2 + Tan[x]^3/(3*(a + b))
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Int [PolynomialDivide[(a + b*x^2)^p, (c + d*x^2)^(-q), x], x] /; FreeQ[{a, b, c , d}, x] && NeQ[b*c - a*d, 0] && IGtQ[p, 0] && ILtQ[q, 0] && GeQ[p, -q]
Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^( p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Su bst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]
Time = 0.81 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.05
method | result | size |
default | \(\frac {\frac {a \tan \left (x \right )^{3}}{3}+\frac {b \tan \left (x \right )^{3}}{3}+\tan \left (x \right ) a +2 \tan \left (x \right ) b}{\left (a +b \right )^{2}}+\frac {b^{2} \arctan \left (\frac {\left (a +b \right ) \tan \left (x \right )}{\sqrt {a \left (a +b \right )}}\right )}{\left (a +b \right )^{2} \sqrt {a \left (a +b \right )}}\) | \(62\) |
risch | \(\frac {2 i \left (3 \,{\mathrm e}^{4 i x} b +6 \,{\mathrm e}^{2 i x} a +12 \,{\mathrm e}^{2 i x} b +2 a +5 b \right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3} \left (a +b \right )^{2}}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}+\frac {2 i a^{2}+2 i a b -2 a \sqrt {-a^{2}-a b}-b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}\) | \(224\) |
Input:
int(sec(x)^4/(a+b*sin(x)^2),x,method=_RETURNVERBOSE)
Output:
1/(a+b)^2*(1/3*a*tan(x)^3+1/3*b*tan(x)^3+tan(x)*a+2*tan(x)*b)+b^2/(a+b)^2/ (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. 129 vs. \(2 (49) = 98\).
Time = 0.11 (sec) , antiderivative size = 343, normalized size of antiderivative = 5.81 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\left [-\frac {3 \, \sqrt {-a^{2} - a b} b^{2} \cos \left (x\right )^{3} \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 ) - 4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2} + {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{12 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{3}}, -\frac {3 \, \sqrt {a^{2} + a b} b^{2} \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 ) \cos \left (x\right )^{3} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2} + {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{3}}\right ] \] Input:
integrate(sec(x)^4/(a+b*sin(x)^2),x, algorithm="fricas")
Output:
[-1/12*(3*sqrt(-a^2 - a*b)*b^2*cos(x)^3*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)) - 4*(a^3 + 2*a^2*b + a*b^2 + (2*a^3 + 7*a^2*b + 5*a*b^2)*cos(x)^2)*sin(x))/((a^4 + 3*a^3*b + 3*a^2*b^2 + a*b^3) *cos(x)^3), -1/6*(3*sqrt(a^2 + a*b)*b^2*arctan(1/2*((2*a + b)*cos(x)^2 - a - b)/(sqrt(a^2 + a*b)*cos(x)*sin(x)))*cos(x)^3 - 2*(a^3 + 2*a^2*b + a*b^2 + (2*a^3 + 7*a^2*b + 5*a*b^2)*cos(x)^2)*sin(x))/((a^4 + 3*a^3*b + 3*a^2*b ^2 + a*b^3)*cos(x)^3)]
\[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\int \frac {\sec ^{4}{\left (x \right )}}{a + b \sin ^{2}{\left (x \right )}}\, dx \] Input:
integrate(sec(x)**4/(a+b*sin(x)**2),x)
Output:
Integral(sec(x)**4/(a + b*sin(x)**2), x)
Time = 0.11 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.22 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\frac {b^{2} \arctan \left (\frac {{\left (a + b\right )} \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {{\left (a + b\right )} \tan \left (x\right )^{3} + 3 \, {\left (a + 2 \, b\right )} \tan \left (x\right )}{3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} \] Input:
integrate(sec(x)^4/(a+b*sin(x)^2),x, algorithm="maxima")
Output:
b^2*arctan((a + b)*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*(a^2 + 2*a*b + b^2)) + 1/3*((a + b)*tan(x)^3 + 3*(a + 2*b)*tan(x))/(a^2 + 2*a*b + b^2)
Leaf count of result is larger than twice the leaf count of optimal. 134 vs. \(2 (49) = 98\).
Time = 0.40 (sec) , antiderivative size = 134, normalized size of antiderivative = 2.27 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, 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 )} b^{2}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a^{2} + a b}} + \frac {a^{2} \tan \left (x\right )^{3} + 2 \, a b \tan \left (x\right )^{3} + b^{2} \tan \left (x\right )^{3} + 3 \, a^{2} \tan \left (x\right ) + 9 \, a b \tan \left (x\right ) + 6 \, b^{2} \tan \left (x\right )}{3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )}} \] Input:
integrate(sec(x)^4/(a+b*sin(x)^2),x, algorithm="giac")
Output:
(pi*floor(x/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(x) + b*tan(x))/sqrt(a ^2 + a*b)))*b^2/((a^2 + 2*a*b + b^2)*sqrt(a^2 + a*b)) + 1/3*(a^2*tan(x)^3 + 2*a*b*tan(x)^3 + b^2*tan(x)^3 + 3*a^2*tan(x) + 9*a*b*tan(x) + 6*b^2*tan( x))/(a^3 + 3*a^2*b + 3*a*b^2 + b^3)
Time = 34.54 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.31 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx=\frac {{\mathrm {tan}\left (x\right )}^3}{3\,\left (a+b\right )}-\mathrm {tan}\left (x\right )\,\left (\frac {a}{{\left (a+b\right )}^2}-\frac {2}{a+b}\right )+\frac {b^2\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (x\right )\,\left (2\,a+2\,b\right )\,\left (a^2+2\,a\,b+b^2\right )}{2\,\sqrt {a}\,{\left (a+b\right )}^{5/2}}\right )}{\sqrt {a}\,{\left (a+b\right )}^{5/2}} \] Input:
int(1/(cos(x)^4*(a + b*sin(x)^2)),x)
Output:
tan(x)^3/(3*(a + b)) - tan(x)*(a/(a + b)^2 - 2/(a + b)) + (b^2*atan((tan(x )*(2*a + 2*b)*(2*a*b + a^2 + b^2))/(2*a^(1/2)*(a + b)^(5/2))))/(a^(1/2)*(a + b)^(5/2))
Time = 0.33 (sec) , antiderivative size = 1117, normalized size of antiderivative = 18.93 \[ \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx =\text {Too large to display} \] Input:
int(sec(x)^4/(a+b*sin(x)^2),x)
Output:
( - 6*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)))*cos(x)*si n(x)**2*b**2 + 6*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)) )*cos(x)*b**2 + 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)))*cos(x)*sin(x)**2* a*b**2 + 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)))*cos(x)*sin(x)**2*b**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)))*cos(x)*a*b**2 - 6*sqrt(a)*sqrt(2* sqrt(b)*sqrt(a + b) + a + 2*b)*atan((tan(x/2)*a)/(sqrt(a)*sqrt(2*sqrt(b)*s qrt(a + b) + a + 2*b)))*cos(x)*b**3 - 3*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2 *sqrt(b)*sqrt(a + b) - a - 2*b)*cos(x)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan(x/2))*sin(x)**2*b**2 + 3*sqrt(b)*sqrt(a)*sqrt(a + b)*sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b)*cos(x)*log( - sqrt(2*sqrt(b)*sqrt (a + b) - a - 2*b) + sqrt(a)*tan(x/2))*b**2 + 3*sqrt(b)*sqrt(a)*sqrt(a + b )*sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b)*cos(x)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + sqrt(a)*tan(x/2))*sin(x)**2*b**2 - 3*sqrt(b)*sqrt(a)*sqrt (a + b)*sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b)*cos(x)*log(sqrt(2*sqrt(b)*sq rt(a + b) - a - 2*b) + sqrt(a)*tan(x/2))*b**2 - 3*sqrt(a)*sqrt(2*sqrt(b...