Integrand size = 7, antiderivative size = 28 \[ \int \cos (x) \cot (4 x) \, dx=-\frac {1}{4} \text {arctanh}(\cos (x))-\frac {\text {arctanh}\left (\sqrt {2} \cos (x)\right )}{2 \sqrt {2}}+\cos (x) \]
Result contains complex when optimal does not.
Time = 0.11 (sec) , antiderivative size = 73, normalized size of antiderivative = 2.61 \[ \int \cos (x) \cot (4 x) \, dx=\frac {1}{4} \left ((-1-i) (-1)^{3/4} \text {arctanh}\left (\frac {-1+\tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right )-(1-i) \sqrt [4]{-1} \text {arctanh}\left (\frac {1+\tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right )+4 \cos (x)-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \]
((-1 - I)*(-1)^(3/4)*ArcTanh[(-1 + Tan[x/2])/Sqrt[2]] - (1 - I)*(-1)^(1/4) *ArcTanh[(1 + Tan[x/2])/Sqrt[2]] + 4*Cos[x] - Log[Cos[x/2]] + Log[Sin[x/2] ])/4
Time = 0.24 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.714, Rules used = {3042, 4879, 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 \cos (x) \cot (4 x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \cos (x) \cot (4 x)dx\) |
\(\Big \downarrow \) 4879 |
\(\displaystyle -\int -\frac {8 \cos ^4(x)-8 \cos ^2(x)+1}{4 \left (2 \cos ^4(x)-3 \cos ^2(x)+1\right )}d\cos (x)\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{4} \int \frac {8 \cos ^4(x)-8 \cos ^2(x)+1}{2 \cos ^4(x)-3 \cos ^2(x)+1}d\cos (x)\) |
\(\Big \downarrow \) 2205 |
\(\displaystyle \frac {1}{4} \int \left (4-\frac {3-4 \cos ^2(x)}{2 \cos ^4(x)-3 \cos ^2(x)+1}\right )d\cos (x)\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {1}{4} \left (-\text {arctanh}(\cos (x))-\sqrt {2} \text {arctanh}\left (\sqrt {2} \cos (x)\right )+4 \cos (x)\right )\) |
3.2.12.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa ctors[Cos[v], x]}, -d/Coefficient[v, x, 1] Subst[Int[SubstFor[1, Cos[v]/d , u/Sin[v], x], x], x, Cos[v]/d]], x] /; !FalseQ[v] && FunctionOfQ[Nonfree Factors[Cos[v], x], u/Sin[v], x]]
Result contains complex when optimal does not.
Time = 1.11 (sec) , antiderivative size = 81, normalized size of antiderivative = 2.89
method | result | size |
risch | \(\frac {{\mathrm e}^{i x}}{2}+\frac {{\mathrm e}^{-i x}}{2}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{4}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{4}-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{8}+\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-\sqrt {2}\, {\mathrm e}^{i x}+1\right )}{8}\) | \(81\) |
1/2*exp(I*x)+1/2*exp(-I*x)+1/4*ln(exp(I*x)-1)-1/4*ln(exp(I*x)+1)-1/8*2^(1/ 2)*ln(exp(2*I*x)+2^(1/2)*exp(I*x)+1)+1/8*2^(1/2)*ln(exp(2*I*x)-2^(1/2)*exp (I*x)+1)
Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (20) = 40\).
Time = 0.27 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.89 \[ \int \cos (x) \cot (4 x) \, dx=\frac {1}{8} \, \sqrt {2} \log \left (\frac {2 \, \cos \left (x\right )^{2} - 2 \, \sqrt {2} \cos \left (x\right ) + 1}{2 \, \cos \left (x\right )^{2} - 1}\right ) + \cos \left (x\right ) - \frac {1}{8} \, \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \frac {1}{8} \, \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \]
1/8*sqrt(2)*log((2*cos(x)^2 - 2*sqrt(2)*cos(x) + 1)/(2*cos(x)^2 - 1)) + co s(x) - 1/8*log(1/2*cos(x) + 1/2) + 1/8*log(-1/2*cos(x) + 1/2)
\[ \int \cos (x) \cot (4 x) \, dx=\int \cos {\left (x \right )} \cot {\left (4 x \right )}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 165 vs. \(2 (20) = 40\).
Time = 0.30 (sec) , antiderivative size = 165, normalized size of antiderivative = 5.89 \[ \int \cos (x) \cot (4 x) \, dx=-\frac {1}{16} \, \sqrt {2} \log \left (2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) + 2 \, {\left (\sqrt {2} \cos \left (x\right ) + 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} + 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) + \frac {1}{16} \, \sqrt {2} \log \left (-2 \, \sqrt {2} \sin \left (2 \, x\right ) \sin \left (x\right ) - 2 \, {\left (\sqrt {2} \cos \left (x\right ) - 1\right )} \cos \left (2 \, x\right ) + \cos \left (2 \, x\right )^{2} + 2 \, \cos \left (x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \sin \left (x\right )^{2} - 2 \, \sqrt {2} \cos \left (x\right ) + 1\right ) + \cos \left (x\right ) - \frac {1}{8} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + \frac {1}{8} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) \]
-1/16*sqrt(2)*log(2*sqrt(2)*sin(2*x)*sin(x) + 2*(sqrt(2)*cos(x) + 1)*cos(2 *x) + cos(2*x)^2 + 2*cos(x)^2 + sin(2*x)^2 + 2*sin(x)^2 + 2*sqrt(2)*cos(x) + 1) + 1/16*sqrt(2)*log(-2*sqrt(2)*sin(2*x)*sin(x) - 2*(sqrt(2)*cos(x) - 1)*cos(2*x) + cos(2*x)^2 + 2*cos(x)^2 + sin(2*x)^2 + 2*sin(x)^2 - 2*sqrt(2 )*cos(x) + 1) + cos(x) - 1/8*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 1/8 *log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1)
Leaf count of result is larger than twice the leaf count of optimal. 50 vs. \(2 (20) = 40\).
Time = 0.27 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.79 \[ \int \cos (x) \cot (4 x) \, dx=\frac {1}{8} \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 4 \, \cos \left (x\right ) \right |}}{{\left | 2 \, \sqrt {2} + 4 \, \cos \left (x\right ) \right |}}\right ) + \cos \left (x\right ) - \frac {1}{8} \, \log \left (\cos \left (x\right ) + 1\right ) + \frac {1}{8} \, \log \left (-\cos \left (x\right ) + 1\right ) \]
1/8*sqrt(2)*log(abs(-2*sqrt(2) + 4*cos(x))/abs(2*sqrt(2) + 4*cos(x))) + co s(x) - 1/8*log(cos(x) + 1) + 1/8*log(-cos(x) + 1)
Time = 26.45 (sec) , antiderivative size = 67, normalized size of antiderivative = 2.39 \[ \int \cos (x) \cot (4 x) \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{4}-\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {7\,\sqrt {2}}{8\,\left (\frac {29\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{4}-\frac {5}{4}\right )}-\frac {41\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,\left (\frac {29\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{4}-\frac {5}{4}\right )}\right )}{4}+\frac {2}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2+1} \]