Optimal. Leaf size=49 \[ \frac{(a d+b (c+d)) \tan ^{-1}\left (\frac{\sqrt{c} \tan (x)}{\sqrt{c+d}}\right )}{\sqrt{c} d \sqrt{c+d}}-\frac{b x}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.149867, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {522, 203, 205} \[ \frac{(a d+b (c+d)) \tan ^{-1}\left (\frac{\sqrt{c} \tan (x)}{\sqrt{c+d}}\right )}{\sqrt{c} d \sqrt{c+d}}-\frac{b x}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 522
Rule 203
Rule 205
Rubi steps
\begin{align*} \int \frac{a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{\left (1+x^2\right ) \left (c+d+c x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac{b \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (x)\right )}{d}+\frac{(a d+b (c+d)) \operatorname{Subst}\left (\int \frac{1}{c+d+c x^2} \, dx,x,\tan (x)\right )}{d}\\ &=-\frac{b x}{d}+\frac{(a d+b (c+d)) \tan ^{-1}\left (\frac{\sqrt{c} \tan (x)}{\sqrt{c+d}}\right )}{\sqrt{c} d \sqrt{c+d}}\\ \end{align*}
Mathematica [A] time = 0.159684, size = 47, normalized size = 0.96 \[ \frac{\frac{(a d+b (c+d)) \tan ^{-1}\left (\frac{\sqrt{c} \tan (x)}{\sqrt{c+d}}\right )}{\sqrt{c} \sqrt{c+d}}-b x}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.038, size = 78, normalized size = 1.6 \begin{align*}{a\arctan \left ({\tan \left ( x \right ) c{\frac{1}{\sqrt{ \left ( c+d \right ) c}}}} \right ){\frac{1}{\sqrt{ \left ( c+d \right ) c}}}}+{\frac{cb}{d}\arctan \left ({\tan \left ( x \right ) c{\frac{1}{\sqrt{ \left ( c+d \right ) c}}}} \right ){\frac{1}{\sqrt{ \left ( c+d \right ) c}}}}+{b\arctan \left ({\tan \left ( x \right ) c{\frac{1}{\sqrt{ \left ( c+d \right ) c}}}} \right ){\frac{1}{\sqrt{ \left ( c+d \right ) c}}}}-{\frac{b\arctan \left ( \tan \left ( x \right ) \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.87929, size = 547, normalized size = 11.16 \begin{align*} \left [-\frac{{\left (b c +{\left (a + b\right )} d\right )} \sqrt{-c^{2} - c d} \log \left (\frac{{\left (8 \, c^{2} + 8 \, c d + d^{2}\right )} \cos \left (x\right )^{4} - 2 \,{\left (4 \, c^{2} + 3 \, c d\right )} \cos \left (x\right )^{2} + 4 \,{\left ({\left (2 \, c + d\right )} \cos \left (x\right )^{3} - c \cos \left (x\right )\right )} \sqrt{-c^{2} - c d} \sin \left (x\right ) + c^{2}}{d^{2} \cos \left (x\right )^{4} + 2 \, c d \cos \left (x\right )^{2} + c^{2}}\right ) + 4 \,{\left (b c^{2} + b c d\right )} x}{4 \,{\left (c^{2} d + c d^{2}\right )}}, -\frac{{\left (b c +{\left (a + b\right )} d\right )} \sqrt{c^{2} + c d} \arctan \left (\frac{{\left (2 \, c + d\right )} \cos \left (x\right )^{2} - c}{2 \, \sqrt{c^{2} + c d} \cos \left (x\right ) \sin \left (x\right )}\right ) + 2 \,{\left (b c^{2} + b c d\right )} x}{2 \,{\left (c^{2} d + c d^{2}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.14524, size = 78, normalized size = 1.59 \begin{align*} -\frac{b x}{d} + \frac{{\left (\pi \left \lfloor \frac{x}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (c\right ) + \arctan \left (\frac{c \tan \left (x\right )}{\sqrt{c^{2} + c d}}\right )\right )}{\left (b c + a d + b d\right )}}{\sqrt{c^{2} + c d} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]