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}} \]

________________________________________________________________________________________

Rubi [B]  time = 0.07, 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.250, 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 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])

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 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]

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.05, 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]

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{3+4 \cos (x)+4 \sin (x)} \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [B]  time = 1.04, size = 66, normalized size = 2.00 \[ \frac {1}{46} \, \sqrt {23} \log \left (-\frac {6 \, \sqrt {23} \cos \relax (x)^{2} + 8 \, {\left (\sqrt {23} - 3\right )} \cos \relax (x) - 2 \, {\left (4 \, \sqrt {23} - 7 \, \cos \relax (x) + 12\right )} \sin \relax (x) - 3 \, \sqrt {23} - 48}{8 \, {\left (4 \, \cos \relax (x) + 3\right )} \sin \relax (x) + 24 \, \cos \relax (x) + 25}\right ) \]

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))

________________________________________________________________________________________

giac [A]  time = 0.68, size = 37, normalized size = 1.12 \[ -\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 ) \]

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))

________________________________________________________________________________________

maple [A]  time = 0.12, size = 20, normalized size = 0.61




method result size



default \(\frac {2 \sqrt {23}\, \arctanh \left (\frac {\left (2 \tan \left (\frac {x}{2}\right )-8\right ) \sqrt {23}}{46}\right )}{23}\) \(20\)
risch \(\frac {\sqrt {23}\, \ln \left ({\mathrm e}^{i x}+\frac {3}{8}+\frac {3 i}{8}-\frac {\sqrt {23}}{8}+\frac {i \sqrt {23}}{8}\right )}{23}-\frac {\sqrt {23}\, \ln \left ({\mathrm e}^{i x}+\frac {3}{8}+\frac {3 i}{8}+\frac {\sqrt {23}}{8}-\frac {i \sqrt {23}}{8}\right )}{23}\) \(54\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.97, size = 39, normalized size = 1.18 \[ -\frac {1}{23} \, \sqrt {23} \log \left (-\frac {\sqrt {23} - \frac {\sin \relax (x)}{\cos \relax (x) + 1} + 4}{\sqrt {23} + \frac {\sin \relax (x)}{\cos \relax (x) + 1} - 4}\right ) \]

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))

________________________________________________________________________________________

mupad [B]  time = 0.08, size = 17, normalized size = 0.52 \[ \frac {2\,\sqrt {23}\,\mathrm {atanh}\left (\frac {\sqrt {23}\,\left (\mathrm {tan}\left (\frac {x}{2}\right )-4\right )}{23}\right )}{23} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*23^(1/2)*atanh((23^(1/2)*(tan(x/2) - 4))/23))/23

________________________________________________________________________________________

sympy [A]  time = 0.59, size = 39, normalized size = 1.18 \[ \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} \]

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

________________________________________________________________________________________