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.13, antiderivative size = 57, normalized size of antiderivative = 1.00, 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 203
Rule 1166
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.08, size = 34, normalized size = 0.60 \[ -\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]
________________________________________________________________________________________
fricas [A] time = 1.33, size = 45, normalized size = 0.79 \[ -\frac {\sqrt {2} {\left (a + 2 \, b\right )} \arctan \left (\frac {3 \, \sqrt {2} \cos \relax (x)^{2} - \sqrt {2}}{4 \, \cos \relax (x) \sin \relax (x)}\right ) + 4 \, b x}{4 \, c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 62, normalized size = 1.09 \[ \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} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.13, size = 44, normalized size = 0.77 \[ \frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \tan \relax (x )}{2}\right ) a}{2 c}+\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \tan \relax (x )}{2}\right ) b}{c}-\frac {b \arctan \left (\tan \relax (x )\right )}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.42, size = 29, normalized size = 0.51 \[ \frac {\sqrt {2} {\left (a + 2 \, b\right )} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \relax (x)\right )}{2 \, c} - \frac {b x}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.43, size = 242, normalized size = 4.25 \[ \frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,a^3\,\mathrm {tan}\relax (x)}{2\,\left (a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3\right )}+\frac {2\,\sqrt {2}\,b^3\,\mathrm {tan}\relax (x)}{a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3}+\frac {5\,\sqrt {2}\,a\,b^2\,\mathrm {tan}\relax (x)}{a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3}+\frac {3\,\sqrt {2}\,a^2\,b\,\mathrm {tan}\relax (x)}{a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3}\right )\,\left (a+2\,b\right )}{2\,c}-\frac {b\,\mathrm {atan}\left (\frac {4\,b^3\,\mathrm {tan}\relax (x)}{2\,a^2\,b+8\,a\,b^2+4\,b^3}+\frac {8\,a\,b^2\,\mathrm {tan}\relax (x)}{2\,a^2\,b+8\,a\,b^2+4\,b^3}+\frac {2\,a^2\,b\,\mathrm {tan}\relax (x)}{2\,a^2\,b+8\,a\,b^2+4\,b^3}\right )}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 10.67, size = 143, normalized size = 2.51 \[ \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} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________