\(\int \frac {3}{5+4 \sin (x)} \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 14 \[ \int \frac {3}{5+4 \sin (x)} \, dx=x+2 \arctan \left (\frac {\cos (x)}{2+\sin (x)}\right ) \]

[Out]

x+2*arctan(cos(x)/(2+sin(x)))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {12, 2736} \[ \int \frac {3}{5+4 \sin (x)} \, dx=2 \arctan \left (\frac {\cos (x)}{\sin (x)+2}\right )+x \]

[In]

Int[3/(5 + 4*Sin[x]),x]

[Out]

x + 2*ArcTan[Cos[x]/(2 + Sin[x])]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2736

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{q = Rt[a^2 - b^2, 2]}, Simp[x/q, x] + Simp
[(2/(d*q))*ArcTan[b*(Cos[c + d*x]/(a + q + b*Sin[c + d*x]))], x]] /; FreeQ[{a, b, c, d}, x] && GtQ[a^2 - b^2,
0] && PosQ[a]

Rubi steps \begin{align*} \text {integral}& = 3 \int \frac {1}{5+4 \sin (x)} \, dx \\ & = x+2 \arctan \left (\frac {\cos (x)}{2+\sin (x)}\right ) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(79\) vs. \(2(14)=28\).

Time = 0.03 (sec) , antiderivative size = 79, normalized size of antiderivative = 5.64 \[ \int \frac {3}{5+4 \sin (x)} \, dx=3 \left (-\frac {1}{3} \arctan \left (\frac {2 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+2 \sin \left (\frac {x}{2}\right )}\right )+\frac {1}{3} \arctan \left (\frac {\cos \left (\frac {x}{2}\right )+2 \sin \left (\frac {x}{2}\right )}{2 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}\right )\right ) \]

[In]

Integrate[3/(5 + 4*Sin[x]),x]

[Out]

3*(-1/3*ArcTan[(2*Cos[x/2] + Sin[x/2])/(Cos[x/2] + 2*Sin[x/2])] + ArcTan[(Cos[x/2] + 2*Sin[x/2])/(2*Cos[x/2] +
 Sin[x/2])]/3)

Maple [A] (verified)

Time = 0.25 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86

method result size
default \(2 \arctan \left (\frac {5 \tan \left (\frac {x}{2}\right )}{3}+\frac {4}{3}\right )\) \(12\)
risch \(i \ln \left ({\mathrm e}^{i x}+2 i\right )-i \ln \left ({\mathrm e}^{i x}+\frac {i}{2}\right )\) \(26\)
parallelrisch \(-i \left (\ln \left (5 \tan \left (\frac {x}{2}\right )+4-3 i\right )-\ln \left (5 \tan \left (\frac {x}{2}\right )+4+3 i\right )\right )\) \(29\)

[In]

int(3/(5+4*sin(x)),x,method=_RETURNVERBOSE)

[Out]

2*arctan(5/3*tan(1/2*x)+4/3)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93 \[ \int \frac {3}{5+4 \sin (x)} \, dx=\arctan \left (\frac {5 \, \sin \left (x\right ) + 4}{3 \, \cos \left (x\right )}\right ) \]

[In]

integrate(3/(5+4*sin(x)),x, algorithm="fricas")

[Out]

arctan(1/3*(5*sin(x) + 4)/cos(x))

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 27 vs. \(2 (12) = 24\).

Time = 0.14 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.93 \[ \int \frac {3}{5+4 \sin (x)} \, dx=2 \operatorname {atan}{\left (\frac {5 \tan {\left (\frac {x}{2} \right )}}{3} + \frac {4}{3} \right )} + 2 \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \]

[In]

integrate(3/(5+4*sin(x)),x)

[Out]

2*atan(5*tan(x/2)/3 + 4/3) + 2*pi*floor((x/2 - pi/2)/pi)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.07 \[ \int \frac {3}{5+4 \sin (x)} \, dx=2 \, \arctan \left (\frac {5 \, \sin \left (x\right )}{3 \, {\left (\cos \left (x\right ) + 1\right )}} + \frac {4}{3}\right ) \]

[In]

integrate(3/(5+4*sin(x)),x, algorithm="maxima")

[Out]

2*arctan(5/3*sin(x)/(cos(x) + 1) + 4/3)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.79 \[ \int \frac {3}{5+4 \sin (x)} \, dx=x + 2 \, \arctan \left (-\frac {2 \, \cos \left (x\right ) + \sin \left (x\right ) + 2}{\cos \left (x\right ) - 2 \, \sin \left (x\right ) - 4}\right ) \]

[In]

integrate(3/(5+4*sin(x)),x, algorithm="giac")

[Out]

x + 2*arctan(-(2*cos(x) + sin(x) + 2)/(cos(x) - 2*sin(x) - 4))

Mupad [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.43 \[ \int \frac {3}{5+4 \sin (x)} \, dx=x+2\,\mathrm {atan}\left (\frac {5\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {4}{3}\right )-2\,\mathrm {atan}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right ) \]

[In]

int(3/(4*sin(x) + 5),x)

[Out]

x + 2*atan((5*tan(x/2))/3 + 4/3) - 2*atan(tan(x/2))