3.4.10 \(\int \frac {1}{1+\cos (x)+\sin (x)} \, dx\) [310]

Optimal. Leaf size=9 \[ \log \left (1+\tan \left (\frac {x}{2}\right )\right ) \]

[Out]

ln(1+tan(1/2*x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 9, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3203, 31} \begin {gather*} \log \left (\tan \left (\frac {x}{2}\right )+1\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

Log[1 + Tan[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 3203

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 {gather*} \begin {aligned} \text {Integral} &=2 \text {Subst}\left (\int \frac {1}{2+2 x} \, dx,x,\tan \left (\frac {x}{2}\right )\right )\\ &=\log \left (1+\tan \left (\frac {x}{2}\right )\right )\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(24\) vs. \(2(9)=18\).
time = 0.01, size = 24, normalized size = 2.67 \begin {gather*} -\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-Log[Cos[x/2]] + Log[Cos[x/2] + Sin[x/2]]

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 8, normalized size = 0.89

method result size
default \(\ln \left (1+\tan \left (\frac {x}{2}\right )\right )\) \(8\)
parallelrisch \(\ln \left (1+\tan \left (\frac {x}{2}\right )\right )\) \(8\)
norman \(\ln \left (2+2 \tan \left (\frac {x}{2}\right )\right )\) \(10\)
risch \(\ln \left (i+{\mathrm e}^{i x}\right )-\ln \left ({\mathrm e}^{i x}+1\right )\) \(21\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(1+tan(1/2*x))

________________________________________________________________________________________

Maxima [A]
time = 0.33, size = 12, normalized size = 1.33 \begin {gather*} \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sin(x)/(cos(x) + 1) + 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (7) = 14\).
time = 0.60, size = 17, normalized size = 1.89 \begin {gather*} -\frac {1}{2} \, \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*log(1/2*cos(x) + 1/2) + 1/2*log(sin(x) + 1)

________________________________________________________________________________________

Sympy [A]
time = 0.10, size = 7, normalized size = 0.78 \begin {gather*} \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(x)+sin(x)),x)

[Out]

log(tan(x/2) + 1)

________________________________________________________________________________________

Giac [A]
time = 0.60, size = 8, normalized size = 0.89 \begin {gather*} \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(abs(tan(1/2*x) + 1))

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 7, normalized size = 0.78 \begin {gather*} \ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x) + sin(x) + 1),x)

[Out]

log(tan(x/2) + 1)

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 19, normalized size = 2.11 \begin {gather*} -2 \ln \left (\frac {\tan \left (\frac {x}{2}\right )}{2}+\frac {1}{2}-\frac {\sin \left (x \right )}{2 \cos \left (x \right )}\right ) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

int(1/(1+cos(x)+sin(x)),x)

[Out]

-2*ln(1/2*tan(1/2*x)+1/2-1/2*sin(x)/cos(x))

________________________________________________________________________________________