Integrand size = 15, antiderivative size = 38 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\frac {x}{b}+\frac {\sqrt {a} \arctan \left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{b \sqrt {a+b}} \] Output:
x/b+a^(1/2)*arctan((a+b)^(1/2)*cot(x)/a^(1/2))/b/(a+b)^(1/2)
Time = 0.74 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.95 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\frac {x-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{\sqrt {a+b}}}{b} \] Input:
Integrate[Cos[x]^2/(a + b*Cos[x]^2),x]
Output:
(x - (Sqrt[a]*ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]])/Sqrt[a + b])/b
Time = 0.29 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3650, 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 {\cos ^2(x)}{a+b \cos ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (x+\frac {\pi }{2}\right )^2}{a+b \sin \left (x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 3650 |
\(\displaystyle \frac {x}{b}-\frac {a \int \frac {1}{b \cos ^2(x)+a}dx}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x}{b}-\frac {a \int \frac {1}{b \sin \left (x+\frac {\pi }{2}\right )^2+a}dx}{b}\) |
\(\Big \downarrow \) 3660 |
\(\displaystyle \frac {a \int \frac {1}{(a+b) \cot ^2(x)+a}d\cot (x)}{b}+\frac {x}{b}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\sqrt {a} \arctan \left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{b \sqrt {a+b}}+\frac {x}{b}\) |
Input:
Int[Cos[x]^2/(a + b*Cos[x]^2),x]
Output:
x/b + (Sqrt[a]*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(b*Sqrt[a + b])
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)/((a_) + (b_.)*sin[(e_.) + (f_ .)*(x_)]^2), x_Symbol] :> Simp[B*(x/b), x] + Simp[(A*b - a*B)/b Int[1/(a + b*Sin[e + f*x]^2), x], x] /; FreeQ[{a, b, e, f, A, B}, x]
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]
Time = 0.12 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.89
method | result | size |
default | \(\frac {\arctan \left (\tan \left (x \right )\right )}{b}-\frac {a \arctan \left (\frac {a \tan \left (x \right )}{\sqrt {\left (a +b \right ) a}}\right )}{b \sqrt {\left (a +b \right ) a}}\) | \(34\) |
risch | \(\frac {x}{b}+\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-\left (a +b \right ) a}+2 a +b}{b}\right )}{2 \left (a +b \right ) b}-\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-\left (a +b \right ) a}-2 a -b}{b}\right )}{2 \left (a +b \right ) b}\) | \(100\) |
Input:
int(cos(x)^2/(a+b*cos(x)^2),x,method=_RETURNVERBOSE)
Output:
1/b*arctan(tan(x))-1/b*a/((a+b)*a)^(1/2)*arctan(a*tan(x)/((a+b)*a)^(1/2))
Time = 0.19 (sec) , antiderivative size = 183, normalized size of antiderivative = 4.82 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\left [\frac {\sqrt {-\frac {a}{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} + 3 \, a b\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a^{2} + 3 \, a b + b^{2}\right )} \cos \left (x\right )^{3} - {\left (a^{2} + a b\right )} \cos \left (x\right )\right )} \sqrt {-\frac {a}{a + b}} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) + 4 \, x}{4 \, b}, \frac {\sqrt {\frac {a}{a + b}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a\right )} \sqrt {\frac {a}{a + b}}}{2 \, a \cos \left (x\right ) \sin \left (x\right )}\right ) + 2 \, x}{2 \, b}\right ] \] Input:
integrate(cos(x)^2/(a+b*cos(x)^2),x, algorithm="fricas")
Output:
[1/4*(sqrt(-a/(a + b))*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 3* a*b)*cos(x)^2 + 4*((2*a^2 + 3*a*b + b^2)*cos(x)^3 - (a^2 + a*b)*cos(x))*sq rt(-a/(a + b))*sin(x) + a^2)/(b^2*cos(x)^4 + 2*a*b*cos(x)^2 + a^2)) + 4*x) /b, 1/2*(sqrt(a/(a + b))*arctan(1/2*((2*a + b)*cos(x)^2 - a)*sqrt(a/(a + b ))/(a*cos(x)*sin(x))) + 2*x)/b]
Timed out. \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\text {Timed out} \] Input:
integrate(cos(x)**2/(a+b*cos(x)**2),x)
Output:
Timed out
Time = 0.11 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.82 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=-\frac {a \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} b} + \frac {x}{b} \] Input:
integrate(cos(x)^2/(a+b*cos(x)^2),x, algorithm="maxima")
Output:
-a*arctan(a*tan(x)/sqrt((a + b)*a))/(sqrt((a + b)*a)*b) + x/b
Time = 0.12 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.26 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=-\frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} a}{\sqrt {a^{2} + a b} b} + \frac {x}{b} \] Input:
integrate(cos(x)^2/(a+b*cos(x)^2),x, algorithm="giac")
Output:
-(pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))*a/(sqrt( a^2 + a*b)*b) + x/b
Time = 1.09 (sec) , antiderivative size = 425, normalized size of antiderivative = 11.18 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\frac {x}{b}-\frac {\mathrm {atan}\left (\frac {\frac {\left (2\,a^3\,\mathrm {tan}\left (x\right )-\frac {\left (2\,a^2\,b^2-\frac {\mathrm {tan}\left (x\right )\,\left (16\,a^3\,b^2+8\,a^2\,b^3\right )\,\sqrt {-a\,\left (a+b\right )}}{4\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{2\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}\,1{}\mathrm {i}}{b^2+a\,b}+\frac {\left (2\,a^3\,\mathrm {tan}\left (x\right )+\frac {\left (2\,a^2\,b^2+\frac {\mathrm {tan}\left (x\right )\,\left (16\,a^3\,b^2+8\,a^2\,b^3\right )\,\sqrt {-a\,\left (a+b\right )}}{4\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{2\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}\,1{}\mathrm {i}}{b^2+a\,b}}{\frac {\left (2\,a^3\,\mathrm {tan}\left (x\right )-\frac {\left (2\,a^2\,b^2-\frac {\mathrm {tan}\left (x\right )\,\left (16\,a^3\,b^2+8\,a^2\,b^3\right )\,\sqrt {-a\,\left (a+b\right )}}{4\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{2\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{b^2+a\,b}-\frac {\left (2\,a^3\,\mathrm {tan}\left (x\right )+\frac {\left (2\,a^2\,b^2+\frac {\mathrm {tan}\left (x\right )\,\left (16\,a^3\,b^2+8\,a^2\,b^3\right )\,\sqrt {-a\,\left (a+b\right )}}{4\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{2\,\left (b^2+a\,b\right )}\right )\,\sqrt {-a\,\left (a+b\right )}}{b^2+a\,b}}\right )\,\sqrt {-a\,\left (a+b\right )}\,1{}\mathrm {i}}{b^2+a\,b} \] Input:
int(cos(x)^2/(a + b*cos(x)^2),x)
Output:
x/b - (atan((((2*a^3*tan(x) - ((2*a^2*b^2 - (tan(x)*(8*a^2*b^3 + 16*a^3*b^ 2)*(-a*(a + b))^(1/2))/(4*(a*b + b^2)))*(-a*(a + b))^(1/2))/(2*(a*b + b^2) ))*(-a*(a + b))^(1/2)*1i)/(a*b + b^2) + ((2*a^3*tan(x) + ((2*a^2*b^2 + (ta n(x)*(8*a^2*b^3 + 16*a^3*b^2)*(-a*(a + b))^(1/2))/(4*(a*b + b^2)))*(-a*(a + b))^(1/2))/(2*(a*b + b^2)))*(-a*(a + b))^(1/2)*1i)/(a*b + b^2))/(((2*a^3 *tan(x) - ((2*a^2*b^2 - (tan(x)*(8*a^2*b^3 + 16*a^3*b^2)*(-a*(a + b))^(1/2 ))/(4*(a*b + b^2)))*(-a*(a + b))^(1/2))/(2*(a*b + b^2)))*(-a*(a + b))^(1/2 ))/(a*b + b^2) - ((2*a^3*tan(x) + ((2*a^2*b^2 + (tan(x)*(8*a^2*b^3 + 16*a^ 3*b^2)*(-a*(a + b))^(1/2))/(4*(a*b + b^2)))*(-a*(a + b))^(1/2))/(2*(a*b + b^2)))*(-a*(a + b))^(1/2))/(a*b + b^2)))*(-a*(a + b))^(1/2)*1i)/(a*b + b^2 )
Time = 0.16 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.84 \[ \int \frac {\cos ^2(x)}{a+b \cos ^2(x)} \, dx=\frac {-\sqrt {a}\, \sqrt {a +b}\, \mathit {atan} \left (\frac {\sqrt {a +b}\, \tan \left (\frac {x}{2}\right )-\sqrt {b}}{\sqrt {a}}\right )-\sqrt {a}\, \sqrt {a +b}\, \mathit {atan} \left (\frac {\sqrt {a +b}\, \tan \left (\frac {x}{2}\right )+\sqrt {b}}{\sqrt {a}}\right )+a x +b x}{b \left (a +b \right )} \] Input:
int(cos(x)^2/(a+b*cos(x)^2),x)
Output:
( - sqrt(a)*sqrt(a + b)*atan((sqrt(a + b)*tan(x/2) - sqrt(b))/sqrt(a)) - s qrt(a)*sqrt(a + b)*atan((sqrt(a + b)*tan(x/2) + sqrt(b))/sqrt(a)) + a*x + b*x)/(b*(a + b))