\(\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx\) [206]
Optimal result
Integrand size = 17, antiderivative size = 105 \[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\frac {b c x}{d^2}+\frac {2 a \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}-\frac {2 b \sqrt {c-d} \sqrt {c+d} \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{d^2}-\frac {b \sin (x)}{d}
\]
[Out]
b*c*x/d^2-b*sin(x)/d+2*a*arctan((c-d)^(1/2)*tan(1/2*x)/(c+d)^(1/2))/(c-d)^(1/2)/(c+d)^(1/2)-2*b*arctan((c-d)^(
1/2)*tan(1/2*x)/(c+d)^(1/2))*(c-d)^(1/2)*(c+d)^(1/2)/d^2
Rubi [A] (verified)
Time = 0.29 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of
steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.294, Rules used = {4486, 2738, 211, 2774, 2814}
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\frac {2 a \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}-\frac {2 b \sqrt {c-d} \sqrt {c+d} \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{d^2}+\frac {b c x}{d^2}-\frac {b \sin (x)}{d}
\]
[In]
Int[(a + b*Sin[x]^2)/(c + d*Cos[x]),x]
[Out]
(b*c*x)/d^2 + (2*a*ArcTan[(Sqrt[c - d]*Tan[x/2])/Sqrt[c + d]])/(Sqrt[c - d]*Sqrt[c + d]) - (2*b*Sqrt[c - d]*Sq
rt[c + d]*ArcTan[(Sqrt[c - d]*Tan[x/2])/Sqrt[c + d]])/d^2 - (b*Sin[x])/d
Rule 211
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]
Rule 2738
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]
Rule 2774
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[g*(g*C
os[e + f*x])^(p - 1)*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + p))), x] + Dist[g^2*((p - 1)/(b*(m + p))), Int[(g
*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^m*(b + a*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g, m}, x] &&
NeQ[a^2 - b^2, 0] && GtQ[p, 1] && NeQ[m + p, 0] && IntegersQ[2*m, 2*p]
Rule 2814
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]
Rule 4486
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Rubi steps \begin{align*}
\text {integral}& = \int \left (\frac {a}{c+d \cos (x)}+\frac {b \sin ^2(x)}{c+d \cos (x)}\right ) \, dx \\ & = a \int \frac {1}{c+d \cos (x)} \, dx+b \int \frac {\sin ^2(x)}{c+d \cos (x)} \, dx \\ & = -\frac {b \sin (x)}{d}+(2 a) \text {Subst}\left (\int \frac {1}{c+d+(c-d) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )-\frac {b \int \frac {-d-c \cos (x)}{c+d \cos (x)} \, dx}{d} \\ & = \frac {b c x}{d^2}+\frac {2 a \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}-\frac {b \sin (x)}{d}+\frac {\left (b \left (-c^2+d^2\right )\right ) \int \frac {1}{c+d \cos (x)} \, dx}{d^2} \\ & = \frac {b c x}{d^2}+\frac {2 a \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}-\frac {b \sin (x)}{d}+\frac {\left (2 b \left (-c^2+d^2\right )\right ) \text {Subst}\left (\int \frac {1}{c+d+(c-d) x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{d^2} \\ & = \frac {b c x}{d^2}+\frac {2 a \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}-\frac {2 b \sqrt {c-d} \sqrt {c+d} \arctan \left (\frac {\sqrt {c-d} \tan \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{d^2}-\frac {b \sin (x)}{d} \\
\end{align*}
Mathematica [A] (verified)
Time = 0.15 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.70
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\frac {b c x-\frac {2 \left (a d^2+b \left (-c^2+d^2\right )\right ) \text {arctanh}\left (\frac {(c-d) \tan \left (\frac {x}{2}\right )}{\sqrt {-c^2+d^2}}\right )}{\sqrt {-c^2+d^2}}-b d \sin (x)}{d^2}
\]
[In]
Integrate[(a + b*Sin[x]^2)/(c + d*Cos[x]),x]
[Out]
(b*c*x - (2*(a*d^2 + b*(-c^2 + d^2))*ArcTanh[((c - d)*Tan[x/2])/Sqrt[-c^2 + d^2]])/Sqrt[-c^2 + d^2] - b*d*Sin[
x])/d^2
Maple [A] (verified)
Time = 0.53 (sec) , antiderivative size = 88, normalized size of antiderivative = 0.84
| | |
method | result | size |
| | |
default |
\(\frac {2 b \left (-\frac {d \tan \left (\frac {x}{2}\right )}{1+\tan \left (\frac {x}{2}\right )^{2}}+c \arctan \left (\tan \left (\frac {x}{2}\right )\right )\right )}{d^{2}}+\frac {2 \left (a \,d^{2}-c^{2} b +b \,d^{2}\right ) \arctan \left (\frac {\left (c -d \right ) \tan \left (\frac {x}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{d^{2} \sqrt {\left (c +d \right ) \left (c -d \right )}}\) |
\(88\) |
risch |
\(\frac {b c x}{d^{2}}+\frac {i b \,{\mathrm e}^{i x}}{2 d}-\frac {i b \,{\mathrm e}^{-i x}}{2 d}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {i c^{2}-i d^{2}+\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) a}{\sqrt {-c^{2}+d^{2}}}+\frac {\ln \left ({\mathrm e}^{i x}+\frac {i c^{2}-i d^{2}+\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) c^{2} b}{\sqrt {-c^{2}+d^{2}}\, d^{2}}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {i c^{2}-i d^{2}+\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) b}{\sqrt {-c^{2}+d^{2}}}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {i c^{2}-i d^{2}-\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) a}{\sqrt {-c^{2}+d^{2}}}-\frac {\ln \left ({\mathrm e}^{i x}-\frac {i c^{2}-i d^{2}-\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) c^{2} b}{\sqrt {-c^{2}+d^{2}}\, d^{2}}+\frac {\ln \left ({\mathrm e}^{i x}-\frac {i c^{2}-i d^{2}-\sqrt {-c^{2}+d^{2}}\, c}{d \sqrt {-c^{2}+d^{2}}}\right ) b}{\sqrt {-c^{2}+d^{2}}}\) |
\(420\) |
| | |
|
|
|
[In]
int((a+sin(x)^2*b)/(c+d*cos(x)),x,method=_RETURNVERBOSE)
[Out]
2*b/d^2*(-d*tan(1/2*x)/(1+tan(1/2*x)^2)+c*arctan(tan(1/2*x)))+2*(a*d^2-b*c^2+b*d^2)/d^2/((c+d)*(c-d))^(1/2)*ar
ctan((c-d)*tan(1/2*x)/((c+d)*(c-d))^(1/2))
Fricas [A] (verification not implemented)
none
Time = 0.28 (sec) , antiderivative size = 254, normalized size of antiderivative = 2.42
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\left [\frac {{\left (b c^{2} - {\left (a + b\right )} d^{2}\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {2 \, c d \cos \left (x\right ) + {\left (2 \, c^{2} - d^{2}\right )} \cos \left (x\right )^{2} + 2 \, \sqrt {-c^{2} + d^{2}} {\left (c \cos \left (x\right ) + d\right )} \sin \left (x\right ) - c^{2} + 2 \, d^{2}}{d^{2} \cos \left (x\right )^{2} + 2 \, c d \cos \left (x\right ) + c^{2}}\right ) + 2 \, {\left (b c^{3} - b c d^{2}\right )} x - 2 \, {\left (b c^{2} d - b d^{3}\right )} \sin \left (x\right )}{2 \, {\left (c^{2} d^{2} - d^{4}\right )}}, -\frac {{\left (b c^{2} - {\left (a + b\right )} d^{2}\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \cos \left (x\right ) + d}{\sqrt {c^{2} - d^{2}} \sin \left (x\right )}\right ) - {\left (b c^{3} - b c d^{2}\right )} x + {\left (b c^{2} d - b d^{3}\right )} \sin \left (x\right )}{c^{2} d^{2} - d^{4}}\right ]
\]
[In]
integrate((a+b*sin(x)^2)/(c+d*cos(x)),x, algorithm="fricas")
[Out]
[1/2*((b*c^2 - (a + b)*d^2)*sqrt(-c^2 + d^2)*log((2*c*d*cos(x) + (2*c^2 - d^2)*cos(x)^2 + 2*sqrt(-c^2 + d^2)*(
c*cos(x) + d)*sin(x) - c^2 + 2*d^2)/(d^2*cos(x)^2 + 2*c*d*cos(x) + c^2)) + 2*(b*c^3 - b*c*d^2)*x - 2*(b*c^2*d
- b*d^3)*sin(x))/(c^2*d^2 - d^4), -((b*c^2 - (a + b)*d^2)*sqrt(c^2 - d^2)*arctan(-(c*cos(x) + d)/(sqrt(c^2 - d
^2)*sin(x))) - (b*c^3 - b*c*d^2)*x + (b*c^2*d - b*d^3)*sin(x))/(c^2*d^2 - d^4)]
Sympy [B] (verification not implemented)
Leaf count of result is larger than twice the leaf count of optimal. 2608 vs. \(2 (92) = 184\).
Time = 53.37 (sec) , antiderivative size = 2608, normalized size of antiderivative = 24.84
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\text {Too large to display}
\]
[In]
integrate((a+b*sin(x)**2)/(c+d*cos(x)),x)
[Out]
Piecewise((zoo*(-a*log(tan(x/2) - 1)*tan(x/2)**2/(tan(x/2)**2 + 1) - a*log(tan(x/2) - 1)/(tan(x/2)**2 + 1) + a
*log(tan(x/2) + 1)*tan(x/2)**2/(tan(x/2)**2 + 1) + a*log(tan(x/2) + 1)/(tan(x/2)**2 + 1) - b*log(tan(x/2) - 1)
*tan(x/2)**2/(tan(x/2)**2 + 1) - b*log(tan(x/2) - 1)/(tan(x/2)**2 + 1) + b*log(tan(x/2) + 1)*tan(x/2)**2/(tan(
x/2)**2 + 1) + b*log(tan(x/2) + 1)/(tan(x/2)**2 + 1) - 2*b*tan(x/2)/(tan(x/2)**2 + 1)), Eq(c, 0) & Eq(d, 0)),
(a*tan(x/2)**3/(d*tan(x/2)**2 + d) + a*tan(x/2)/(d*tan(x/2)**2 + d) + b*x*tan(x/2)**2/(d*tan(x/2)**2 + d) + b*
x/(d*tan(x/2)**2 + d) - 2*b*tan(x/2)/(d*tan(x/2)**2 + d), Eq(c, d)), (a*tan(x/2)**2/(d*tan(x/2)**3 + d*tan(x/2
)) + a/(d*tan(x/2)**3 + d*tan(x/2)) - b*x*tan(x/2)**3/(d*tan(x/2)**3 + d*tan(x/2)) - b*x*tan(x/2)/(d*tan(x/2)*
*3 + d*tan(x/2)) - 2*b*tan(x/2)**2/(d*tan(x/2)**3 + d*tan(x/2)), Eq(c, -d)), ((a*x + b*x*sin(x)**2/2 + b*x*cos
(x)**2/2 - b*sin(x)*cos(x)/2)/c, Eq(d, 0)), (a*d**2*log(-sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))*tan(x/2)**2/
(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d)
- d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) + a*d**2*log(-sqrt(-c/(c - d) - d/(c - d)) + tan
(x/2))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(
c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) - a*d**2*log(sqrt(-c/(c - d) - d/(c - d))
+ tan(x/2))*tan(x/2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)
) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) - a*d**2*log(sqrt(-c/(c
- d) - d/(c - d)) + tan(x/2))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(
c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) + b*c**2*x*sqrt(-
c/(c - d) - d/(c - d))*tan(x/2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) -
d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) + b*c**2*x*sq
rt(-c/(c - d) - d/(c - d))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c -
d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) - b*c**2*log(-sqrt(-c
/(c - d) - d/(c - d)) + tan(x/2))*tan(x/2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-
c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) -
b*c**2*log(-sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2
*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c -
d))) + b*c**2*log(sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))*tan(x/2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*ta
n(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c
/(c - d) - d/(c - d))) + b*c**2*log(sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))/(c*d**2*sqrt(-c/(c - d) - d/(c -
d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*s
qrt(-c/(c - d) - d/(c - d))) - b*c*d*x*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c
- d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**
3*sqrt(-c/(c - d) - d/(c - d))) - b*c*d*x*sqrt(-c/(c - d) - d/(c - d))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*ta
n(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c
/(c - d) - d/(c - d))) - 2*b*c*d*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*ta
n(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c
/(c - d) - d/(c - d))) + 2*b*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*t
an(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-
c/(c - d) - d/(c - d))) + b*d**2*log(-sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))*tan(x/2)**2/(c*d**2*sqrt(-c/(c
- d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))*tan(x/
2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) + b*d**2*log(-sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))/(c*d**2*sqrt
(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c - d) - d/(c - d))
*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) - b*d**2*log(sqrt(-c/(c - d) - d/(c - d)) + tan(x/2))*tan(x/
2)**2/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt(-c/(c
- d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))) - b*d**2*log(sqrt(-c/(c - d) - d/(c - d))
+ tan(x/2))/(c*d**2*sqrt(-c/(c - d) - d/(c - d))*tan(x/2)**2 + c*d**2*sqrt(-c/(c - d) - d/(c - d)) - d**3*sqrt
(-c/(c - d) - d/(c - d))*tan(x/2)**2 - d**3*sqrt(-c/(c - d) - d/(c - d))), True))
Maxima [F(-2)]
Exception generated. \[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\text {Exception raised: ValueError}
\]
[In]
integrate((a+b*sin(x)^2)/(c+d*cos(x)),x, algorithm="maxima")
[Out]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d^2-4*c^2>0)', see `assume?`
for more de
Giac [A] (verification not implemented)
none
Time = 0.27 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.05
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\frac {b c x}{d^{2}} - \frac {2 \, b \tan \left (\frac {1}{2} \, x\right )}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )} d} + \frac {2 \, {\left (b c^{2} - a d^{2} - b d^{2}\right )} {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, c + 2 \, d\right ) + \arctan \left (-\frac {c \tan \left (\frac {1}{2} \, x\right ) - d \tan \left (\frac {1}{2} \, x\right )}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{\sqrt {c^{2} - d^{2}} d^{2}}
\]
[In]
integrate((a+b*sin(x)^2)/(c+d*cos(x)),x, algorithm="giac")
[Out]
b*c*x/d^2 - 2*b*tan(1/2*x)/((tan(1/2*x)^2 + 1)*d) + 2*(b*c^2 - a*d^2 - b*d^2)*(pi*floor(1/2*x/pi + 1/2)*sgn(-2
*c + 2*d) + arctan(-(c*tan(1/2*x) - d*tan(1/2*x))/sqrt(c^2 - d^2)))/(sqrt(c^2 - d^2)*d^2)
Mupad [B] (verification not implemented)
Time = 29.12 (sec) , antiderivative size = 2429, normalized size of antiderivative = 23.13
\[
\int \frac {a+b \sin ^2(x)}{c+d \cos (x)} \, dx=\text {Too large to display}
\]
[In]
int((a + b*sin(x)^2)/(c + d*cos(x)),x)
[Out]
(b*c^2*d*sin(x))/(d^4 - c^2*d^2) - (b*d^3*sin(x))/(d^4 - c^2*d^2) - (2*b*c^3*atan(sin(x/2)/cos(x/2)))/(d^4 - c
^2*d^2) - (a*d^2*atan((a^2*d^7*sin(x/2)*(d^2 - c^2)^(1/2)*1i - b^2*c^5*sin(x/2)*(d^2 - c^2)^(3/2)*2i - b^2*c^7
*sin(x/2)*(d^2 - c^2)^(1/2)*2i + b^2*d^7*sin(x/2)*(d^2 - c^2)^(1/2)*1i - a^2*c*d^4*sin(x/2)*(d^2 - c^2)^(3/2)*
2i + a^2*c*d^6*sin(x/2)*(d^2 - c^2)^(1/2)*1i - b^2*c*d^4*sin(x/2)*(d^2 - c^2)^(3/2)*2i + b^2*c*d^6*sin(x/2)*(d
^2 - c^2)^(1/2)*1i - a^2*c^2*d^5*sin(x/2)*(d^2 - c^2)^(1/2)*1i - a^2*c^3*d^4*sin(x/2)*(d^2 - c^2)^(1/2)*1i - b
^2*c^2*d^5*sin(x/2)*(d^2 - c^2)^(1/2)*2i + b^2*c^3*d^2*sin(x/2)*(d^2 - c^2)^(3/2)*4i - b^2*c^3*d^4*sin(x/2)*(d
^2 - c^2)^(1/2)*4i + b^2*c^4*d^3*sin(x/2)*(d^2 - c^2)^(1/2)*1i + b^2*c^5*d^2*sin(x/2)*(d^2 - c^2)^(1/2)*5i + a
*b*d^7*sin(x/2)*(d^2 - c^2)^(1/2)*2i - a*b*c*d^4*sin(x/2)*(d^2 - c^2)^(3/2)*4i + a*b*c*d^6*sin(x/2)*(d^2 - c^2
)^(1/2)*2i - a*b*c^2*d^5*sin(x/2)*(d^2 - c^2)^(1/2)*4i + a*b*c^3*d^2*sin(x/2)*(d^2 - c^2)^(3/2)*4i - a*b*c^3*d
^4*sin(x/2)*(d^2 - c^2)^(1/2)*4i + a*b*c^4*d^3*sin(x/2)*(d^2 - c^2)^(1/2)*2i + a*b*c^5*d^2*sin(x/2)*(d^2 - c^2
)^(1/2)*2i)/(a^2*d^8*cos(x/2) + b^2*d^8*cos(x/2) + 2*a*b*d^8*cos(x/2) - 2*a^2*c^2*d^6*cos(x/2) + a^2*c^4*d^4*c
os(x/2) - 3*b^2*c^2*d^6*cos(x/2) + 3*b^2*c^4*d^4*cos(x/2) - b^2*c^6*d^2*cos(x/2) - 6*a*b*c^2*d^6*cos(x/2) + 6*
a*b*c^4*d^4*cos(x/2) - 2*a*b*c^6*d^2*cos(x/2)))*(d^2 - c^2)^(1/2)*2i)/(d^4 - c^2*d^2) + (b*c^2*atan((a^2*d^7*s
in(x/2)*(d^2 - c^2)^(1/2)*1i - b^2*c^5*sin(x/2)*(d^2 - c^2)^(3/2)*2i - b^2*c^7*sin(x/2)*(d^2 - c^2)^(1/2)*2i +
b^2*d^7*sin(x/2)*(d^2 - c^2)^(1/2)*1i - a^2*c*d^4*sin(x/2)*(d^2 - c^2)^(3/2)*2i + a^2*c*d^6*sin(x/2)*(d^2 - c
^2)^(1/2)*1i - b^2*c*d^4*sin(x/2)*(d^2 - c^2)^(3/2)*2i + b^2*c*d^6*sin(x/2)*(d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