3.18 \(\int \frac {1}{1+\cos ^2(2+3 x)} \, dx\)

Optimal. Leaf size=48 \[ \frac {x}{\sqrt {2}}-\frac {\tan ^{-1}\left (\frac {\sin (3 x+2) \cos (3 x+2)}{\cos ^2(3 x+2)+\sqrt {2}+1}\right )}{3 \sqrt {2}} \]

[Out]

1/2*x*2^(1/2)-1/6*arctan(cos(2+3*x)*sin(2+3*x)/(1+cos(2+3*x)^2+2^(1/2)))*2^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3181, 203} \[ \frac {x}{\sqrt {2}}-\frac {\tan ^{-1}\left (\frac {\sin (3 x+2) \cos (3 x+2)}{\cos ^2(3 x+2)+\sqrt {2}+1}\right )}{3 \sqrt {2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x/Sqrt[2] - ArcTan[(Cos[2 + 3*x]*Sin[2 + 3*x])/(1 + Sqrt[2] + Cos[2 + 3*x]^2)]/(3*Sqrt[2])

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 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rubi steps

\begin {align*} \int \frac {1}{1+\cos ^2(2+3 x)} \, dx &=-\left (\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{1+2 x^2} \, dx,x,\cot (2+3 x)\right )\right )\\ &=\frac {x}{\sqrt {2}}-\frac {\tan ^{-1}\left (\frac {\cos (2+3 x) \sin (2+3 x)}{1+\sqrt {2}+\cos ^2(2+3 x)}\right )}{3 \sqrt {2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 22, normalized size = 0.46 \[ \frac {\tan ^{-1}\left (\frac {\tan (3 x+2)}{\sqrt {2}}\right )}{3 \sqrt {2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[Tan[2 + 3*x]/Sqrt[2]]/(3*Sqrt[2])

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 43, normalized size = 0.90 \[ -\frac {1}{12} \, \sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (3 \, x + 2\right )^{2} - \sqrt {2}}{4 \, \cos \left (3 \, x + 2\right ) \sin \left (3 \, x + 2\right )}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/12*sqrt(2)*arctan(1/4*(3*sqrt(2)*cos(3*x + 2)^2 - sqrt(2))/(cos(3*x + 2)*sin(3*x + 2)))

________________________________________________________________________________________

giac [A]  time = 0.15, size = 57, normalized size = 1.19 \[ \frac {1}{6} \, \sqrt {2} {\left (3 \, x + \arctan \left (-\frac {\sqrt {2} \sin \left (6 \, x + 4\right ) - \sin \left (6 \, x + 4\right )}{\sqrt {2} \cos \left (6 \, x + 4\right ) + \sqrt {2} - \cos \left (6 \, x + 4\right ) + 1}\right ) + 2\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*sqrt(2)*(3*x + arctan(-(sqrt(2)*sin(6*x + 4) - sin(6*x + 4))/(sqrt(2)*cos(6*x + 4) + sqrt(2) - cos(6*x + 4
) + 1)) + 2)

________________________________________________________________________________________

maple [A]  time = 0.10, size = 18, normalized size = 0.38 \[ \frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \tan \left (2+3 x \right )}{2}\right )}{6} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+cos(2+3*x)^2),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.44, size = 17, normalized size = 0.35 \[ \frac {1}{6} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \left (3 \, x + 2\right )\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/6*sqrt(2)*arctan(1/2*sqrt(2)*tan(3*x + 2))

________________________________________________________________________________________

mupad [B]  time = 2.37, size = 36, normalized size = 0.75 \[ \frac {\sqrt {2}\,\left (3\,x-\mathrm {atan}\left (\mathrm {tan}\left (3\,x+2\right )\right )\right )}{6}+\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (3\,x+2\right )}{2}\right )}{6} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(3*x + 2)^2 + 1),x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.65, size = 76, normalized size = 1.58 \[ \frac {\sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {3 x}{2} + 1 \right )} - 1 \right )} + \pi \left \lfloor {\frac {\frac {3 x}{2} - \frac {\pi }{2} + 1}{\pi }}\right \rfloor \right )}{6} + \frac {\sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {3 x}{2} + 1 \right )} + 1 \right )} + \pi \left \lfloor {\frac {\frac {3 x}{2} - \frac {\pi }{2} + 1}{\pi }}\right \rfloor \right )}{6} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*(atan(sqrt(2)*tan(3*x/2 + 1) - 1) + pi*floor((3*x/2 - pi/2 + 1)/pi))/6 + sqrt(2)*(atan(sqrt(2)*tan(3*x
/2 + 1) + 1) + pi*floor((3*x/2 - pi/2 + 1)/pi))/6

________________________________________________________________________________________