3.857 \(\int \frac {\sec (x)}{-5+\cos ^2(x)+4 \sin (x)} \, dx\)

Optimal. Leaf size=44 \[ \frac {1}{3 (2-\sin (x))}+\frac {1}{2} \log (1-\sin (x))-\frac {4}{9} \log (2-\sin (x))-\frac {1}{18} \log (\sin (x)+1) \]

[Out]

1/2*ln(1-sin(x))-4/9*ln(2-sin(x))-1/18*ln(1+sin(x))+1/3/(2-sin(x))

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {710, 801} \[ \frac {1}{3 (2-\sin (x))}+\frac {1}{2} \log (1-\sin (x))-\frac {4}{9} \log (2-\sin (x))-\frac {1}{18} \log (\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]/(-5 + Cos[x]^2 + 4*Sin[x]),x]

[Out]

Log[1 - Sin[x]]/2 - (4*Log[2 - Sin[x]])/9 - Log[1 + Sin[x]]/18 + 1/(3*(2 - Sin[x]))

Rule 710

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*(d + e*x)^(m + 1))/((m + 1)*(c*d^2 +
a*e^2)), x] + Dist[c/(c*d^2 + a*e^2), Int[((d + e*x)^(m + 1)*(d - e*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d,
 e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && LtQ[m, -1]

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

Rubi steps

\begin {align*} \int \frac {\sec (x)}{-5+\cos ^2(x)+4 \sin (x)} \, dx &=\operatorname {Subst}\left (\int \frac {1}{(2-x)^2 \left (-1+x^2\right )} \, dx,x,\sin (x)\right )\\ &=\frac {1}{3 (2-\sin (x))}+\frac {1}{3} \operatorname {Subst}\left (\int \frac {2+x}{(2-x) \left (-1+x^2\right )} \, dx,x,\sin (x)\right )\\ &=\frac {1}{3 (2-\sin (x))}+\frac {1}{3} \operatorname {Subst}\left (\int \left (-\frac {4}{3 (-2+x)}+\frac {3}{2 (-1+x)}-\frac {1}{6 (1+x)}\right ) \, dx,x,\sin (x)\right )\\ &=\frac {1}{2} \log (1-\sin (x))-\frac {4}{9} \log (2-\sin (x))-\frac {1}{18} \log (1+\sin (x))+\frac {1}{3 (2-\sin (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 38, normalized size = 0.86 \[ \frac {1}{18} \left (-\frac {6}{\sin (x)-2}+9 \log (1-\sin (x))-8 \log (2-\sin (x))-\log (\sin (x)+1)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]/(-5 + Cos[x]^2 + 4*Sin[x]),x]

[Out]

(9*Log[1 - Sin[x]] - 8*Log[2 - Sin[x]] - Log[1 + Sin[x]] - 6/(-2 + Sin[x]))/18

________________________________________________________________________________________

fricas [A]  time = 1.17, size = 46, normalized size = 1.05 \[ -\frac {{\left (\sin \relax (x) - 2\right )} \log \left (\sin \relax (x) + 1\right ) + 8 \, {\left (\sin \relax (x) - 2\right )} \log \left (-\frac {1}{2} \, \sin \relax (x) + 1\right ) - 9 \, {\left (\sin \relax (x) - 2\right )} \log \left (-\sin \relax (x) + 1\right ) + 6}{18 \, {\left (\sin \relax (x) - 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(-5+cos(x)^2+4*sin(x)),x, algorithm="fricas")

[Out]

-1/18*((sin(x) - 2)*log(sin(x) + 1) + 8*(sin(x) - 2)*log(-1/2*sin(x) + 1) - 9*(sin(x) - 2)*log(-sin(x) + 1) +
6)/(sin(x) - 2)

________________________________________________________________________________________

giac [A]  time = 0.12, size = 34, normalized size = 0.77 \[ -\frac {1}{3 \, {\left (\sin \relax (x) - 2\right )}} - \frac {1}{18} \, \log \left (\sin \relax (x) + 1\right ) - \frac {4}{9} \, \log \left (-\sin \relax (x) + 2\right ) + \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(-5+cos(x)^2+4*sin(x)),x, algorithm="giac")

[Out]

-1/3/(sin(x) - 2) - 1/18*log(sin(x) + 1) - 4/9*log(-sin(x) + 2) + 1/2*log(-sin(x) + 1)

________________________________________________________________________________________

maple [A]  time = 0.16, size = 31, normalized size = 0.70 \[ -\frac {1}{3 \left (\sin \relax (x )-2\right )}-\frac {4 \ln \left (\sin \relax (x )-2\right )}{9}+\frac {\ln \left (\sin \relax (x )-1\right )}{2}-\frac {\ln \left (1+\sin \relax (x )\right )}{18} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)/(-5+cos(x)^2+4*sin(x)),x)

[Out]

-1/3/(sin(x)-2)-4/9*ln(sin(x)-2)+1/2*ln(sin(x)-1)-1/18*ln(1+sin(x))

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 30, normalized size = 0.68 \[ -\frac {1}{3 \, {\left (\sin \relax (x) - 2\right )}} - \frac {1}{18} \, \log \left (\sin \relax (x) + 1\right ) + \frac {1}{2} \, \log \left (\sin \relax (x) - 1\right ) - \frac {4}{9} \, \log \left (\sin \relax (x) - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(-5+cos(x)^2+4*sin(x)),x, algorithm="maxima")

[Out]

-1/3/(sin(x) - 2) - 1/18*log(sin(x) + 1) + 1/2*log(sin(x) - 1) - 4/9*log(sin(x) - 2)

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 32, normalized size = 0.73 \[ \frac {\ln \left (\sin \relax (x)-1\right )}{2}-\frac {\ln \left (\sin \relax (x)+1\right )}{18}-\frac {4\,\ln \left (\sin \relax (x)-2\right )}{9}-\frac {1}{3\,\left (\sin \relax (x)-2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)*(4*sin(x) + cos(x)^2 - 5)),x)

[Out]

log(sin(x) - 1)/2 - log(sin(x) + 1)/18 - (4*log(sin(x) - 2))/9 - 1/(3*(sin(x) - 2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec {\relax (x )}}{4 \sin {\relax (x )} + \cos ^{2}{\relax (x )} - 5}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)/(-5+cos(x)**2+4*sin(x)),x)

[Out]

Integral(sec(x)/(4*sin(x) + cos(x)**2 - 5), x)

________________________________________________________________________________________