Integrand size = 19, antiderivative size = 49 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=-\frac {b x}{d}+\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c} \tan (x)}{\sqrt {c+d}}\right )}{\sqrt {c} d \sqrt {c+d}} \] Output:
-b*x/d+(a*d+b*(c+d))*arctan(c^(1/2)*tan(x)/(c+d)^(1/2))/c^(1/2)/d/(c+d)^(1 /2)
Time = 0.56 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.96 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=\frac {-b x+\frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c} \tan (x)}{\sqrt {c+d}}\right )}{\sqrt {c} \sqrt {c+d}}}{d} \] Input:
Integrate[(a + b*Sin[x]^2)/(c + d*Cos[x]^2),x]
Output:
(-(b*x) + ((a*d + b*(c + d))*ArcTan[(Sqrt[c]*Tan[x])/Sqrt[c + d]])/(Sqrt[c ]*Sqrt[c + d]))/d
Time = 0.29 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.04, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 4889, 397, 216, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \sin (x)^2}{c+d \cos (x)^2}dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \int \frac {(a+b) \tan ^2(x)+a}{\left (\tan ^2(x)+1\right ) \left (c \tan ^2(x)+c+d\right )}d\tan (x)\) |
\(\Big \downarrow \) 397 |
\(\displaystyle \frac {(a d+b (c+d)) \int \frac {1}{c \tan ^2(x)+c+d}d\tan (x)}{d}-\frac {b \int \frac {1}{\tan ^2(x)+1}d\tan (x)}{d}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {(a d+b (c+d)) \int \frac {1}{c \tan ^2(x)+c+d}d\tan (x)}{d}-\frac {b \arctan (\tan (x))}{d}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {(a d+b (c+d)) \arctan \left (\frac {\sqrt {c} \tan (x)}{\sqrt {c+d}}\right )}{\sqrt {c} d \sqrt {c+d}}-\frac {b \arctan (\tan (x))}{d}\) |
Input:
Int[(a + b*Sin[x]^2)/(c + d*Cos[x]^2),x]
Output:
-((b*ArcTan[Tan[x]])/d) + ((a*d + b*(c + d))*ArcTan[(Sqrt[c]*Tan[x])/Sqrt[ c + d]])/(Sqrt[c]*d*Sqrt[c + d])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ Symbol] :> Simp[(b*e - a*f)/(b*c - a*d) Int[1/(a + b*x^2), x], x] - Simp[ (d*e - c*f)/(b*c - a*d) Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e , f}, x]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Time = 0.25 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.90
method | result | size |
default | \(\frac {\left (a d +c b +d b \right ) \arctan \left (\frac {c \tan \left (x \right )}{\sqrt {\left (c +d \right ) c}}\right )}{d \sqrt {\left (c +d \right ) c}}-\frac {b \arctan \left (\tan \left (x \right )\right )}{d}\) | \(44\) |
risch | \(-\frac {b x}{d}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) a}{2 \sqrt {-c^{2}-c d}}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) c b}{2 \sqrt {-c^{2}-c d}\, d}-\frac {\ln \left ({\mathrm e}^{2 i x}+\frac {2 i c^{2}+2 i d c +2 \sqrt {-c^{2}-c d}\, c +\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) b}{2 \sqrt {-c^{2}-c d}}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c -2 \sqrt {-c^{2}-c d}\, c -\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) a}{2 \sqrt {-c^{2}-c d}}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c -2 \sqrt {-c^{2}-c d}\, c -\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) c b}{2 \sqrt {-c^{2}-c d}\, d}+\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {2 i c^{2}+2 i d c -2 \sqrt {-c^{2}-c d}\, c -\sqrt {-c^{2}-c d}\, d}{\sqrt {-c^{2}-c d}\, d}\right ) b}{2 \sqrt {-c^{2}-c d}}\) | \(497\) |
Input:
int((a+b*sin(x)^2)/(c+d*cos(x)^2),x,method=_RETURNVERBOSE)
Output:
(a*d+b*c+b*d)/d/((c+d)*c)^(1/2)*arctan(c*tan(x)/((c+d)*c)^(1/2))-b/d*arcta n(tan(x))
Time = 0.11 (sec) , antiderivative size = 228, normalized size of antiderivative = 4.65 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=\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 ] \] Input:
integrate((a+b*sin(x)^2)/(c+d*cos(x)^2),x, algorithm="fricas")
Output:
[-1/4*((b*c + (a + b)*d)*sqrt(-c^2 - c*d)*log(((8*c^2 + 8*c*d + d^2)*cos(x )^4 - 2*(4*c^2 + 3*c*d)*cos(x)^2 + 4*((2*c + d)*cos(x)^3 - c*cos(x))*sqrt( -c^2 - c*d)*sin(x) + c^2)/(d^2*cos(x)^4 + 2*c*d*cos(x)^2 + c^2)) + 4*(b*c^ 2 + b*c*d)*x)/(c^2*d + c*d^2), -1/2*((b*c + (a + b)*d)*sqrt(c^2 + c*d)*arc tan(1/2*((2*c + d)*cos(x)^2 - c)/(sqrt(c^2 + c*d)*cos(x)*sin(x))) + 2*(b*c ^2 + b*c*d)*x)/(c^2*d + c*d^2)]
Timed out. \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=\text {Timed out} \] Input:
integrate((a+b*sin(x)**2)/(c+d*cos(x)**2),x)
Output:
Timed out
Time = 0.11 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.82 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=-\frac {b x}{d} + \frac {{\left (b c + {\left (a + b\right )} d\right )} \arctan \left (\frac {c \tan \left (x\right )}{\sqrt {{\left (c + d\right )} c}}\right )}{\sqrt {{\left (c + d\right )} c} d} \] Input:
integrate((a+b*sin(x)^2)/(c+d*cos(x)^2),x, algorithm="maxima")
Output:
-b*x/d + (b*c + (a + b)*d)*arctan(c*tan(x)/sqrt((c + d)*c))/(sqrt((c + d)* c)*d)
Time = 0.15 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.18 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=-\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} \] Input:
integrate((a+b*sin(x)^2)/(c+d*cos(x)^2),x, algorithm="giac")
Output:
-b*x/d + (pi*floor(x/pi + 1/2)*sgn(c) + arctan(c*tan(x)/sqrt(c^2 + c*d)))* (b*c + a*d + b*d)/(sqrt(c^2 + c*d)*d)
Time = 17.13 (sec) , antiderivative size = 1987, normalized size of antiderivative = 40.55 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=\text {Too large to display} \] Input:
int((a + b*sin(x)^2)/(c + d*cos(x)^2),x)
Output:
- (b*c^2*x)/(c*d^2 + c^2*d) - (a*d*atan((a^2*d^3*tan(x)*(- c*d - c^2)^(3/2 )*1i + b^2*c^3*tan(x)*(- c*d - c^2)^(3/2)*2i + b^2*c^5*tan(x)*(- c*d - c^2 )^(1/2)*2i + b^2*d^3*tan(x)*(- c*d - c^2)^(3/2)*1i + a^2*c*d^2*tan(x)*(- c *d - c^2)^(3/2)*2i + a^2*c*d^4*tan(x)*(- c*d - c^2)^(1/2)*1i + b^2*c*d^2*t an(x)*(- c*d - c^2)^(3/2)*4i + b^2*c*d^4*tan(x)*(- c*d - c^2)^(1/2)*1i + b ^2*c^2*d*tan(x)*(- c*d - c^2)^(3/2)*5i + b^2*c^4*d*tan(x)*(- c*d - c^2)^(1 /2)*6i + a^2*c^2*d^3*tan(x)*(- c*d - c^2)^(1/2)*2i + a^2*c^3*d^2*tan(x)*(- c*d - c^2)^(1/2)*1i + b^2*c^2*d^3*tan(x)*(- c*d - c^2)^(1/2)*4i + b^2*c^3 *d^2*tan(x)*(- c*d - c^2)^(1/2)*7i + a*b*d^3*tan(x)*(- c*d - c^2)^(3/2)*2i + a*b*c*d^2*tan(x)*(- c*d - c^2)^(3/2)*6i + a*b*c*d^4*tan(x)*(- c*d - c^2 )^(1/2)*2i + a*b*c^2*d*tan(x)*(- c*d - c^2)^(3/2)*4i + a*b*c^4*d*tan(x)*(- c*d - c^2)^(1/2)*2i + a*b*c^2*d^3*tan(x)*(- c*d - c^2)^(1/2)*6i + a*b*c^3 *d^2*tan(x)*(- c*d - c^2)^(1/2)*6i)/(b^2*c^5*d + a^2*c^2*d^4 + 2*a^2*c^3*d ^3 + a^2*c^4*d^2 + b^2*c^2*d^4 + 3*b^2*c^3*d^3 + 3*b^2*c^4*d^2 + 2*a*b*c^5 *d + 2*a*b*c^2*d^4 + 6*a*b*c^3*d^3 + 6*a*b*c^4*d^2))*(- c*d - c^2)^(1/2)*1 i)/(c*d^2 + c^2*d) - (b*c*atan((a^2*d^3*tan(x)*(- c*d - c^2)^(3/2)*1i + b^ 2*c^3*tan(x)*(- c*d - c^2)^(3/2)*2i + b^2*c^5*tan(x)*(- c*d - c^2)^(1/2)*2 i + b^2*d^3*tan(x)*(- c*d - c^2)^(3/2)*1i + a^2*c*d^2*tan(x)*(- c*d - c^2) ^(3/2)*2i + a^2*c*d^4*tan(x)*(- c*d - c^2)^(1/2)*1i + b^2*c*d^2*tan(x)*(- c*d - c^2)^(3/2)*4i + b^2*c*d^4*tan(x)*(- c*d - c^2)^(1/2)*1i + b^2*c^2...
Time = 0.17 (sec) , antiderivative size = 194, normalized size of antiderivative = 3.96 \[ \int \frac {a+b \sin ^2(x)}{c+d \cos ^2(x)} \, dx=\frac {\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )-\sqrt {d}}{\sqrt {c}}\right ) a d +\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )-\sqrt {d}}{\sqrt {c}}\right ) b c +\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )-\sqrt {d}}{\sqrt {c}}\right ) b d +\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )+\sqrt {d}}{\sqrt {c}}\right ) a d +\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )+\sqrt {d}}{\sqrt {c}}\right ) b c +\sqrt {c}\, \sqrt {c +d}\, \mathit {atan} \left (\frac {\sqrt {c +d}\, \tan \left (\frac {x}{2}\right )+\sqrt {d}}{\sqrt {c}}\right ) b d -b \,c^{2} x -b c d x}{c d \left (c +d \right )} \] Input:
int((a+b*sin(x)^2)/(c+d*cos(x)^2),x)
Output:
(sqrt(c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) - sqrt(d))/sqrt(c))*a*d + sqrt(c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) - sqrt(d))/sqrt(c))*b*c + s qrt(c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) - sqrt(d))/sqrt(c))*b*d + sq rt(c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) + sqrt(d))/sqrt(c))*a*d + sqr t(c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) + sqrt(d))/sqrt(c))*b*c + sqrt (c)*sqrt(c + d)*atan((sqrt(c + d)*tan(x/2) + sqrt(d))/sqrt(c))*b*d - b*c** 2*x - b*c*d*x)/(c*d*(c + d))