Integrand size = 19, antiderivative size = 56 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=-\frac {b x}{c}+\frac {(a+2 b) x}{\sqrt {2} c}+\frac {(a+2 b) \arctan \left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\sin ^2(x)}\right )}{\sqrt {2} c} \] Output:
-b*x/c+1/2*(a+2*b)*x*2^(1/2)/c+1/2*(a+2*b)*arctan(cos(x)*sin(x)/(1+2^(1/2) +sin(x)^2))*2^(1/2)/c
Time = 0.22 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.55 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=-\frac {b x}{c}+\frac {(a+2 b) \arctan \left (\sqrt {2} \tan (x)\right )}{\sqrt {2} c} \] Input:
Integrate[(a + b*Cos[x]^2)/(c + c*Sin[x]^2),x]
Output:
-((b*x)/c) + ((a + 2*b)*ArcTan[Sqrt[2]*Tan[x]])/(Sqrt[2]*c)
Time = 0.33 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.59, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {3042, 4889, 1480, 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 {a+b \cos ^2(x)}{c \sin ^2(x)+c} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \cos (x)^2}{c \sin (x)^2+c}dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \int \frac {a \tan ^2(x)+a+b}{2 c \tan ^4(x)+3 c \tan ^2(x)+c}d\tan (x)\) |
\(\Big \downarrow \) 1480 |
\(\displaystyle (a+2 b) \int \frac {1}{2 c \tan ^2(x)+c}d\tan (x)-2 b \int \frac {1}{2 c \tan ^2(x)+2 c}d\tan (x)\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {(a+2 b) \arctan \left (\sqrt {2} \tan (x)\right )}{\sqrt {2} c}-\frac {b \arctan (\tan (x))}{c}\) |
Input:
Int[(a + b*Cos[x]^2)/(c + c*Sin[x]^2),x]
Output:
-((b*ArcTan[Tan[x]])/c) + ((a + 2*b)*ArcTan[Sqrt[2]*Tan[x]])/(Sqrt[2]*c)
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[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] : > With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[(e/2 + (2*c*d - b*e)/(2*q)) Int[1/( b/2 - q/2 + c*x^2), x], x] + Simp[(e/2 - (2*c*d - b*e)/(2*q)) Int[1/(b/2 + q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^2 - 4*a*c]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Time = 0.28 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.52
method | result | size |
default | \(\frac {\frac {\left (a +2 b \right ) \sqrt {2}\, \arctan \left (\tan \left (x \right ) \sqrt {2}\right )}{2}-b \arctan \left (\tan \left (x \right )\right )}{c}\) | \(29\) |
parts | \(\frac {a \sqrt {2}\, \arctan \left (\tan \left (x \right ) \sqrt {2}\right )}{2 c}+\frac {b \left (\sqrt {2}\, \arctan \left (\tan \left (x \right ) \sqrt {2}\right )-\arctan \left (\tan \left (x \right )\right )\right )}{c}\) | \(40\) |
risch | \(-\frac {b x}{c}+\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}-3\right ) a}{4 c}+\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}-3\right ) b}{2 c}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}-3\right ) a}{4 c}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}-3\right ) b}{2 c}\) | \(101\) |
Input:
int((a+cos(x)^2*b)/(c+c*sin(x)^2),x,method=_RETURNVERBOSE)
Output:
1/c*(1/2*(a+2*b)*2^(1/2)*arctan(tan(x)*2^(1/2))-b*arctan(tan(x)))
Time = 0.08 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.80 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=-\frac {\sqrt {2} {\left (a + 2 \, b\right )} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (x\right )^{2} - 2 \, \sqrt {2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) + 4 \, b x}{4 \, c} \] Input:
integrate((a+b*cos(x)^2)/(c+c*sin(x)^2),x, algorithm="fricas")
Output:
-1/4*(sqrt(2)*(a + 2*b)*arctan(1/4*(3*sqrt(2)*cos(x)^2 - 2*sqrt(2))/(cos(x )*sin(x))) + 4*b*x)/c
Leaf count of result is larger than twice the leaf count of optimal. 520 vs. \(2 (49) = 98\).
Time = 24.33 (sec) , antiderivative size = 520, normalized size of antiderivative = 9.29 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx =\text {Too large to display} \] Input:
integrate((a+b*cos(x)**2)/(c+c*sin(x)**2),x)
Output:
54608393*sqrt(2)*a*sqrt(3 - 2*sqrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/(31988856*sqrt(2)*c + 45239074*c) + 77227930 *a*sqrt(3 - 2*sqrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/(31988856*sqrt(2)*c + 45239074*c) + 9369319*sqrt(2)*a*sqrt(2 *sqrt(2) + 3)*(atan(tan(x/2)/sqrt(2*sqrt(2) + 3)) + pi*floor((x/2 - pi/2)/ pi))/(31988856*sqrt(2)*c + 45239074*c) + 13250218*a*sqrt(2*sqrt(2) + 3)*(a tan(tan(x/2)/sqrt(2*sqrt(2) + 3)) + pi*floor((x/2 - pi/2)/pi))/(31988856*s qrt(2)*c + 45239074*c) - 45239074*b*x/(31988856*sqrt(2)*c + 45239074*c) - 31988856*sqrt(2)*b*x/(31988856*sqrt(2)*c + 45239074*c) + 109216786*sqrt(2) *b*sqrt(3 - 2*sqrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/(31988856*sqrt(2)*c + 45239074*c) + 154455860*b*sqrt(3 - 2*s qrt(2))*(atan(tan(x/2)/sqrt(3 - 2*sqrt(2))) + pi*floor((x/2 - pi/2)/pi))/( 31988856*sqrt(2)*c + 45239074*c) + 18738638*sqrt(2)*b*sqrt(2*sqrt(2) + 3)* (atan(tan(x/2)/sqrt(2*sqrt(2) + 3)) + pi*floor((x/2 - pi/2)/pi))/(31988856 *sqrt(2)*c + 45239074*c) + 26500436*b*sqrt(2*sqrt(2) + 3)*(atan(tan(x/2)/s qrt(2*sqrt(2) + 3)) + pi*floor((x/2 - pi/2)/pi))/(31988856*sqrt(2)*c + 452 39074*c)
Time = 0.12 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.50 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=\frac {\sqrt {2} {\left (a + 2 \, b\right )} \arctan \left (\sqrt {2} \tan \left (x\right )\right )}{2 \, c} - \frac {b x}{c} \] Input:
integrate((a+b*cos(x)^2)/(c+c*sin(x)^2),x, algorithm="maxima")
Output:
1/2*sqrt(2)*(a + 2*b)*arctan(sqrt(2)*tan(x))/c - b*x/c
Time = 0.11 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.11 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=\frac {\sqrt {2} {\left (a + 2 \, b\right )} {\left (x + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt {2} \cos \left (2 \, x\right ) + \sqrt {2} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )}}{2 \, c} - \frac {b x}{c} \] Input:
integrate((a+b*cos(x)^2)/(c+c*sin(x)^2),x, algorithm="giac")
Output:
1/2*sqrt(2)*(a + 2*b)*(x + arctan(-(sqrt(2)*sin(2*x) - 2*sin(2*x))/(sqrt(2 )*cos(2*x) + sqrt(2) - 2*cos(2*x) + 2)))/c - b*x/c
Time = 15.22 (sec) , antiderivative size = 249, normalized size of antiderivative = 4.45 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {4\,\sqrt {2}\,a^3\,\mathrm {tan}\left (x\right )}{4\,a^3+24\,a^2\,b+40\,a\,b^2+16\,b^3}+\frac {16\,\sqrt {2}\,b^3\,\mathrm {tan}\left (x\right )}{4\,a^3+24\,a^2\,b+40\,a\,b^2+16\,b^3}+\frac {40\,\sqrt {2}\,a\,b^2\,\mathrm {tan}\left (x\right )}{4\,a^3+24\,a^2\,b+40\,a\,b^2+16\,b^3}+\frac {24\,\sqrt {2}\,a^2\,b\,\mathrm {tan}\left (x\right )}{4\,a^3+24\,a^2\,b+40\,a\,b^2+16\,b^3}\right )\,\left (a+2\,b\right )}{2\,c}-\frac {b\,\mathrm {atan}\left (\frac {8\,b^3\,\mathrm {tan}\left (x\right )}{4\,a^2\,b+16\,a\,b^2+8\,b^3}+\frac {16\,a\,b^2\,\mathrm {tan}\left (x\right )}{4\,a^2\,b+16\,a\,b^2+8\,b^3}+\frac {4\,a^2\,b\,\mathrm {tan}\left (x\right )}{4\,a^2\,b+16\,a\,b^2+8\,b^3}\right )}{c} \] Input:
int((a + b*cos(x)^2)/(c + c*sin(x)^2),x)
Output:
(2^(1/2)*atan((4*2^(1/2)*a^3*tan(x))/(40*a*b^2 + 24*a^2*b + 4*a^3 + 16*b^3 ) + (16*2^(1/2)*b^3*tan(x))/(40*a*b^2 + 24*a^2*b + 4*a^3 + 16*b^3) + (40*2 ^(1/2)*a*b^2*tan(x))/(40*a*b^2 + 24*a^2*b + 4*a^3 + 16*b^3) + (24*2^(1/2)* a^2*b*tan(x))/(40*a*b^2 + 24*a^2*b + 4*a^3 + 16*b^3))*(a + 2*b))/(2*c) - ( b*atan((8*b^3*tan(x))/(16*a*b^2 + 4*a^2*b + 8*b^3) + (16*a*b^2*tan(x))/(16 *a*b^2 + 4*a^2*b + 8*b^3) + (4*a^2*b*tan(x))/(16*a*b^2 + 4*a^2*b + 8*b^3)) )/c
Time = 0.16 (sec) , antiderivative size = 117, normalized size of antiderivative = 2.09 \[ \int \frac {a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx=\frac {2 \sqrt {2}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {2}+1}\right ) a +4 \sqrt {2}\, \mathit {atan} \left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {2}+1}\right ) b -\sqrt {2}\, \mathrm {log}\left (-\sqrt {2}\, i +\tan \left (\frac {x}{2}\right )+i \right ) a i -2 \sqrt {2}\, \mathrm {log}\left (-\sqrt {2}\, i +\tan \left (\frac {x}{2}\right )+i \right ) b i +\sqrt {2}\, \mathrm {log}\left (\sqrt {2}\, i +\tan \left (\frac {x}{2}\right )-i \right ) a i +2 \sqrt {2}\, \mathrm {log}\left (\sqrt {2}\, i +\tan \left (\frac {x}{2}\right )-i \right ) b i -4 b x}{4 c} \] Input:
int((a+b*cos(x)^2)/(c+c*sin(x)^2),x)
Output:
(2*sqrt(2)*atan(tan(x/2)/(sqrt(2) + 1))*a + 4*sqrt(2)*atan(tan(x/2)/(sqrt( 2) + 1))*b - sqrt(2)*log( - sqrt(2)*i + tan(x/2) + i)*a*i - 2*sqrt(2)*log( - sqrt(2)*i + tan(x/2) + i)*b*i + sqrt(2)*log(sqrt(2)*i + tan(x/2) - i)*a *i + 2*sqrt(2)*log(sqrt(2)*i + tan(x/2) - i)*b*i - 4*b*x)/(4*c)