Integrand size = 17, antiderivative size = 230 \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\frac {2 \left (1-\frac {b}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {\sqrt {b-2 c-\sqrt {b^2-4 a c}} \tan \left (\frac {x}{2}\right )}{\sqrt {b+2 c-\sqrt {b^2-4 a c}}}\right )}{\sqrt {b-2 c-\sqrt {b^2-4 a c}} \sqrt {b+2 c-\sqrt {b^2-4 a c}}}+\frac {2 \left (1+\frac {b}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {\sqrt {b-2 c+\sqrt {b^2-4 a c}} \tan \left (\frac {x}{2}\right )}{\sqrt {b+2 c+\sqrt {b^2-4 a c}}}\right )}{\sqrt {b-2 c+\sqrt {b^2-4 a c}} \sqrt {b+2 c+\sqrt {b^2-4 a c}}} \] Output:
2*(1-b/(-4*a*c+b^2)^(1/2))*arctan((b-2*c-(-4*a*c+b^2)^(1/2))^(1/2)*tan(1/2 *x)/(b+2*c-(-4*a*c+b^2)^(1/2))^(1/2))/(b-2*c-(-4*a*c+b^2)^(1/2))^(1/2)/(b+ 2*c-(-4*a*c+b^2)^(1/2))^(1/2)+2*(1+b/(-4*a*c+b^2)^(1/2))*arctan((b-2*c+(-4 *a*c+b^2)^(1/2))^(1/2)*tan(1/2*x)/(b+2*c+(-4*a*c+b^2)^(1/2))^(1/2))/(b-2*c +(-4*a*c+b^2)^(1/2))^(1/2)/(b+2*c+(-4*a*c+b^2)^(1/2))^(1/2)
Time = 0.78 (sec) , antiderivative size = 227, normalized size of antiderivative = 0.99 \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\frac {\sqrt {2} \left (-\frac {\left (b+\sqrt {b^2-4 a c}\right ) \text {arctanh}\left (\frac {\left (b-2 c+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {-2 b^2+4 c (a+c)-2 b \sqrt {b^2-4 a c}}}\right )}{\sqrt {-b^2+2 c (a+c)-b \sqrt {b^2-4 a c}}}+\frac {\left (-b+\sqrt {b^2-4 a c}\right ) \text {arctanh}\left (\frac {\left (-b+2 c+\sqrt {b^2-4 a c}\right ) \tan \left (\frac {x}{2}\right )}{\sqrt {-2 b^2+4 c (a+c)+2 b \sqrt {b^2-4 a c}}}\right )}{\sqrt {-b^2+2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c}} \] Input:
Integrate[Cos[x]/(a + b*Cos[x] + c*Cos[x]^2),x]
Output:
(Sqrt[2]*(-(((b + Sqrt[b^2 - 4*a*c])*ArcTanh[((b - 2*c + Sqrt[b^2 - 4*a*c] )*Tan[x/2])/Sqrt[-2*b^2 + 4*c*(a + c) - 2*b*Sqrt[b^2 - 4*a*c]]])/Sqrt[-b^2 + 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]]) + ((-b + Sqrt[b^2 - 4*a*c])*ArcTanh [((-b + 2*c + Sqrt[b^2 - 4*a*c])*Tan[x/2])/Sqrt[-2*b^2 + 4*c*(a + c) + 2*b *Sqrt[b^2 - 4*a*c]]])/Sqrt[-b^2 + 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]]))/Sqr t[b^2 - 4*a*c]
Time = 0.64 (sec) , antiderivative size = 230, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {3042, 3738, 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 {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (x)}{a+b \cos (x)+c \cos (x)^2}dx\) |
\(\Big \downarrow \) 3738 |
\(\displaystyle \int \left (\frac {1-\frac {b}{\sqrt {b^2-4 a c}}}{-\sqrt {b^2-4 a c}+b+2 c \cos (x)}+\frac {\frac {b}{\sqrt {b^2-4 a c}}+1}{\sqrt {b^2-4 a c}+b+2 c \cos (x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {2 \left (1-\frac {b}{\sqrt {b^2-4 a c}}\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \sqrt {-\sqrt {b^2-4 a c}+b-2 c}}{\sqrt {-\sqrt {b^2-4 a c}+b+2 c}}\right )}{\sqrt {-\sqrt {b^2-4 a c}+b-2 c} \sqrt {-\sqrt {b^2-4 a c}+b+2 c}}+\frac {2 \left (\frac {b}{\sqrt {b^2-4 a c}}+1\right ) \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \sqrt {\sqrt {b^2-4 a c}+b-2 c}}{\sqrt {\sqrt {b^2-4 a c}+b+2 c}}\right )}{\sqrt {\sqrt {b^2-4 a c}+b-2 c} \sqrt {\sqrt {b^2-4 a c}+b+2 c}}\) |
Input:
Int[Cos[x]/(a + b*Cos[x] + c*Cos[x]^2),x]
Output:
(2*(1 - b/Sqrt[b^2 - 4*a*c])*ArcTan[(Sqrt[b - 2*c - Sqrt[b^2 - 4*a*c]]*Tan [x/2])/Sqrt[b + 2*c - Sqrt[b^2 - 4*a*c]]])/(Sqrt[b - 2*c - Sqrt[b^2 - 4*a* c]]*Sqrt[b + 2*c - Sqrt[b^2 - 4*a*c]]) + (2*(1 + b/Sqrt[b^2 - 4*a*c])*ArcT an[(Sqrt[b - 2*c + Sqrt[b^2 - 4*a*c]]*Tan[x/2])/Sqrt[b + 2*c + Sqrt[b^2 - 4*a*c]]])/(Sqrt[b - 2*c + Sqrt[b^2 - 4*a*c]]*Sqrt[b + 2*c + Sqrt[b^2 - 4*a *c]])
Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + cos[(d_.) + (e_.)*(x_)]^(n_.)*(b _.) + cos[(d_.) + (e_.)*(x_)]^(n2_.)*(c_.))^(p_), x_Symbol] :> Int[ExpandTr ig[cos[d + e*x]^m*(a + b*cos[d + e*x]^n + c*cos[d + e*x]^(2*n))^p, x], x] / ; FreeQ[{a, b, c, d, e}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && Integ ersQ[m, n, p]
Time = 0.70 (sec) , antiderivative size = 208, normalized size of antiderivative = 0.90
method | result | size |
default | \(2 \left (a -b +c \right ) \left (\frac {\left (2 a -b -\sqrt {-4 a c +b^{2}}\right ) \operatorname {arctanh}\left (\frac {\left (-a +b -c \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (\sqrt {-4 a c +b^{2}}-a +c \right ) \left (a -b +c \right )}}\right )}{2 \sqrt {-4 a c +b^{2}}\, \left (a -b +c \right ) \sqrt {\left (\sqrt {-4 a c +b^{2}}-a +c \right ) \left (a -b +c \right )}}+\frac {\left (-2 a +b -\sqrt {-4 a c +b^{2}}\right ) \arctan \left (\frac {\left (a -b +c \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (\sqrt {-4 a c +b^{2}}+a -c \right ) \left (a -b +c \right )}}\right )}{2 \sqrt {-4 a c +b^{2}}\, \left (a -b +c \right ) \sqrt {\left (\sqrt {-4 a c +b^{2}}+a -c \right ) \left (a -b +c \right )}}\right )\) | \(208\) |
risch | \(\munderset {\textit {\_R} =\operatorname {RootOf}\left (\left (16 a^{4} c^{2}-8 a^{3} b^{2} c +32 a^{3} c^{3}+a^{2} b^{4}-32 a^{2} b^{2} c^{2}+16 a^{2} c^{4}+10 a \,b^{4} c -8 a \,b^{2} c^{3}-b^{6}+b^{4} c^{2}\right ) \textit {\_Z}^{4}+\left (-8 a^{3} c +2 b^{2} a^{2}-8 a^{2} c^{2}+6 a \,b^{2} c -b^{4}\right ) \textit {\_Z}^{2}+a^{2}\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{i x}+\left (4 i a^{3}-\frac {i a^{2} b^{2}}{c}+4 i c \,a^{2}-5 i a \,b^{2}-4 i c^{2} a +\frac {i b^{4}}{c}+5 i c \,b^{2}-4 i c^{3}-\frac {i b^{4}}{a}+\frac {i c^{2} b^{2}}{a}\right ) \textit {\_R}^{3}+\left (-\frac {4 a^{3}}{b}+\frac {a^{2} b}{c}-\frac {8 a^{2} c}{b}+6 a b -\frac {4 c^{2} a}{b}-\frac {b^{3}}{c}+c b \right ) \textit {\_R}^{2}+\left (-\frac {i a^{2}}{c}+2 i a +3 i c -\frac {i b^{2}}{a}\right ) \textit {\_R} +\frac {a^{2}}{c b}+\frac {a}{b}\right )\) | \(326\) |
Input:
int(cos(x)/(a+b*cos(x)+c*cos(x)^2),x,method=_RETURNVERBOSE)
Output:
2*(a-b+c)*(1/2*(2*a-b-(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2)/(a-b+c)/(((-4 *a*c+b^2)^(1/2)-a+c)*(a-b+c))^(1/2)*arctanh((-a+b-c)*tan(1/2*x)/(((-4*a*c+ b^2)^(1/2)-a+c)*(a-b+c))^(1/2))+1/2*(-2*a+b-(-4*a*c+b^2)^(1/2))/(-4*a*c+b^ 2)^(1/2)/(a-b+c)/(((-4*a*c+b^2)^(1/2)+a-c)*(a-b+c))^(1/2)*arctan((a-b+c)*t an(1/2*x)/(((-4*a*c+b^2)^(1/2)+a-c)*(a-b+c))^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 3513 vs. \(2 (189) = 378\).
Time = 0.37 (sec) , antiderivative size = 3513, normalized size of antiderivative = 15.27 \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\text {Too large to display} \] Input:
integrate(cos(x)/(a+b*cos(x)+c*cos(x)^2),x, algorithm="fricas")
Output:
Too large to include
Timed out. \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\text {Timed out} \] Input:
integrate(cos(x)/(a+b*cos(x)+c*cos(x)**2),x)
Output:
Timed out
\[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\int { \frac {\cos \left (x\right )}{c \cos \left (x\right )^{2} + b \cos \left (x\right ) + a} \,d x } \] Input:
integrate(cos(x)/(a+b*cos(x)+c*cos(x)^2),x, algorithm="maxima")
Output:
integrate(cos(x)/(c*cos(x)^2 + b*cos(x) + a), x)
Leaf count of result is larger than twice the leaf count of optimal. 2975 vs. \(2 (189) = 378\).
Time = 2.62 (sec) , antiderivative size = 2975, normalized size of antiderivative = 12.93 \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\text {Too large to display} \] Input:
integrate(cos(x)/(a+b*cos(x)+c*cos(x)^2),x, algorithm="giac")
Output:
-(4*a^3*b^2 - 6*a^2*b^3 - 4*a*b^4 + 6*b^5 - 16*a^4*c + 24*a^3*b*c + 40*a^2 *b^2*c - 44*a*b^3*c - 8*b^4*c - 96*a^3*c^2 + 80*a^2*b*c^2 + 52*a*b^2*c^2 + 2*b^3*c^2 - 80*a^2*c^3 - 8*a*b*c^3 - 3*sqrt(a^2 - a*b + b*c - c^2 + sqrt( b^2 - 4*a*c)*(a - b + c))*a^2*b^2 + 2*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^ 2 - 4*a*c)*(a - b + c))*a*b^3 + 5*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*b^4 + 12*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c )*(a - b + c))*a^3*c - 8*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*a^2*b*c - 34*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*a*b^2*c - 6*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*b^3*c + 56*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*a^2*c^2 + 24*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*a*b*c^2 + 5*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c) )*b^2*c^2 - 20*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c)) *a*c^3 + 6*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*sqr t(b^2 - 4*a*c)*a^3 - 4*(b^2 - 4*a*c)*a^3 - sqrt(a^2 - a*b + b*c - c^2 + sq rt(b^2 - 4*a*c)*(a - b + c))*sqrt(b^2 - 4*a*c)*a^2*b + 6*(b^2 - 4*a*c)*a^2 *b - 12*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*sqrt(b ^2 - 4*a*c)*a*b^2 + 4*(b^2 - 4*a*c)*a*b^2 - 5*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*sqrt(b^2 - 4*a*c)*b^3 - 6*(b^2 - 4*a*c)*b^ 3 + 28*sqrt(a^2 - a*b + b*c - c^2 + sqrt(b^2 - 4*a*c)*(a - b + c))*sqrt...
Time = 6.97 (sec) , antiderivative size = 5488, normalized size of antiderivative = 23.86 \[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\text {Too large to display} \] Input:
int(cos(x)/(a + b*cos(x) + c*cos(x)^2),x)
Output:
atan(((tan(x/2)*(96*a*b^2 - 128*a^2*b - 64*a*c^2 + 32*b^2*c + 64*a^3 - 32* b^3) + ((8*a^3*c + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 - 2*a^2*b^2 + 8*a^2*c^ 2 - 6*a*b^2*c)/(2*(a^2*b^4 - b^6 + 16*a^2*c^4 + 32*a^3*c^3 + 16*a^4*c^2 + b^4*c^2 - 8*a*b^2*c^3 - 8*a^3*b^2*c - 32*a^2*b^2*c^2 + 10*a*b^4*c)))^(1/2) *(64*a*b^3 + 128*a*c^3 + 128*a^3*c + 64*b^3*c - 32*b^4 - 32*a^2*b^2 + 256* a^2*c^2 - 32*b^2*c^2 + tan(x/2)*((8*a^3*c + b*(-(4*a*c - b^2)^3)^(1/2) + b ^4 - 2*a^2*b^2 + 8*a^2*c^2 - 6*a*b^2*c)/(2*(a^2*b^4 - b^6 + 16*a^2*c^4 + 3 2*a^3*c^3 + 16*a^4*c^2 + b^4*c^2 - 8*a*b^2*c^3 - 8*a^3*b^2*c - 32*a^2*b^2* c^2 + 10*a*b^4*c)))^(1/2)*(64*a*b^4 + 256*a*c^4 - 256*a^4*c - 64*b^4*c - 1 28*a^2*b^3 + 64*a^3*b^2 + 256*a^2*c^3 - 256*a^3*c^2 - 64*b^2*c^3 + 128*b^3 *c^2 + 192*a*b^2*c^2 - 192*a^2*b^2*c - 512*a*b*c^3 + 512*a^3*b*c) - 256*a* b*c^2 + 64*a*b^2*c - 256*a^2*b*c))*((8*a^3*c + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 - 2*a^2*b^2 + 8*a^2*c^2 - 6*a*b^2*c)/(2*(a^2*b^4 - b^6 + 16*a^2*c^4 + 32*a^3*c^3 + 16*a^4*c^2 + b^4*c^2 - 8*a*b^2*c^3 - 8*a^3*b^2*c - 32*a^2*b ^2*c^2 + 10*a*b^4*c)))^(1/2)*1i + (tan(x/2)*(96*a*b^2 - 128*a^2*b - 64*a*c ^2 + 32*b^2*c + 64*a^3 - 32*b^3) - ((8*a^3*c + b*(-(4*a*c - b^2)^3)^(1/2) + b^4 - 2*a^2*b^2 + 8*a^2*c^2 - 6*a*b^2*c)/(2*(a^2*b^4 - b^6 + 16*a^2*c^4 + 32*a^3*c^3 + 16*a^4*c^2 + b^4*c^2 - 8*a*b^2*c^3 - 8*a^3*b^2*c - 32*a^2*b ^2*c^2 + 10*a*b^4*c)))^(1/2)*(64*a*b^3 + 128*a*c^3 + 128*a^3*c + 64*b^3*c - 32*b^4 - 32*a^2*b^2 + 256*a^2*c^2 - 32*b^2*c^2 - tan(x/2)*((8*a^3*c +...
\[ \int \frac {\cos (x)}{a+b \cos (x)+c \cos ^2(x)} \, dx=\int \frac {\cos \left (x \right )}{a +\cos \left (x \right ) b +c \cos \left (x \right )^{2}}d x \] Input:
int(cos(x)/(a+b*cos(x)+c*cos(x)^2),x)
Output:
int(cos(x)/(a+b*cos(x)+c*cos(x)^2),x)