\(\int -\frac {2}{1+3 \cos (4+6 x)} \, dx\) [22]

   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 = 14, antiderivative size = 61 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {\log \left (\sqrt {2} \cos (2+3 x)-\sin (2+3 x)\right )}{6 \sqrt {2}}-\frac {\log \left (\sqrt {2} \cos (2+3 x)+\sin (2+3 x)\right )}{6 \sqrt {2}} \]

[Out]

1/12*ln(-sin(2+3*x)+cos(2+3*x)*2^(1/2))*2^(1/2)-1/12*ln(sin(2+3*x)+cos(2+3*x)*2^(1/2))*2^(1/2)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {12, 2738, 212} \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {\log \left (\sqrt {2} \cos (3 x+2)-\sin (3 x+2)\right )}{6 \sqrt {2}}-\frac {\log \left (\sin (3 x+2)+\sqrt {2} \cos (3 x+2)\right )}{6 \sqrt {2}} \]

[In]

Int[-2/(1 + 3*Cos[4 + 6*x]),x]

[Out]

Log[Sqrt[2]*Cos[2 + 3*x] - Sin[2 + 3*x]]/(6*Sqrt[2]) - Log[Sqrt[2]*Cos[2 + 3*x] + Sin[2 + 3*x]]/(6*Sqrt[2])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 212

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

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\left (2 \int \frac {1}{1+3 \cos (4+6 x)} \, dx\right ) \\ & = -\left (\frac {2}{3} \text {Subst}\left (\int \frac {1}{4-2 x^2} \, dx,x,\tan \left (\frac {1}{2} (4+6 x)\right )\right )\right ) \\ & = \frac {\log \left (\sqrt {2} \cos (2+3 x)-\sin (2+3 x)\right )}{6 \sqrt {2}}-\frac {\log \left (\sqrt {2} \cos (2+3 x)+\sin (2+3 x)\right )}{6 \sqrt {2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.36 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=-\frac {\text {arctanh}\left (\frac {\tan (2+3 x)}{\sqrt {2}}\right )}{3 \sqrt {2}} \]

[In]

Integrate[-2/(1 + 3*Cos[4 + 6*x]),x]

[Out]

-1/3*ArcTanh[Tan[2 + 3*x]/Sqrt[2]]/Sqrt[2]

Maple [A] (verified)

Time = 0.48 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.30

method result size
derivativedivides \(-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\tan \left (2+3 x \right ) \sqrt {2}}{2}\right )}{6}\) \(18\)
default \(-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\tan \left (2+3 x \right ) \sqrt {2}}{2}\right )}{6}\) \(18\)
risch \(-\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (2+3 x \right )}+\frac {1}{3}+\frac {2 i \sqrt {2}}{3}\right )}{12}+\frac {\sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (2+3 x \right )}+\frac {1}{3}-\frac {2 i \sqrt {2}}{3}\right )}{12}\) \(48\)

[In]

int(-2/(1+3*cos(4+6*x)),x,method=_RETURNVERBOSE)

[Out]

-1/6*2^(1/2)*arctanh(1/2*tan(2+3*x)*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.21 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {1}{24} \, \sqrt {2} \log \left (-\frac {7 \, \cos \left (6 \, x + 4\right )^{2} + 4 \, {\left (\sqrt {2} \cos \left (6 \, x + 4\right ) + 3 \, \sqrt {2}\right )} \sin \left (6 \, x + 4\right ) - 6 \, \cos \left (6 \, x + 4\right ) - 17}{9 \, \cos \left (6 \, x + 4\right )^{2} + 6 \, \cos \left (6 \, x + 4\right ) + 1}\right ) \]

[In]

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

[Out]

1/24*sqrt(2)*log(-(7*cos(6*x + 4)^2 + 4*(sqrt(2)*cos(6*x + 4) + 3*sqrt(2))*sin(6*x + 4) - 6*cos(6*x + 4) - 17)
/(9*cos(6*x + 4)^2 + 6*cos(6*x + 4) + 1))

Sympy [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.64 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {\sqrt {2} \log {\left (\tan {\left (3 x + 2 \right )} - \sqrt {2} \right )}}{12} - \frac {\sqrt {2} \log {\left (\tan {\left (3 x + 2 \right )} + \sqrt {2} \right )}}{12} \]

[In]

integrate(-2/(1+3*cos(4+6*x)),x)

[Out]

sqrt(2)*log(tan(3*x + 2) - sqrt(2))/12 - sqrt(2)*log(tan(3*x + 2) + sqrt(2))/12

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.87 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {1}{12} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \frac {\sin \left (6 \, x + 4\right )}{\cos \left (6 \, x + 4\right ) + 1}}{\sqrt {2} + \frac {\sin \left (6 \, x + 4\right )}{\cos \left (6 \, x + 4\right ) + 1}}\right ) \]

[In]

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

[Out]

1/12*sqrt(2)*log(-(sqrt(2) - sin(6*x + 4)/(cos(6*x + 4) + 1))/(sqrt(2) + sin(6*x + 4)/(cos(6*x + 4) + 1)))

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.64 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=\frac {1}{12} \, \sqrt {2} \log \left (\frac {{\left | -2 \, \sqrt {2} + 2 \, \tan \left (3 \, x + 2\right ) \right |}}{{\left | 2 \, \sqrt {2} + 2 \, \tan \left (3 \, x + 2\right ) \right |}}\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 28.13 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.28 \[ \int -\frac {2}{1+3 \cos (4+6 x)} \, dx=-\frac {\sqrt {2}\,\mathrm {atanh}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (3\,x+2\right )}{2}\right )}{6} \]

[In]

int(-2/(3*cos(6*x + 4) + 1),x)

[Out]

-(2^(1/2)*atanh((2^(1/2)*tan(3*x + 2))/2))/6