Integrand size = 33, antiderivative size = 25 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=x-2 \arctan \left (\frac {2 \cos (x) \sin (x)}{1-\cos (x)+2 \cos ^2(x)}\right ) \]
[Out]
\[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=\int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx \]
[In]
[Out]
Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {5}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)}+\frac {2 \cos (x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)}+\frac {7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)}\right ) \, dx \\ & = 2 \int \frac {\cos (x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx-5 \int \frac {1}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx+7 \int \frac {\cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(63\) vs. \(2(25)=50\).
Time = 0.58 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.52 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=\arctan \left (\frac {1}{4} \sec ^3\left (\frac {x}{2}\right ) \left (5 \sin \left (\frac {x}{2}\right )-3 \sin \left (\frac {3 x}{2}\right )\right )\right )-\arctan \left (\frac {1}{4} \sec ^3\left (\frac {x}{2}\right ) \left (-5 \sin \left (\frac {x}{2}\right )+3 \sin \left (\frac {3 x}{2}\right )\right )\right ) \]
[In]
[Out]
Time = 0.56 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.76
method | result | size |
default | \(2 \arctan \left (2 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-\tan \left (\frac {x}{2}\right )\right )\) | \(19\) |
parallelrisch | \(i \left (\ln \left (2 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-\tan \left (\frac {x}{2}\right )+i\right )-\ln \left (2 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-\tan \left (\frac {x}{2}\right )-i\right )\right )\) | \(43\) |
risch | \(i \ln \left ({\mathrm e}^{3 i x}-\frac {{\mathrm e}^{2 i x}}{2}+2 \,{\mathrm e}^{i x}-\frac {1}{2}\right )-i \ln \left ({\mathrm e}^{3 i x}-4 \,{\mathrm e}^{2 i x}+{\mathrm e}^{i x}-2\right )\) | \(50\) |
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.48 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=\arctan \left (\frac {5 \, \cos \left (x\right )^{3} - 6 \, \cos \left (x\right )^{2} + 5 \, \cos \left (x\right )}{{\left (3 \, \cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) - 1\right )} \sin \left (x\right )}\right ) \]
[In]
[Out]
Timed out. \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=\text {Timed out} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (25) = 50\).
Time = 1.63 (sec) , antiderivative size = 63, normalized size of antiderivative = 2.52 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=-\arctan \left (\sin \left (3 \, x\right ) - \frac {1}{2} \, \sin \left (2 \, x\right ) + 2 \, \sin \left (x\right ), \cos \left (3 \, x\right ) - \frac {1}{2} \, \cos \left (2 \, x\right ) + 2 \, \cos \left (x\right ) - \frac {1}{2}\right ) + \arctan \left (\sin \left (3 \, x\right ) - 4 \, \sin \left (2 \, x\right ) + \sin \left (x\right ), \cos \left (3 \, x\right ) - 4 \, \cos \left (2 \, x\right ) + \cos \left (x\right ) - 2\right ) \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=-2 \, \arctan \left (-2 \, \tan \left (\frac {1}{2} \, x\right )^{3} + \tan \left (\frac {1}{2} \, x\right )\right ) \]
[In]
[Out]
Time = 0.34 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.00 \[ \int \frac {-5+2 \cos (x)+7 \cos ^2(x)}{-1+2 \cos (x)-9 \cos ^2(x)+4 \cos ^3(x)} \, dx=x-2\,\mathrm {atan}\left (\mathrm {tan}\left (\frac {x}{2}\right )-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3\right )-2\,\mathrm {atan}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right ) \]
[In]
[Out]