3.377 \(\int \frac{1}{3+4 \cos (x)+4 \sin (x)} \, dx\)

Optimal. Leaf size=33 \[ -\frac{\tanh ^{-1}\left (\frac{\sqrt{23} (\cos (x)-\sin (x))}{3 \sin (x)+3 \cos (x)+8}\right )}{\sqrt{23}} \]

[Out]

-(ArcTanh[(Sqrt[23]*(Cos[x] - Sin[x]))/(8 + 3*Cos[x] + 3*Sin[x])]/Sqrt[23])

________________________________________________________________________________________

Rubi [B]  time = 0.0735646, antiderivative size = 94, normalized size of antiderivative = 2.85, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3124, 618, 206} \[ \frac{\log \left (\sqrt{23} \sin (x)-4 \sin (x)-4 \sqrt{23} \cos (x)+19 \cos (x)+4 \left (5-\sqrt{23}\right )\right )}{2 \sqrt{23}}-\frac{\log \left (-\sqrt{23} \sin (x)-4 \sin (x)+4 \sqrt{23} \cos (x)+19 \cos (x)+4 \left (5+\sqrt{23}\right )\right )}{2 \sqrt{23}} \]

Antiderivative was successfully verified.

[In]

Int[(3 + 4*Cos[x] + 4*Sin[x])^(-1),x]

[Out]

-Log[4*(5 + Sqrt[23]) + 19*Cos[x] + 4*Sqrt[23]*Cos[x] - 4*Sin[x] - Sqrt[23]*Sin[x]]/(2*Sqrt[23]) + Log[4*(5 -
Sqrt[23]) + 19*Cos[x] - 4*Sqrt[23]*Cos[x] - 4*Sin[x] + Sqrt[23]*Sin[x]]/(2*Sqrt[23])

Rule 3124

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2], x]}, Dist[(2*f)/e, Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d +
e*x)/2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{1}{3+4 \cos (x)+4 \sin (x)} \, dx &=2 \operatorname{Subst}\left (\int \frac{1}{7+8 x-x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=-\left (4 \operatorname{Subst}\left (\int \frac{1}{92-x^2} \, dx,x,8-2 \tan \left (\frac{x}{2}\right )\right )\right )\\ &=-\frac{\log \left (4 \left (5+\sqrt{23}\right )+19 \cos (x)+4 \sqrt{23} \cos (x)-4 \sin (x)-\sqrt{23} \sin (x)\right )}{2 \sqrt{23}}+\frac{\log \left (4 \left (5-\sqrt{23}\right )+19 \cos (x)-4 \sqrt{23} \cos (x)-4 \sin (x)+\sqrt{23} \sin (x)\right )}{2 \sqrt{23}}\\ \end{align*}

Mathematica [A]  time = 0.0429494, size = 22, normalized size = 0.67 \[ \frac{2 \tanh ^{-1}\left (\frac{\tan \left (\frac{x}{2}\right )-4}{\sqrt{23}}\right )}{\sqrt{23}} \]

Antiderivative was successfully verified.

[In]

Integrate[(3 + 4*Cos[x] + 4*Sin[x])^(-1),x]

[Out]

(2*ArcTanh[(-4 + Tan[x/2])/Sqrt[23]])/Sqrt[23]

________________________________________________________________________________________

Maple [A]  time = 0.031, size = 20, normalized size = 0.6 \begin{align*}{\frac{2\,\sqrt{23}}{23}{\it Artanh} \left ({\frac{\sqrt{23}}{46} \left ( -8+2\,\tan \left ( x/2 \right ) \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(3+4*cos(x)+4*sin(x)),x)

[Out]

2/23*23^(1/2)*arctanh(1/46*(-8+2*tan(1/2*x))*23^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.4106, size = 53, normalized size = 1.61 \begin{align*} -\frac{1}{23} \, \sqrt{23} \log \left (-\frac{\sqrt{23} - \frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 4}{\sqrt{23} + \frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 4}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/23*sqrt(23)*log(-(sqrt(23) - sin(x)/(cos(x) + 1) + 4)/(sqrt(23) + sin(x)/(cos(x) + 1) - 4))

________________________________________________________________________________________

Fricas [B]  time = 2.22366, size = 230, normalized size = 6.97 \begin{align*} \frac{1}{46} \, \sqrt{23} \log \left (-\frac{6 \, \sqrt{23} \cos \left (x\right )^{2} + 8 \,{\left (\sqrt{23} - 3\right )} \cos \left (x\right ) - 2 \,{\left (4 \, \sqrt{23} - 7 \, \cos \left (x\right ) + 12\right )} \sin \left (x\right ) - 3 \, \sqrt{23} - 48}{8 \,{\left (4 \, \cos \left (x\right ) + 3\right )} \sin \left (x\right ) + 24 \, \cos \left (x\right ) + 25}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/46*sqrt(23)*log(-(6*sqrt(23)*cos(x)^2 + 8*(sqrt(23) - 3)*cos(x) - 2*(4*sqrt(23) - 7*cos(x) + 12)*sin(x) - 3*
sqrt(23) - 48)/(8*(4*cos(x) + 3)*sin(x) + 24*cos(x) + 25))

________________________________________________________________________________________

Sympy [A]  time = 1.71092, size = 39, normalized size = 1.18 \begin{align*} \frac{\sqrt{23} \log{\left (\tan{\left (\frac{x}{2} \right )} - 4 + \sqrt{23} \right )}}{23} - \frac{\sqrt{23} \log{\left (\tan{\left (\frac{x}{2} \right )} - \sqrt{23} - 4 \right )}}{23} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(3+4*cos(x)+4*sin(x)),x)

[Out]

sqrt(23)*log(tan(x/2) - 4 + sqrt(23))/23 - sqrt(23)*log(tan(x/2) - sqrt(23) - 4)/23

________________________________________________________________________________________

Giac [A]  time = 1.15066, size = 50, normalized size = 1.52 \begin{align*} -\frac{1}{23} \, \sqrt{23} \log \left (\frac{{\left | -2 \, \sqrt{23} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 8 \right |}}{{\left | 2 \, \sqrt{23} + 2 \, \tan \left (\frac{1}{2} \, x\right ) - 8 \right |}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/23*sqrt(23)*log(abs(-2*sqrt(23) + 2*tan(1/2*x) - 8)/abs(2*sqrt(23) + 2*tan(1/2*x) - 8))