3.210 \(\int \frac{-1+\frac{c^2}{d^2}+\cos ^2(x)}{c+d \sin (x)} \, dx\)

Optimal. Leaf size=13 \[ \frac{c x}{d^2}+\frac{\cos (x)}{d} \]

[Out]

(c*x)/d^2 + Cos[x]/d

________________________________________________________________________________________

Rubi [A]  time = 0.11933, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.136, Rules used = {4397, 3016, 2638} \[ \frac{c x}{d^2}+\frac{\cos (x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(-1 + c^2/d^2 + Cos[x]^2)/(c + d*Sin[x]),x]

[Out]

(c*x)/d^2 + Cos[x]/d

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 3016

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
C/b^2, Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[-a + b*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C, m}, x
] && EqQ[A*b^2 + a^2*C, 0]

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{-1+\frac{c^2}{d^2}+\cos ^2(x)}{c+d \sin (x)} \, dx &=\int \frac{\frac{c^2}{d^2}-\sin ^2(x)}{c+d \sin (x)} \, dx\\ &=-\frac{\int (-c+d \sin (x)) \, dx}{d^2}\\ &=\frac{c x}{d^2}-\frac{\int \sin (x) \, dx}{d}\\ &=\frac{c x}{d^2}+\frac{\cos (x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0100794, size = 13, normalized size = 1. \[ \frac{c x}{d^2}+\frac{\cos (x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(-1 + c^2/d^2 + Cos[x]^2)/(c + d*Sin[x]),x]

[Out]

(c*x)/d^2 + Cos[x]/d

________________________________________________________________________________________

Maple [B]  time = 0.044, size = 28, normalized size = 2.2 \begin{align*} 2\,{\frac{1}{d \left ( 1+ \left ( \tan \left ( x/2 \right ) \right ) ^{2} \right ) }}+2\,{\frac{c\arctan \left ( \tan \left ( x/2 \right ) \right ) }{{d}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1+c^2/d^2+cos(x)^2)/(c+d*sin(x)),x)

[Out]

2/d/(1+tan(1/2*x)^2)+2/d^2*c*arctan(tan(1/2*x))

________________________________________________________________________________________

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]

integrate((-1+c^2/d^2+cos(x)^2)/(c+d*sin(x)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.41321, size = 30, normalized size = 2.31 \begin{align*} \frac{c x + d \cos \left (x\right )}{d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+c^2/d^2+cos(x)^2)/(c+d*sin(x)),x, algorithm="fricas")

[Out]

(c*x + d*cos(x))/d^2

________________________________________________________________________________________

Sympy [B]  time = 152.837, size = 76, normalized size = 5.85 \begin{align*} \frac{c x \tan ^{2}{\left (\frac{x}{2} \right )}}{d^{2} \tan ^{2}{\left (\frac{x}{2} \right )} + d^{2}} + \frac{c x}{d^{2} \tan ^{2}{\left (\frac{x}{2} \right )} + d^{2}} - \frac{d \tan ^{2}{\left (\frac{x}{2} \right )}}{d^{2} \tan ^{2}{\left (\frac{x}{2} \right )} + d^{2}} + \frac{d}{d^{2} \tan ^{2}{\left (\frac{x}{2} \right )} + d^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+c**2/d**2+cos(x)**2)/(c+d*sin(x)),x)

[Out]

c*x*tan(x/2)**2/(d**2*tan(x/2)**2 + d**2) + c*x/(d**2*tan(x/2)**2 + d**2) - d*tan(x/2)**2/(d**2*tan(x/2)**2 +
d**2) + d/(d**2*tan(x/2)**2 + d**2)

________________________________________________________________________________________

Giac [A]  time = 1.1409, size = 30, normalized size = 2.31 \begin{align*} \frac{c x}{d^{2}} + \frac{2}{{\left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+c^2/d^2+cos(x)^2)/(c+d*sin(x)),x, algorithm="giac")

[Out]

c*x/d^2 + 2/((tan(1/2*x)^2 + 1)*d)