3.379 \(\int \frac {1}{4+4 \cot (x)+\tan (x)} \, dx\)

Optimal. Leaf size=28 \[ \frac {4 x}{25}+\frac {2}{5 (\tan (x)+2)}-\frac {3}{25} \log (\sin (x)+2 \cos (x)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {801, 635, 203, 260} \[ \frac {4 x}{25}+\frac {2}{5 (\tan (x)+2)}-\frac {3}{25} \log (\sin (x)+2 \cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[(4 + 4*Cot[x] + Tan[x])^(-1),x]

[Out]

(4*x)/25 - (3*Log[2*Cos[x] + Sin[x]])/25 + 2/(5*(2 + Tan[x]))

Rule 203

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

Rule 260

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

Rule 635

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

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 {1}{4+4 \cot (x)+\tan (x)} \, dx &=\operatorname {Subst}\left (\int \frac {x}{(2+x)^2 \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\operatorname {Subst}\left (\int \left (-\frac {2}{5 (2+x)^2}-\frac {3}{25 (2+x)}+\frac {4+3 x}{25 \left (1+x^2\right )}\right ) \, dx,x,\tan (x)\right )\\ &=-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}+\frac {1}{25} \operatorname {Subst}\left (\int \frac {4+3 x}{1+x^2} \, dx,x,\tan (x)\right )\\ &=-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}+\frac {3}{25} \operatorname {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,\tan (x)\right )+\frac {4}{25} \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )\\ &=\frac {4 x}{25}-\frac {3}{25} \log (\cos (x))-\frac {3}{25} \log (2+\tan (x))+\frac {2}{5 (2+\tan (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 41, normalized size = 1.46 \[ \frac {4 x-3 \log (\sin (x)+2 \cos (x))+\cot (x) (8 x-6 \log (\sin (x)+2 \cos (x)))-5}{50 \cot (x)+25} \]

Antiderivative was successfully verified.

[In]

Integrate[(4 + 4*Cot[x] + Tan[x])^(-1),x]

[Out]

(-5 + 4*x + Cot[x]*(8*x - 6*Log[2*Cos[x] + Sin[x]]) - 3*Log[2*Cos[x] + Sin[x]])/(25 + 50*Cot[x])

________________________________________________________________________________________

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

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[(4 + 4*Cot[x] + Tan[x])^(-1),x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [B]  time = 1.00, size = 46, normalized size = 1.64 \[ -\frac {3 \, {\left (\tan \relax (x) + 2\right )} \log \left (\frac {\tan \relax (x)^{2} + 4 \, \tan \relax (x) + 4}{\tan \relax (x)^{2} + 1}\right ) - 8 \, {\left (x - 1\right )} \tan \relax (x) - 16 \, x - 4}{50 \, {\left (\tan \relax (x) + 2\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4+4*cot(x)+tan(x)),x, algorithm="fricas")

[Out]

-1/50*(3*(tan(x) + 2)*log((tan(x)^2 + 4*tan(x) + 4)/(tan(x)^2 + 1)) - 8*(x - 1)*tan(x) - 16*x - 4)/(tan(x) + 2
)

________________________________________________________________________________________

giac [A]  time = 0.63, size = 29, normalized size = 1.04 \[ \frac {4}{25} \, x + \frac {2}{5 \, {\left (\tan \relax (x) + 2\right )}} + \frac {3}{50} \, \log \left (\tan \relax (x)^{2} + 1\right ) - \frac {3}{25} \, \log \left ({\left | \tan \relax (x) + 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4+4*cot(x)+tan(x)),x, algorithm="giac")

[Out]

4/25*x + 2/5/(tan(x) + 2) + 3/50*log(tan(x)^2 + 1) - 3/25*log(abs(tan(x) + 2))

________________________________________________________________________________________

maple [A]  time = 0.21, size = 31, normalized size = 1.11




method result size



default \(\frac {3 \ln \left (1+\tan ^{2}\relax (x )\right )}{50}+\frac {4 \arctan \left (\tan \relax (x )\right )}{25}+\frac {2}{5 \left (2+\tan \relax (x )\right )}-\frac {3 \ln \left (2+\tan \relax (x )\right )}{25}\) \(31\)
norman \(\frac {\frac {8 x}{25}+\frac {4 x \tan \relax (x )}{25}+\frac {2}{5}}{2+\tan \relax (x )}-\frac {3 \ln \left (2+\tan \relax (x )\right )}{25}+\frac {3 \ln \left (1+\tan ^{2}\relax (x )\right )}{50}\) \(35\)
risch \(\frac {4 x}{25}+\frac {3 i x}{25}+\frac {16}{25 \left (5 \,{\mathrm e}^{2 i x}+3+4 i\right )}-\frac {12 i}{25 \left (5 \,{\mathrm e}^{2 i x}+3+4 i\right )}-\frac {3 \ln \left ({\mathrm e}^{2 i x}+\frac {3}{5}+\frac {4 i}{5}\right )}{25}\) \(52\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(4+4*cot(x)+tan(x)),x,method=_RETURNVERBOSE)

[Out]

3/50*ln(1+tan(x)^2)+4/25*arctan(tan(x))+2/5/(2+tan(x))-3/25*ln(2+tan(x))

________________________________________________________________________________________

maxima [A]  time = 0.96, size = 28, normalized size = 1.00 \[ \frac {4}{25} \, x + \frac {2}{5 \, {\left (\tan \relax (x) + 2\right )}} + \frac {3}{50} \, \log \left (\tan \relax (x)^{2} + 1\right ) - \frac {3}{25} \, \log \left (\tan \relax (x) + 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4+4*cot(x)+tan(x)),x, algorithm="maxima")

[Out]

4/25*x + 2/5/(tan(x) + 2) + 3/50*log(tan(x)^2 + 1) - 3/25*log(tan(x) + 2)

________________________________________________________________________________________

mupad [B]  time = 0.32, size = 38, normalized size = 1.36 \[ \frac {2}{5\,\left (\mathrm {tan}\relax (x)+2\right )}-\frac {3\,\ln \left (\mathrm {tan}\relax (x)+2\right )}{25}+\ln \left (\mathrm {tan}\relax (x)-\mathrm {i}\right )\,\left (\frac {3}{50}-\frac {2}{25}{}\mathrm {i}\right )+\ln \left (\mathrm {tan}\relax (x)+1{}\mathrm {i}\right )\,\left (\frac {3}{50}+\frac {2}{25}{}\mathrm {i}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(4*cot(x) + tan(x) + 4),x)

[Out]

log(tan(x) - 1i)*(3/50 - 2i/25) - (3*log(tan(x) + 2))/25 + log(tan(x) + 1i)*(3/50 + 2i/25) + 2/(5*(tan(x) + 2)
)

________________________________________________________________________________________

sympy [B]  time = 0.49, size = 102, normalized size = 3.64 \[ \frac {8 x \tan {\relax (x )}}{50 \tan {\relax (x )} + 100} + \frac {16 x}{50 \tan {\relax (x )} + 100} - \frac {6 \log {\left (\tan {\relax (x )} + 2 \right )} \tan {\relax (x )}}{50 \tan {\relax (x )} + 100} - \frac {12 \log {\left (\tan {\relax (x )} + 2 \right )}}{50 \tan {\relax (x )} + 100} + \frac {3 \log {\left (\tan ^{2}{\relax (x )} + 1 \right )} \tan {\relax (x )}}{50 \tan {\relax (x )} + 100} + \frac {6 \log {\left (\tan ^{2}{\relax (x )} + 1 \right )}}{50 \tan {\relax (x )} + 100} + \frac {20}{50 \tan {\relax (x )} + 100} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4+4*cot(x)+tan(x)),x)

[Out]

8*x*tan(x)/(50*tan(x) + 100) + 16*x/(50*tan(x) + 100) - 6*log(tan(x) + 2)*tan(x)/(50*tan(x) + 100) - 12*log(ta
n(x) + 2)/(50*tan(x) + 100) + 3*log(tan(x)**2 + 1)*tan(x)/(50*tan(x) + 100) + 6*log(tan(x)**2 + 1)/(50*tan(x)
+ 100) + 20/(50*tan(x) + 100)

________________________________________________________________________________________