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

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

Optimal result

Integrand size = 12, antiderivative size = 21 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {1}{3} \log \left (4+3 \cot \left (\frac {\pi }{4}+\frac {x}{2}\right )\right ) \]

[Out]

-1/3*ln(4+3*cot(1/4*Pi+1/2*x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 21, 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.167, Rules used = {3202, 31} \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {1}{3} \log \left (3 \cot \left (\frac {x}{2}+\frac {\pi }{4}\right )+4\right ) \]

[In]

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

[Out]

-1/3*Log[4 + 3*Cot[Pi/4 + x/2]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3202

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

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{4+3 x} \, dx,x,\cot \left (\frac {\pi }{4}+\frac {x}{2}\right )\right ) \\ & = -\frac {1}{3} \log \left (4+3 \cot \left (\frac {\pi }{4}+\frac {x}{2}\right )\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.86 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=\frac {1}{3} \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )-\frac {1}{3} \log \left (7 \cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \]

[In]

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

[Out]

Log[Cos[x/2] + Sin[x/2]]/3 - Log[7*Cos[x/2] + Sin[x/2]]/3

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95

method result size
default \(-\frac {\ln \left (\tan \left (\frac {x}{2}\right )+7\right )}{3}+\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{3}\) \(20\)
norman \(-\frac {\ln \left (\tan \left (\frac {x}{2}\right )+7\right )}{3}+\frac {\ln \left (1+\tan \left (\frac {x}{2}\right )\right )}{3}\) \(20\)
parallelrisch \(\ln \left (\frac {1}{\left (\tan \left (\frac {x}{2}\right )+7\right )^{\frac {1}{3}}}\right )+\ln \left (\left (1+\tan \left (\frac {x}{2}\right )\right )^{\frac {1}{3}}\right )\) \(20\)
risch \(\frac {\ln \left (i+{\mathrm e}^{i x}\right )}{3}-\frac {\ln \left ({\mathrm e}^{i x}+\frac {24}{25}+\frac {7 i}{25}\right )}{3}\) \(25\)

[In]

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

[Out]

-1/3*ln(tan(1/2*x)+7)+1/3*ln(1+tan(1/2*x))

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {1}{6} \, \log \left (24 \, \cos \left (x\right ) + 7 \, \sin \left (x\right ) + 25\right ) + \frac {1}{6} \, \log \left (\sin \left (x\right ) + 1\right ) \]

[In]

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

[Out]

-1/6*log(24*cos(x) + 7*sin(x) + 25) + 1/6*log(sin(x) + 1)

Sympy [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.90 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=\frac {\log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )}}{3} - \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} + 7 \right )}}{3} \]

[In]

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

[Out]

log(tan(x/2) + 1)/3 - log(tan(x/2) + 7)/3

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.38 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {1}{3} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 7\right ) + \frac {1}{3} \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) \]

[In]

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

[Out]

-1/3*log(sin(x)/(cos(x) + 1) + 7) + 1/3*log(sin(x)/(cos(x) + 1) + 1)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {1}{3} \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 7 \right |}\right ) + \frac {1}{3} \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) \]

[In]

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

[Out]

-1/3*log(abs(tan(1/2*x) + 7)) + 1/3*log(abs(tan(1/2*x) + 1))

Mupad [B] (verification not implemented)

Time = 0.39 (sec) , antiderivative size = 11, normalized size of antiderivative = 0.52 \[ \int \frac {1}{4+3 \cos (x)+4 \sin (x)} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {4}{3}\right )}{3} \]

[In]

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

[Out]

-(2*atanh(tan(x/2)/3 + 4/3))/3