Optimal. Leaf size=57 \[ \frac{x (a+2 b)}{\sqrt{2} c}-\frac{(a+2 b) \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right )}{\sqrt{2} c}-\frac{b x}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.134189, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {12, 1166, 203} \[ \frac{x (a+2 b)}{\sqrt{2} c}-\frac{(a+2 b) \tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{2}+1}\right )}{\sqrt{2} c}-\frac{b x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 1166
Rule 203
Rubi steps
\begin{align*} \int \frac{a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{c \left (2+3 x^2+x^4\right )} \, dx,x,\tan (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{2+3 x^2+x^4} \, dx,x,\tan (x)\right )}{c}\\ &=-\frac{b \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )}{c}+\frac{(a+2 b) \operatorname{Subst}\left (\int \frac{1}{2+x^2} \, dx,x,\tan (x)\right )}{c}\\ &=-\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}+\cos ^2(x)}\right )}{\sqrt{2} c}\\ \end{align*}
Mathematica [A] time = 0.0885643, size = 34, normalized size = 0.6 \[ -\frac{(-a-2 b) \tan ^{-1}\left (\frac{\tan (x)}{\sqrt{2}}\right )}{\sqrt{2} c}-\frac{b x}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.032, size = 44, normalized size = 0.8 \begin{align*}{\frac{\sqrt{2}a}{2\,c}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{2}}{2}} \right ) }+{\frac{\sqrt{2}b}{c}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{2}}{2}} \right ) }-{\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.49859, size = 39, normalized size = 0.68 \begin{align*} \frac{\sqrt{2}{\left (a + 2 \, b\right )} \arctan \left (\frac{1}{2} \, \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.56949, size = 128, normalized size = 2.25 \begin{align*} -\frac{\sqrt{2}{\left (a + 2 \, b\right )} \arctan \left (\frac{3 \, \sqrt{2} \cos \left (x\right )^{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 = 27.9418, size = 143, normalized size = 2.51 \begin{align*} \frac{\sqrt{2} a \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} - 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{2 c} + \frac{\sqrt{2} a \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} + 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{2 c} - \frac{b x}{c} + \frac{\sqrt{2} b \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} - 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{c} + \frac{\sqrt{2} b \left (\operatorname{atan}{\left (\sqrt{2} \tan{\left (\frac{x}{2} \right )} + 1 \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.09982, size = 84, normalized size = 1.47 \begin{align*} \frac{\sqrt{2}{\left (a + 2 \, b\right )}{\left (x + \arctan \left (-\frac{\sqrt{2} \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )}{\sqrt{2} \cos \left (2 \, x\right ) + \sqrt{2} - \cos \left (2 \, x\right ) + 1}\right )\right )}}{2 \, c} - \frac{b x}{c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]