Optimal. Leaf size=49 \[ \frac {(a d+b (c+d)) \tan ^{-1}\left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}}-\frac {b x}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 49, normalized size of antiderivative = 1.00, 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+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}}-\frac {b x}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 205
Rule 522
Rubi steps
\begin {align*} \int \frac {a+b \cos ^2(x)}{c+d \sin ^2(x)} \, dx &=\operatorname {Subst}\left (\int \frac {a+b+a x^2}{\left (1+x^2\right ) \left (c+(c+d) 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 c+(a+b) (c+d)) \operatorname {Subst}\left (\int \frac {1}{c+(c+d) x^2} \, dx,x,\tan (x)\right )}{d}\\ &=-\frac {b x}{d}+\frac {(a d+b (c+d)) \tan ^{-1}\left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} d \sqrt {c+d}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 47, normalized size = 0.96 \[ \frac {\frac {(a d+b (c+d)) \tan ^{-1}\left (\frac {\sqrt {c+d} \tan (x)}{\sqrt {c}}\right )}{\sqrt {c} \sqrt {c+d}}-b x}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 2.03, size = 255, normalized size = 5.20 \[ \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 \relax (x)^{4} - 2 \, {\left (4 \, c^{2} + 5 \, c d + d^{2}\right )} \cos \relax (x)^{2} + 4 \, {\left ({\left (2 \, c + d\right )} \cos \relax (x)^{3} - {\left (c + d\right )} \cos \relax (x)\right )} \sqrt {-c^{2} - c d} \sin \relax (x) + c^{2} + 2 \, c d + d^{2}}{d^{2} \cos \relax (x)^{4} - 2 \, {\left (c d + d^{2}\right )} \cos \relax (x)^{2} + c^{2} + 2 \, c d + d^{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 \relax (x)^{2} - c - d}{2 \, \sqrt {c^{2} + c d} \cos \relax (x) \sin \relax (x)}\right ) + 2 \, {\left (b c^{2} + b c d\right )} x}{2 \, {\left (c^{2} d + c d^{2}\right )}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 70, normalized size = 1.43 \[ -\frac {b x}{d} + \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c + 2 \, d\right ) + \arctan \left (\frac {c \tan \relax (x) + d \tan \relax (x)}{\sqrt {c^{2} + c d}}\right )\right )} {\left (b c + a d + b d\right )}}{\sqrt {c^{2} + c d} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.12, size = 84, normalized size = 1.71 \[ \frac {\arctan \left (\frac {\left (c +d \right ) \tan \relax (x )}{\sqrt {\left (c +d \right ) c}}\right ) a}{\sqrt {\left (c +d \right ) c}}+\frac {\arctan \left (\frac {\left (c +d \right ) \tan \relax (x )}{\sqrt {\left (c +d \right ) c}}\right ) c b}{d \sqrt {\left (c +d \right ) c}}+\frac {\arctan \left (\frac {\left (c +d \right ) \tan \relax (x )}{\sqrt {\left (c +d \right ) c}}\right ) b}{\sqrt {\left (c +d \right ) c}}-\frac {b \arctan \left (\tan \relax (x )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 42, normalized size = 0.86 \[ -\frac {b x}{d} + \frac {{\left (b c + {\left (a + b\right )} d\right )} \arctan \left (\frac {{\left (c + d\right )} \tan \relax (x)}{\sqrt {{\left (c + d\right )} c}}\right )}{\sqrt {{\left (c + d\right )} c} d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.95, size = 1774, normalized size = 36.20 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________