Integrand size = 19, antiderivative size = 57 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=-\frac {b x}{c}+\frac {(a+2 b) x}{\sqrt {2} c}-\frac {(a+2 b) \arctan \left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\cos ^2(x)}\right )}{\sqrt {2} c} \] Output:
-b*x/c+1/2*(a+2*b)*x*2^(1/2)/c-1/2*(a+2*b)*arctan(cos(x)*sin(x)/(1+2^(1/2) +cos(x)^2))*2^(1/2)/c
Time = 0.18 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.60 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=-\frac {b x}{c}-\frac {(-a-2 b) \arctan \left (\frac {\tan (x)}{\sqrt {2}}\right )}{\sqrt {2} c} \] Input:
Integrate[(a + b*Sin[x]^2)/(c + c*Cos[x]^2),x]
Output:
-((b*x)/c) - ((-a - 2*b)*ArcTan[Tan[x]/Sqrt[2]])/(Sqrt[2]*c)
Time = 0.29 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.54, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 4889, 27, 1480, 216}
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 \cos ^2(x)+c} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {a+b \sin (x)^2}{c \cos (x)^2+c}dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \int \frac {(a+b) \tan ^2(x)+a}{c \left (\tan ^4(x)+3 \tan ^2(x)+2\right )}d\tan (x)\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {(a+b) \tan ^2(x)+a}{\tan ^4(x)+3 \tan ^2(x)+2}d\tan (x)}{c}\) |
\(\Big \downarrow \) 1480 |
\(\displaystyle \frac {(a+2 b) \int \frac {1}{\tan ^2(x)+2}d\tan (x)-b \int \frac {1}{\tan ^2(x)+1}d\tan (x)}{c}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {(a+2 b) \arctan \left (\frac {\tan (x)}{\sqrt {2}}\right )}{\sqrt {2}}-b \arctan (\tan (x))}{c}\) |
Input:
Int[(a + b*Sin[x]^2)/(c + c*Cos[x]^2),x]
Output:
(-(b*ArcTan[Tan[x]]) + ((a + 2*b)*ArcTan[Tan[x]/Sqrt[2]])/Sqrt[2])/c
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
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[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] : > With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[(e/2 + (2*c*d - b*e)/(2*q)) Int[1/( b/2 - q/2 + c*x^2), x], x] + Simp[(e/2 - (2*c*d - b*e)/(2*q)) Int[1/(b/2 + q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^2 - 4*a*c]
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.21 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.53
method | result | size |
default | \(\frac {\frac {\left (a +2 b \right ) \sqrt {2}\, \arctan \left (\frac {\tan \left (x \right ) \sqrt {2}}{2}\right )}{2}-b \arctan \left (\tan \left (x \right )\right )}{c}\) | \(30\) |
risch | \(-\frac {b x}{c}+\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}+3\right ) a}{4 c}+\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}+3\right ) b}{2 c}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}+3\right ) a}{4 c}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}+3\right ) b}{2 c}\) | \(101\) |
Input:
int((a+b*sin(x)^2)/(c+c*cos(x)^2),x,method=_RETURNVERBOSE)
Output:
1/c*(1/2*(a+2*b)*2^(1/2)*arctan(1/2*tan(x)*2^(1/2))-b*arctan(tan(x)))
Time = 0.08 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.79 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=-\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} \] Input:
integrate((a+b*sin(x)^2)/(c+c*cos(x)^2),x, algorithm="fricas")
Output:
-1/4*(sqrt(2)*(a + 2*b)*arctan(1/4*(3*sqrt(2)*cos(x)^2 - sqrt(2))/(cos(x)* sin(x))) + 4*b*x)/c
Leaf count of result is larger than twice the leaf count of optimal. 143 vs. \(2 (49) = 98\).
Time = 4.23 (sec) , antiderivative size = 143, normalized size of antiderivative = 2.51 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=\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} \] Input:
integrate((a+b*sin(x)**2)/(c+c*cos(x)**2),x)
Output:
sqrt(2)*a*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi))/(2*c) + sqrt(2)*a*(atan(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)/pi))/(2*c) - b*x/c + sqrt(2)*b*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi ))/c + sqrt(2)*b*(atan(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)/pi))/ c
Time = 0.13 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.51 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=\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} \] Input:
integrate((a+b*sin(x)^2)/(c+c*cos(x)^2),x, algorithm="maxima")
Output:
1/2*sqrt(2)*(a + 2*b)*arctan(1/2*sqrt(2)*tan(x))/c - b*x/c
Time = 0.11 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.09 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=\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} \] Input:
integrate((a+b*sin(x)^2)/(c+c*cos(x)^2),x, algorithm="giac")
Output:
1/2*sqrt(2)*(a + 2*b)*(x + arctan(-(sqrt(2)*sin(2*x) - sin(2*x))/(sqrt(2)* cos(2*x) + sqrt(2) - cos(2*x) + 1)))/c - b*x/c
Time = 17.32 (sec) , antiderivative size = 242, normalized size of antiderivative = 4.25 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,a^3\,\mathrm {tan}\left (x\right )}{2\,\left (a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3\right )}+\frac {2\,\sqrt {2}\,b^3\,\mathrm {tan}\left (x\right )}{a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3}+\frac {5\,\sqrt {2}\,a\,b^2\,\mathrm {tan}\left (x\right )}{a^3+6\,a^2\,b+10\,a\,b^2+4\,b^3}+\frac {3\,\sqrt {2}\,a^2\,b\,\mathrm {tan}\left (x\right )}{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}\left (x\right )}{2\,a^2\,b+8\,a\,b^2+4\,b^3}+\frac {8\,a\,b^2\,\mathrm {tan}\left (x\right )}{2\,a^2\,b+8\,a\,b^2+4\,b^3}+\frac {2\,a^2\,b\,\mathrm {tan}\left (x\right )}{2\,a^2\,b+8\,a\,b^2+4\,b^3}\right )}{c} \] Input:
int((a + b*sin(x)^2)/(c + c*cos(x)^2),x)
Output:
(2^(1/2)*atan((2^(1/2)*a^3*tan(x))/(2*(10*a*b^2 + 6*a^2*b + a^3 + 4*b^3)) + (2*2^(1/2)*b^3*tan(x))/(10*a*b^2 + 6*a^2*b + a^3 + 4*b^3) + (5*2^(1/2)*a *b^2*tan(x))/(10*a*b^2 + 6*a^2*b + a^3 + 4*b^3) + (3*2^(1/2)*a^2*b*tan(x)) /(10*a*b^2 + 6*a^2*b + a^3 + 4*b^3))*(a + 2*b))/(2*c) - (b*atan((4*b^3*tan (x))/(8*a*b^2 + 2*a^2*b + 4*b^3) + (8*a*b^2*tan(x))/(8*a*b^2 + 2*a^2*b + 4 *b^3) + (2*a^2*b*tan(x))/(8*a*b^2 + 2*a^2*b + 4*b^3)))/c
Time = 0.16 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.56 \[ \int \frac {a+b \sin ^2(x)}{c+c \cos ^2(x)} \, dx=\frac {-\sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2}-2 \tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right ) a -2 \sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2}-2 \tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right ) b +\sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2}+2 \tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right ) a +2 \sqrt {2}\, \mathit {atan} \left (\frac {\sqrt {2}+2 \tan \left (\frac {x}{2}\right )}{\sqrt {2}}\right ) b -2 b x}{2 c} \] Input:
int((a+b*sin(x)^2)/(c+c*cos(x)^2),x)
Output:
( - sqrt(2)*atan((sqrt(2) - 2*tan(x/2))/sqrt(2))*a - 2*sqrt(2)*atan((sqrt( 2) - 2*tan(x/2))/sqrt(2))*b + sqrt(2)*atan((sqrt(2) + 2*tan(x/2))/sqrt(2)) *a + 2*sqrt(2)*atan((sqrt(2) + 2*tan(x/2))/sqrt(2))*b - 2*b*x)/(2*c)