\(\int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx\) [384]

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

Optimal result

Integrand size = 24, antiderivative size = 33 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=-\frac {\log \left (a+b \cot \left (\frac {d}{2}+\frac {\pi }{4}+\frac {e x}{2}\right )\right )}{2 b e} \]

[Out]

-1/2*ln(a+b*cot(1/2*d+1/4*Pi+1/2*e*x))/b/e

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 33, 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.083, Rules used = {3202, 31} \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=-\frac {\log \left (a+b \cot \left (\frac {d}{2}+\frac {e x}{2}+\frac {\pi }{4}\right )\right )}{2 b e} \]

[In]

Int[(2*a + 2*b*Cos[d + e*x] + 2*a*Sin[d + e*x])^(-1),x]

[Out]

-1/2*Log[a + b*Cot[d/2 + Pi/4 + (e*x)/2]]/(b*e)

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}& = -\frac {\text {Subst}\left (\int \frac {1}{2 a+2 b x} \, dx,x,\cot \left (\frac {\pi }{4}+\frac {1}{2} (d+e x)\right )\right )}{e} \\ & = -\frac {\log \left (a+b \cot \left (\frac {d}{2}+\frac {\pi }{4}+\frac {e x}{2}\right )\right )}{2 b e} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(93\) vs. \(2(33)=66\).

Time = 0.12 (sec) , antiderivative size = 93, normalized size of antiderivative = 2.82 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=\frac {1}{2} \left (\frac {\log \left (\cos \left (\frac {1}{2} (d+e x)\right )+\sin \left (\frac {1}{2} (d+e x)\right )\right )}{b e}-\frac {\log \left (a \cos \left (\frac {1}{2} (d+e x)\right )+b \cos \left (\frac {1}{2} (d+e x)\right )+a \sin \left (\frac {1}{2} (d+e x)\right )-b \sin \left (\frac {1}{2} (d+e x)\right )\right )}{b e}\right ) \]

[In]

Integrate[(2*a + 2*b*Cos[d + e*x] + 2*a*Sin[d + e*x])^(-1),x]

[Out]

(Log[Cos[(d + e*x)/2] + Sin[(d + e*x)/2]]/(b*e) - Log[a*Cos[(d + e*x)/2] + b*Cos[(d + e*x)/2] + a*Sin[(d + e*x
)/2] - b*Sin[(d + e*x)/2]]/(b*e))/2

Maple [A] (verified)

Time = 0.90 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.30

method result size
parallelrisch \(\frac {\ln \left (1+\tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )-\ln \left (a +b +\left (a -b \right ) \tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{2 b e}\) \(43\)
norman \(\frac {\ln \left (1+\tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{2 b e}-\frac {\ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )+a +b \right )}{2 b e}\) \(57\)
risch \(\frac {\ln \left ({\mathrm e}^{i \left (e x +d \right )}+i\right )}{2 b e}-\frac {\ln \left ({\mathrm e}^{i \left (e x +d \right )}+\frac {i a +b}{i b +a}\right )}{2 b e}\) \(57\)
derivativedivides \(\frac {\frac {\ln \left (1+\tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{b}+\frac {\left (-a +b \right ) \ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )+a +b \right )}{b \left (a -b \right )}}{2 e}\) \(66\)
default \(\frac {\frac {\ln \left (1+\tan \left (\frac {e x}{2}+\frac {d}{2}\right )\right )}{b}+\frac {\left (-a +b \right ) \ln \left (a \tan \left (\frac {e x}{2}+\frac {d}{2}\right )-b \tan \left (\frac {e x}{2}+\frac {d}{2}\right )+a +b \right )}{b \left (a -b \right )}}{2 e}\) \(66\)

[In]

int(1/(2*a+2*b*cos(e*x+d)+2*a*sin(e*x+d)),x,method=_RETURNVERBOSE)

[Out]

1/2*(ln(1+tan(1/2*e*x+1/2*d))-ln(a+b+(a-b)*tan(1/2*e*x+1/2*d)))/b/e

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (25) = 50\).

Time = 0.27 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.64 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=-\frac {\log \left (2 \, a b \cos \left (e x + d\right ) + a^{2} + b^{2} + {\left (a^{2} - b^{2}\right )} \sin \left (e x + d\right )\right ) - \log \left (\sin \left (e x + d\right ) + 1\right )}{4 \, b e} \]

[In]

integrate(1/(2*a+2*b*cos(e*x+d)+2*a*sin(e*x+d)),x, algorithm="fricas")

[Out]

-1/4*(log(2*a*b*cos(e*x + d) + a^2 + b^2 + (a^2 - b^2)*sin(e*x + d)) - log(sin(e*x + d) + 1))/(b*e)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 107 vs. \(2 (24) = 48\).

Time = 1.00 (sec) , antiderivative size = 107, normalized size of antiderivative = 3.24 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=\begin {cases} \frac {\tilde {\infty } x}{\cos {\left (d \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge e = 0 \\- \frac {1}{a e \tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} + a e} & \text {for}\: b = 0 \\\frac {x}{2 a \sin {\left (d \right )} + 2 a + 2 b \cos {\left (d \right )}} & \text {for}\: e = 0 \\\frac {\log {\left (\tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} + 1 \right )}}{2 b e} & \text {for}\: a = b \\\frac {\log {\left (\tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} + 1 \right )}}{2 b e} - \frac {\log {\left (\frac {a}{a - b} + \frac {b}{a - b} + \tan {\left (\frac {d}{2} + \frac {e x}{2} \right )} \right )}}{2 b e} & \text {otherwise} \end {cases} \]

[In]

integrate(1/(2*a+2*b*cos(e*x+d)+2*a*sin(e*x+d)),x)

[Out]

Piecewise((zoo*x/cos(d), Eq(a, 0) & Eq(b, 0) & Eq(e, 0)), (-1/(a*e*tan(d/2 + e*x/2) + a*e), Eq(b, 0)), (x/(2*a
*sin(d) + 2*a + 2*b*cos(d)), Eq(e, 0)), (log(tan(d/2 + e*x/2) + 1)/(2*b*e), Eq(a, b)), (log(tan(d/2 + e*x/2) +
 1)/(2*b*e) - log(a/(a - b) + b/(a - b) + tan(d/2 + e*x/2))/(2*b*e), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (25) = 50\).

Time = 0.22 (sec) , antiderivative size = 66, normalized size of antiderivative = 2.00 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=-\frac {\frac {\log \left (-a - b - \frac {{\left (a - b\right )} \sin \left (e x + d\right )}{\cos \left (e x + d\right ) + 1}\right )}{b} - \frac {\log \left (\frac {\sin \left (e x + d\right )}{\cos \left (e x + d\right ) + 1} + 1\right )}{b}}{2 \, e} \]

[In]

integrate(1/(2*a+2*b*cos(e*x+d)+2*a*sin(e*x+d)),x, algorithm="maxima")

[Out]

-1/2*(log(-a - b - (a - b)*sin(e*x + d)/(cos(e*x + d) + 1))/b - log(sin(e*x + d)/(cos(e*x + d) + 1) + 1)/b)/e

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 79 vs. \(2 (25) = 50\).

Time = 0.29 (sec) , antiderivative size = 79, normalized size of antiderivative = 2.39 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=\frac {\log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, b \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) + 2 \, a - 2 \, {\left | b \right |} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) - 2 \, b \tan \left (\frac {1}{2} \, e x + \frac {1}{2} \, d\right ) + 2 \, a + 2 \, {\left | b \right |} \right |}}\right )}{2 \, e {\left | b \right |}} \]

[In]

integrate(1/(2*a+2*b*cos(e*x+d)+2*a*sin(e*x+d)),x, algorithm="giac")

[Out]

1/2*log(abs(2*a*tan(1/2*e*x + 1/2*d) - 2*b*tan(1/2*e*x + 1/2*d) + 2*a - 2*abs(b))/abs(2*a*tan(1/2*e*x + 1/2*d)
 - 2*b*tan(1/2*e*x + 1/2*d) + 2*a + 2*abs(b)))/(e*abs(b))

Mupad [B] (verification not implemented)

Time = 27.37 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.00 \[ \int \frac {1}{2 a+2 b \cos (d+e x)+2 a \sin (d+e x)} \, dx=-\frac {\mathrm {atanh}\left (\frac {a+\frac {\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\left (2\,a-2\,b\right )}{2}}{b}\right )}{b\,e} \]

[In]

int(1/(2*a + 2*b*cos(d + e*x) + 2*a*sin(d + e*x)),x)

[Out]

-atanh((a + (tan(d/2 + (e*x)/2)*(2*a - 2*b))/2)/b)/(b*e)