Integrand size = 9, antiderivative size = 91 \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\frac {3}{4} \text {arctanh}(2 \cos (x) \sin (x))+\frac {4 \log \left (\cos (x)-\sqrt {3} \sin (x)\right )}{3 \sqrt {3}}-\frac {4 \log \left (\cos (x)+\sqrt {3} \sin (x)\right )}{3 \sqrt {3}}+\frac {\tan (x)}{36}+\frac {\tan (x) \left (25-43 \tan ^2(x)\right )}{18 \left (1-4 \tan ^2(x)+3 \tan ^4(x)\right )} \] Output:
3/4*arctanh(2*cos(x)*sin(x))+4/9*ln(cos(x)-sin(x)*3^(1/2))*3^(1/2)-4/9*ln( cos(x)+sin(x)*3^(1/2))*3^(1/2)+1/36*tan(x)+tan(x)*(25-43*tan(x)^2)/(18-72* tan(x)^2+54*tan(x)^4)
Time = 0.26 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.69 \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\frac {1}{36} \left (-32 \sqrt {3} \text {arctanh}\left (\sqrt {3} \tan (x)\right )-27 \log (\cos (x)-\sin (x))+27 \log (\cos (x)+\sin (x))+\frac {16 \sin (2 x)}{-1+2 \cos (2 x)}+\tan (x)+9 \tan (2 x)\right ) \] Input:
Integrate[(Cos[x] + Cos[5*x])^(-2),x]
Output:
(-32*Sqrt[3]*ArcTanh[Sqrt[3]*Tan[x]] - 27*Log[Cos[x] - Sin[x]] + 27*Log[Co s[x] + Sin[x]] + (16*Sin[2*x])/(-1 + 2*Cos[2*x]) + Tan[x] + 9*Tan[2*x])/36
Time = 0.31 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.69, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.778, Rules used = {3042, 4823, 27, 1517, 27, 2205, 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 {1}{(\cos (x)+\cos (5 x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(\cos (x)+\cos (5 x))^2}dx\) |
\(\Big \downarrow \) 4823 |
\(\displaystyle \int \frac {\left (\tan ^2(x)+1\right )^4}{4 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )^2}d\tan (x)\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{4} \int \frac {\left (\tan ^2(x)+1\right )^4}{\left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )^2}d\tan (x)\) |
\(\Big \downarrow \) 1517 |
\(\displaystyle \frac {1}{4} \left (\frac {2 \tan (x) \left (25-43 \tan ^2(x)\right )}{9 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )}-\frac {1}{8} \int \frac {8 \left (-3 \tan ^4(x)+70 \tan ^2(x)+41\right )}{9 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )}d\tan (x)\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{4} \left (\frac {2 \tan (x) \left (25-43 \tan ^2(x)\right )}{9 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )}-\frac {1}{9} \int \frac {-3 \tan ^4(x)+70 \tan ^2(x)+41}{3 \tan ^4(x)-4 \tan ^2(x)+1}d\tan (x)\right )\) |
\(\Big \downarrow \) 2205 |
\(\displaystyle \frac {1}{4} \left (\frac {2 \tan (x) \left (25-43 \tan ^2(x)\right )}{9 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )}-\frac {1}{9} \int \left (\frac {6 \left (11 \tan ^2(x)+7\right )}{3 \tan ^4(x)-4 \tan ^2(x)+1}-1\right )d\tan (x)\right )\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{9} \left (54 \text {arctanh}(\tan (x))-32 \sqrt {3} \text {arctanh}\left (\sqrt {3} \tan (x)\right )+\tan (x)\right )+\frac {2 \tan (x) \left (25-43 \tan ^2(x)\right )}{9 \left (3 \tan ^4(x)-4 \tan ^2(x)+1\right )}\right )\) |
Input:
Int[(Cos[x] + Cos[5*x])^(-2),x]
Output:
((54*ArcTanh[Tan[x]] - 32*Sqrt[3]*ArcTanh[Sqrt[3]*Tan[x]] + Tan[x])/9 + (2 *Tan[x]*(25 - 43*Tan[x]^2))/(9*(1 - 4*Tan[x]^2 + 3*Tan[x]^4)))/4
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((d_) + (e_.)*(x_)^2)^(q_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x _Symbol] :> With[{f = Coeff[PolynomialRemainder[(d + e*x^2)^q, a + b*x^2 + c*x^4, x], x, 0], g = Coeff[PolynomialRemainder[(d + e*x^2)^q, a + b*x^2 + c*x^4, x], x, 2]}, Simp[x*(a + b*x^2 + c*x^4)^(p + 1)*((a*b*g - f*(b^2 - 2* a*c) - c*(b*f - 2*a*g)*x^2)/(2*a*(p + 1)*(b^2 - 4*a*c))), x] + Simp[1/(2*a* (p + 1)*(b^2 - 4*a*c)) Int[(a + b*x^2 + c*x^4)^(p + 1)*ExpandToSum[2*a*(p + 1)*(b^2 - 4*a*c)*PolynomialQuotient[(d + e*x^2)^q, a + b*x^2 + c*x^4, x] + b^2*f*(2*p + 3) - 2*a*c*f*(4*p + 5) - a*b*g + c*(4*p + 7)*(b*f - 2*a*g)* x^2, x], x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ [c*d^2 - b*d*e + a*e^2, 0] && IGtQ[q, 1] && LtQ[p, -1]
Int[(Px_)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> Int[ExpandInte grand[Px/(a + b*x^2 + c*x^4), x], x] /; FreeQ[{a, b, c}, x] && PolyQ[Px, x^ 2] && Expon[Px, x^2] > 1
Int[(cos[(m_.)*((c_.) + (d_.)*(x_))]*(a_.) + cos[(n_.)*((c_.) + (d_.)*(x_)) ]*(b_.))^(p_), x_Symbol] :> Simp[1/d Subst[Int[Simplify[TrigExpand[a*Cos[ m*ArcTan[x]] + b*Cos[n*ArcTan[x]]]]^p/(1 + x^2), x], x, Tan[c + d*x]], x] / ; FreeQ[{a, b, c, d}, x] && ILtQ[p/2, 0] && IntegerQ[(m - 1)/2] && IntegerQ [(n - 1)/2]
Time = 0.93 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.66
method | result | size |
default | \(\frac {\tan \left (x \right )}{36}-\frac {1}{4 \left (\tan \left (x \right )+1\right )}+\frac {3 \ln \left (\tan \left (x \right )+1\right )}{4}-\frac {8 \tan \left (x \right )}{27 \left (\tan \left (x \right )^{2}-\frac {1}{3}\right )}-\frac {8 \sqrt {3}\, \operatorname {arctanh}\left (\tan \left (x \right ) \sqrt {3}\right )}{9}-\frac {1}{4 \left (\tan \left (x \right )-1\right )}-\frac {3 \ln \left (\tan \left (x \right )-1\right )}{4}\) | \(60\) |
risch | \(-\frac {i \left ({\mathrm e}^{8 i x}-4 \,{\mathrm e}^{6 i x}-2 \,{\mathrm e}^{4 i x}-{\mathrm e}^{2 i x}-6\right )}{6 \left ({\mathrm e}^{10 i x}+{\mathrm e}^{6 i x}+{\mathrm e}^{4 i x}+1\right )}+\frac {4 \sqrt {3}\, \ln \left ({\mathrm e}^{2 i x}-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}{9}-\frac {4 \sqrt {3}\, \ln \left ({\mathrm e}^{2 i x}-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right )}{9}-\frac {3 \ln \left ({\mathrm e}^{2 i x}-i\right )}{4}+\frac {3 \ln \left ({\mathrm e}^{2 i x}+i\right )}{4}\) | \(112\) |
Input:
int(1/(cos(x)+cos(5*x))^2,x,method=_RETURNVERBOSE)
Output:
1/36*tan(x)-1/4/(tan(x)+1)+3/4*ln(tan(x)+1)-8/27*tan(x)/(tan(x)^2-1/3)-8/9 *3^(1/2)*arctanh(tan(x)*3^(1/2))-1/4/(tan(x)-1)-3/4*ln(tan(x)-1)
Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (73) = 146\).
Time = 0.09 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.89 \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\frac {27 \, {\left (8 \, \cos \left (x\right )^{5} - 10 \, \cos \left (x\right )^{3} + 3 \, \cos \left (x\right )\right )} \log \left (2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) - 27 \, {\left (8 \, \cos \left (x\right )^{5} - 10 \, \cos \left (x\right )^{3} + 3 \, \cos \left (x\right )\right )} \log \left (-2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) + 16 \, {\left (8 \, \sqrt {3} \cos \left (x\right )^{5} - 10 \, \sqrt {3} \cos \left (x\right )^{3} + 3 \, \sqrt {3} \cos \left (x\right )\right )} \log \left (-\frac {8 \, \cos \left (x\right )^{4} - 4 \, {\left (2 \, \sqrt {3} \cos \left (x\right )^{3} - 3 \, \sqrt {3} \cos \left (x\right )\right )} \sin \left (x\right ) - 9}{16 \, \cos \left (x\right )^{4} - 24 \, \cos \left (x\right )^{2} + 9}\right ) + 6 \, {\left (48 \, \cos \left (x\right )^{4} - 32 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{72 \, {\left (8 \, \cos \left (x\right )^{5} - 10 \, \cos \left (x\right )^{3} + 3 \, \cos \left (x\right )\right )}} \] Input:
integrate(1/(cos(x)+cos(5*x))^2,x, algorithm="fricas")
Output:
1/72*(27*(8*cos(x)^5 - 10*cos(x)^3 + 3*cos(x))*log(2*cos(x)*sin(x) + 1) - 27*(8*cos(x)^5 - 10*cos(x)^3 + 3*cos(x))*log(-2*cos(x)*sin(x) + 1) + 16*(8 *sqrt(3)*cos(x)^5 - 10*sqrt(3)*cos(x)^3 + 3*sqrt(3)*cos(x))*log(-(8*cos(x) ^4 - 4*(2*sqrt(3)*cos(x)^3 - 3*sqrt(3)*cos(x))*sin(x) - 9)/(16*cos(x)^4 - 24*cos(x)^2 + 9)) + 6*(48*cos(x)^4 - 32*cos(x)^2 + 1)*sin(x))/(8*cos(x)^5 - 10*cos(x)^3 + 3*cos(x))
\[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\int \frac {1}{\left (\cos {\left (x \right )} + \cos {\left (5 x \right )}\right )^{2}}\, dx \] Input:
integrate(1/(cos(x)+cos(5*x))**2,x)
Output:
Integral((cos(x) + cos(5*x))**(-2), x)
Exception generated. \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate(1/(cos(x)+cos(5*x))^2,x, algorithm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is un defined.
Time = 0.13 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.89 \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\frac {4}{9} \, \sqrt {3} \log \left (\frac {{\left | -2 \, \sqrt {3} + 6 \, \tan \left (x\right ) \right |}}{{\left | 2 \, \sqrt {3} + 6 \, \tan \left (x\right ) \right |}}\right ) - \frac {43 \, \tan \left (x\right )^{3} - 25 \, \tan \left (x\right )}{18 \, {\left (3 \, \tan \left (x\right )^{4} - 4 \, \tan \left (x\right )^{2} + 1\right )}} + \frac {3}{4} \, \log \left ({\left | \tan \left (x\right ) + 1 \right |}\right ) - \frac {3}{4} \, \log \left ({\left | \tan \left (x\right ) - 1 \right |}\right ) + \frac {1}{36} \, \tan \left (x\right ) \] Input:
integrate(1/(cos(x)+cos(5*x))^2,x, algorithm="giac")
Output:
4/9*sqrt(3)*log(abs(-2*sqrt(3) + 6*tan(x))/abs(2*sqrt(3) + 6*tan(x))) - 1/ 18*(43*tan(x)^3 - 25*tan(x))/(3*tan(x)^4 - 4*tan(x)^2 + 1) + 3/4*log(abs(t an(x) + 1)) - 3/4*log(abs(tan(x) - 1)) + 1/36*tan(x)
Time = 22.06 (sec) , antiderivative size = 95, normalized size of antiderivative = 1.04 \[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\frac {3\,\sin \left (3\,x\right )+9\,\sin \left (5\,x\right )-3\,\sin \left (x\right )+27\,\cos \left (x\right )\,\mathrm {atanh}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )+27\,\cos \left (5\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )-16\,\sqrt {3}\,\cos \left (5\,x\right )\,\mathrm {atanh}\left (\frac {\sqrt {3}\,\sin \left (x\right )}{\cos \left (x\right )}\right )-16\,\sqrt {3}\,\mathrm {atanh}\left (\frac {\sqrt {3}\,\sin \left (x\right )}{\cos \left (x\right )}\right )\,\cos \left (x\right )}{18\,\cos \left (5\,x\right )+18\,\cos \left (x\right )} \] Input:
int(1/(cos(5*x) + cos(x))^2,x)
Output:
(3*sin(3*x) + 9*sin(5*x) - 3*sin(x) + 27*cos(x)*atanh(sin(x)/cos(x)) + 27* cos(5*x)*atanh(sin(x)/cos(x)) - 16*3^(1/2)*cos(5*x)*atanh((3^(1/2)*sin(x)) /cos(x)) - 16*3^(1/2)*atanh((3^(1/2)*sin(x))/cos(x))*cos(x))/(18*cos(5*x) + 18*cos(x))
\[ \int \frac {1}{(\cos (x)+\cos (5 x))^2} \, dx=\int \frac {1}{\cos \left (5 x \right )^{2}+2 \cos \left (5 x \right ) \cos \left (x \right )+\cos \left (x \right )^{2}}d x \] Input:
int(1/(cos(x)+cos(5*x))^2,x)
Output:
int(1/(cos(5*x)**2 + 2*cos(5*x)*cos(x) + cos(x)**2),x)