Optimal. Leaf size=56 \[ \frac{x (a+2 b)}{\sqrt{2} c}+\frac{(a+2 b) \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\sin ^2(x)+\sqrt{2}+1}\right )}{\sqrt{2} c}-\frac{b x}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.196645, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {1166, 205} \[ \frac{x (a+2 b)}{\sqrt{2} c}+\frac{(a+2 b) \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\sin ^2(x)+\sqrt{2}+1}\right )}{\sqrt{2} c}-\frac{b x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1166
Rule 205
Rubi steps
\begin{align*} \int \frac{a+b \cos ^2(x)}{c+c \sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{a+b+a x^2}{c+3 c x^2+2 c x^4} \, dx,x,\tan (x)\right )\\ &=-\left ((2 b) \operatorname{Subst}\left (\int \frac{1}{2 c+2 c x^2} \, dx,x,\tan (x)\right )\right )+(a+2 b) \operatorname{Subst}\left (\int \frac{1}{c+2 c x^2} \, dx,x,\tan (x)\right )\\ &=-\frac{b x}{c}+\frac{(a+2 b) x}{\sqrt{2} c}+\frac{(a+2 b) \tan ^{-1}\left (\frac{\cos (x) \sin (x)}{1+\sqrt{2}+\sin ^2(x)}\right )}{\sqrt{2} c}\\ \end{align*}
Mathematica [A] time = 0.0830549, size = 31, normalized size = 0.55 \[ \frac{(a+2 b) \tan ^{-1}\left (\sqrt{2} \tan (x)\right )}{\sqrt{2} c}-\frac{b x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 42, normalized size = 0.8 \begin{align*}{\frac{\sqrt{2}\arctan \left ( \tan \left ( x \right ) \sqrt{2} \right ) a}{2\,c}}+{\frac{\sqrt{2}\arctan \left ( \tan \left ( x \right ) \sqrt{2} \right ) b}{c}}-{\frac{b\arctan \left ( \tan \left ( x \right ) \right ) }{c}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.49939, size = 38, normalized size = 0.68 \begin{align*} \frac{\sqrt{2}{\left (a + 2 \, b\right )} \arctan \left (\sqrt{2} \tan \left (x\right )\right )}{2 \, c} - \frac{b x}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.5734, size = 131, normalized size = 2.34 \begin{align*} -\frac{\sqrt{2}{\left (a + 2 \, b\right )} \arctan \left (\frac{3 \, \sqrt{2} \cos \left (x\right )^{2} - 2 \, \sqrt{2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) + 4 \, b x}{4 \, c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] time = 98.6209, size = 782, normalized size = 13.96 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15276, size = 84, normalized size = 1.5 \begin{align*} \frac{\sqrt{2}{\left (a + 2 \, b\right )}{\left (x + \arctan \left (-\frac{\sqrt{2} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt{2} \cos \left (2 \, x\right ) + \sqrt{2} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )}}{2 \, c} - \frac{b x}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]