Integrand size = 11, antiderivative size = 82 \[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=\frac {1}{2} \text {arctanh}(\sin (x))+\frac {1}{2} \sqrt {\frac {1}{2} \left (2-\sqrt {2}\right )} \text {arctanh}\left (\frac {2 \sin (x)}{\sqrt {2-\sqrt {2}}}\right )-\frac {1}{2} \sqrt {\frac {1}{2} \left (2+\sqrt {2}\right )} \text {arctanh}\left (\frac {2 \sin (x)}{\sqrt {2+\sqrt {2}}}\right ) \] Output:
1/2*arctanh(sin(x))+1/4*(4-2*2^(1/2))^(1/2)*arctanh(2*sin(x)/(2-2^(1/2))^( 1/2))-1/4*(4+2*2^(1/2))^(1/2)*arctanh(2*sin(x)/(2+2^(1/2))^(1/2))
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.04 (sec) , antiderivative size = 210, normalized size of antiderivative = 2.56 \[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=-\frac {1}{2} \log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\frac {1}{2} \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )-\frac {1}{16} \text {RootSum}\left [1+\text {$\#$1}^8\&,\frac {2 \arctan \left (\frac {\sin (x)}{\cos (x)-\text {$\#$1}}\right )-i \log \left (1-2 \cos (x) \text {$\#$1}+\text {$\#$1}^2\right )-2 \arctan \left (\frac {\sin (x)}{\cos (x)-\text {$\#$1}}\right ) \text {$\#$1}^2+i \log \left (1-2 \cos (x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^2-2 \arctan \left (\frac {\sin (x)}{\cos (x)-\text {$\#$1}}\right ) \text {$\#$1}^4+i \log \left (1-2 \cos (x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^4+2 \arctan \left (\frac {\sin (x)}{\cos (x)-\text {$\#$1}}\right ) \text {$\#$1}^6-i \log \left (1-2 \cos (x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^6}{\text {$\#$1}^7}\&\right ] \] Input:
Integrate[(Cos[3*x] + Cos[5*x])^(-1),x]
Output:
-1/2*Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]]/2 - RootSum[1 + # 1^8 & , (2*ArcTan[Sin[x]/(Cos[x] - #1)] - I*Log[1 - 2*Cos[x]*#1 + #1^2] - 2*ArcTan[Sin[x]/(Cos[x] - #1)]*#1^2 + I*Log[1 - 2*Cos[x]*#1 + #1^2]*#1^2 - 2*ArcTan[Sin[x]/(Cos[x] - #1)]*#1^4 + I*Log[1 - 2*Cos[x]*#1 + #1^2]*#1^4 + 2*ArcTan[Sin[x]/(Cos[x] - #1)]*#1^6 - I*Log[1 - 2*Cos[x]*#1 + #1^2]*#1^6 )/#1^7 & ]/16
Time = 0.33 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.94, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.455, Rules used = {3042, 4825, 27, 1484, 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 (3 x)+\cos (5 x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\cos (3 x)+\cos (5 x)}dx\) |
\(\Big \downarrow \) 4825 |
\(\displaystyle \int \frac {1}{2 \left (1-\sin ^2(x)\right ) \left (8 \sin ^4(x)-8 \sin ^2(x)+1\right )}d\sin (x)\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \int \frac {1}{\left (1-\sin ^2(x)\right ) \left (8 \sin ^4(x)-8 \sin ^2(x)+1\right )}d\sin (x)\) |
\(\Big \downarrow \) 1484 |
\(\displaystyle \frac {1}{2} \int \left (\frac {8 \sin ^2(x)}{8 \sin ^4(x)-8 \sin ^2(x)+1}+\frac {1}{1-\sin ^2(x)}\right )d\sin (x)\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{2} \left (\text {arctanh}(\sin (x))+\sqrt {\frac {1}{2} \left (2-\sqrt {2}\right )} \text {arctanh}\left (\frac {2 \sin (x)}{\sqrt {2-\sqrt {2}}}\right )-\sqrt {\frac {1}{2} \left (2+\sqrt {2}\right )} \text {arctanh}\left (\frac {2 \sin (x)}{\sqrt {2+\sqrt {2}}}\right )\right )\) |
Input:
Int[(Cos[3*x] + Cos[5*x])^(-1),x]
Output:
(ArcTanh[Sin[x]] + Sqrt[(2 - Sqrt[2])/2]*ArcTanh[(2*Sin[x])/Sqrt[2 - Sqrt[ 2]]] - Sqrt[(2 + Sqrt[2])/2]*ArcTanh[(2*Sin[x])/Sqrt[2 + Sqrt[2]]])/2
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), x_Symb ol] :> Int[ExpandIntegrand[(d + e*x^2)^q/(a + b*x^2 + c*x^4), x], x] /; Fre eQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[q]
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*ArcSin[x]] + b*Cos[n*ArcSin[x]]]]^p/Sqrt[1 - x^2], x], x, Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && ILtQ[(p - 1)/2, 0] && IntegerQ[(m - 1)/2] & & IntegerQ[(n - 1)/2]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.76 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.82
method | result | size |
risch | \(-\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{2}+\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{2}+\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (512 \textit {\_Z}^{4}-64 \textit {\_Z}^{2}+1\right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{2 i x}+\left (-128 i \textit {\_R}^{3}+8 i \textit {\_R} \right ) {\mathrm e}^{i x}-1\right )\right )\) | \(67\) |
default | \(\frac {\ln \left (1+\sin \left (x \right )\right )}{4}-\frac {\left (\sqrt {2}-2\right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {2 \sin \left (x \right )}{\sqrt {2-\sqrt {2}}}\right )}{4 \sqrt {2-\sqrt {2}}}-\frac {\sqrt {2}\, \sqrt {2+\sqrt {2}}\, \operatorname {arctanh}\left (\frac {2 \sin \left (x \right )}{\sqrt {2+\sqrt {2}}}\right )}{4}-\frac {\ln \left (\sin \left (x \right )-1\right )}{4}\) | \(73\) |
Input:
int(1/(cos(3*x)+cos(5*x)),x,method=_RETURNVERBOSE)
Output:
-1/2*ln(exp(I*x)-I)+1/2*ln(exp(I*x)+I)+sum(_R*ln(exp(2*I*x)+(-128*I*_R^3+8 *I*_R)*exp(I*x)-1),_R=RootOf(512*_Z^4-64*_Z^2+1))
Leaf count of result is larger than twice the leaf count of optimal. 137 vs. \(2 (54) = 108\).
Time = 0.09 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.67 \[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=-\frac {1}{4} \, \sqrt {\frac {1}{2} \, \sqrt {2} + 1} \log \left (\sqrt {2} \sqrt {\frac {1}{2} \, \sqrt {2} + 1} + 2 \, \sin \left (x\right )\right ) + \frac {1}{4} \, \sqrt {\frac {1}{2} \, \sqrt {2} + 1} \log \left (\sqrt {2} \sqrt {\frac {1}{2} \, \sqrt {2} + 1} - 2 \, \sin \left (x\right )\right ) + \frac {1}{4} \, \sqrt {-\frac {1}{2} \, \sqrt {2} + 1} \log \left (\sqrt {2} \sqrt {-\frac {1}{2} \, \sqrt {2} + 1} + 2 \, \sin \left (x\right )\right ) - \frac {1}{4} \, \sqrt {-\frac {1}{2} \, \sqrt {2} + 1} \log \left (\sqrt {2} \sqrt {-\frac {1}{2} \, \sqrt {2} + 1} - 2 \, \sin \left (x\right )\right ) + \frac {1}{4} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{4} \, \log \left (-\sin \left (x\right ) + 1\right ) \] Input:
integrate(1/(cos(3*x)+cos(5*x)),x, algorithm="fricas")
Output:
-1/4*sqrt(1/2*sqrt(2) + 1)*log(sqrt(2)*sqrt(1/2*sqrt(2) + 1) + 2*sin(x)) + 1/4*sqrt(1/2*sqrt(2) + 1)*log(sqrt(2)*sqrt(1/2*sqrt(2) + 1) - 2*sin(x)) + 1/4*sqrt(-1/2*sqrt(2) + 1)*log(sqrt(2)*sqrt(-1/2*sqrt(2) + 1) + 2*sin(x)) - 1/4*sqrt(-1/2*sqrt(2) + 1)*log(sqrt(2)*sqrt(-1/2*sqrt(2) + 1) - 2*sin(x )) + 1/4*log(sin(x) + 1) - 1/4*log(-sin(x) + 1)
\[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=\int \frac {1}{\cos {\left (3 x \right )} + \cos {\left (5 x \right )}}\, dx \] Input:
integrate(1/(cos(3*x)+cos(5*x)),x)
Output:
Integral(1/(cos(3*x) + cos(5*x)), x)
\[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=\int { \frac {1}{\cos \left (5 \, x\right ) + \cos \left (3 \, x\right )} \,d x } \] Input:
integrate(1/(cos(3*x)+cos(5*x)),x, algorithm="maxima")
Output:
-integrate(((cos(7*x) - cos(5*x) - cos(3*x) + cos(x))*cos(8*x) + (sin(7*x) - sin(5*x) - sin(3*x) + sin(x))*sin(8*x) + cos(7*x) - cos(5*x) - cos(3*x) + cos(x))/(cos(8*x)^2 + sin(8*x)^2 + 2*cos(8*x) + 1), x) + 1/4*log(cos(x) ^2 + sin(x)^2 + 2*sin(x) + 1) - 1/4*log(cos(x)^2 + sin(x)^2 - 2*sin(x) + 1 )
Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (54) = 108\).
Time = 0.16 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.45 \[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=-\frac {1}{8} \, \sqrt {2 \, \sqrt {2} + 4} \log \left ({\left | \frac {1}{2} \, \sqrt {\sqrt {2} + 2} + \sin \left (x\right ) \right |}\right ) + \frac {1}{8} \, \sqrt {2 \, \sqrt {2} + 4} \log \left ({\left | -\frac {1}{2} \, \sqrt {\sqrt {2} + 2} + \sin \left (x\right ) \right |}\right ) + \frac {1}{8} \, \sqrt {-2 \, \sqrt {2} + 4} \log \left ({\left | \sqrt {-\frac {1}{4} \, \sqrt {2} + \frac {1}{2}} + \sin \left (x\right ) \right |}\right ) - \frac {1}{8} \, \sqrt {-2 \, \sqrt {2} + 4} \log \left ({\left | -\sqrt {-\frac {1}{4} \, \sqrt {2} + \frac {1}{2}} + \sin \left (x\right ) \right |}\right ) + \frac {1}{4} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac {1}{4} \, \log \left (-\sin \left (x\right ) + 1\right ) \] Input:
integrate(1/(cos(3*x)+cos(5*x)),x, algorithm="giac")
Output:
-1/8*sqrt(2*sqrt(2) + 4)*log(abs(1/2*sqrt(sqrt(2) + 2) + sin(x))) + 1/8*sq rt(2*sqrt(2) + 4)*log(abs(-1/2*sqrt(sqrt(2) + 2) + sin(x))) + 1/8*sqrt(-2* sqrt(2) + 4)*log(abs(sqrt(-1/4*sqrt(2) + 1/2) + sin(x))) - 1/8*sqrt(-2*sqr t(2) + 4)*log(abs(-sqrt(-1/4*sqrt(2) + 1/2) + sin(x))) + 1/4*log(sin(x) + 1) - 1/4*log(-sin(x) + 1)
Time = 21.10 (sec) , antiderivative size = 193, normalized size of antiderivative = 2.35 \[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=\mathrm {atanh}\left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )-\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {363663470886912\,\sin \left (\frac {x}{2}\right )\,\sqrt {\sqrt {2}+2}}{\frac {219490008694784\,\sqrt {2}}{\cos \left (\frac {x}{2}\right )}+\frac {310405876416512}{\cos \left (\frac {x}{2}\right )}}+\frac {257148281946112\,\sqrt {2}\,\sin \left (\frac {x}{2}\right )\,\sqrt {\sqrt {2}+2}}{\frac {219490008694784\,\sqrt {2}}{\cos \left (\frac {x}{2}\right )}+\frac {310405876416512}{\cos \left (\frac {x}{2}\right )}}\right )\,\sqrt {\sqrt {2}+2}}{4}-\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {363663470886912\,\sin \left (\frac {x}{2}\right )\,\sqrt {2-\sqrt {2}}}{\frac {219490008694784\,\sqrt {2}}{\cos \left (\frac {x}{2}\right )}-\frac {310405876416512}{\cos \left (\frac {x}{2}\right )}}-\frac {257148281946112\,\sqrt {2}\,\sin \left (\frac {x}{2}\right )\,\sqrt {2-\sqrt {2}}}{\frac {219490008694784\,\sqrt {2}}{\cos \left (\frac {x}{2}\right )}-\frac {310405876416512}{\cos \left (\frac {x}{2}\right )}}\right )\,\sqrt {2-\sqrt {2}}}{4} \] Input:
int(1/(cos(3*x) + cos(5*x)),x)
Output:
atanh(sin(x/2)/cos(x/2)) - (2^(1/2)*atanh((363663470886912*sin(x/2)*(2^(1/ 2) + 2)^(1/2))/((219490008694784*2^(1/2))/cos(x/2) + 310405876416512/cos(x /2)) + (257148281946112*2^(1/2)*sin(x/2)*(2^(1/2) + 2)^(1/2))/((2194900086 94784*2^(1/2))/cos(x/2) + 310405876416512/cos(x/2)))*(2^(1/2) + 2)^(1/2))/ 4 - (2^(1/2)*atanh((363663470886912*sin(x/2)*(2 - 2^(1/2))^(1/2))/((219490 008694784*2^(1/2))/cos(x/2) - 310405876416512/cos(x/2)) - (257148281946112 *2^(1/2)*sin(x/2)*(2 - 2^(1/2))^(1/2))/((219490008694784*2^(1/2))/cos(x/2) - 310405876416512/cos(x/2)))*(2 - 2^(1/2))^(1/2))/4
\[ \int \frac {1}{\cos (3 x)+\cos (5 x)} \, dx=\int \frac {1}{\cos \left (5 x \right )+\cos \left (3 x \right )}d x \] Input:
int(1/(cos(3*x)+cos(5*x)),x)
Output:
int(1/(cos(5*x) + cos(3*x)),x)