3.10 \(\int \frac{1}{-1+3 \sin ^2(2+3 x)} \, dx\)

Optimal. Leaf size=60 \[ \frac{\log \left (\cos (3 x+2)-\sqrt{2} \sin (3 x+2)\right )}{6 \sqrt{2}}-\frac{\log \left (\sqrt{2} \sin (3 x+2)+\cos (3 x+2)\right )}{6 \sqrt{2}} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0195075, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3181, 207} \[ \frac{\log \left (\cos (3 x+2)-\sqrt{2} \sin (3 x+2)\right )}{6 \sqrt{2}}-\frac{\log \left (\sqrt{2} \sin (3 x+2)+\cos (3 x+2)\right )}{6 \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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]

Rule 207

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

Rubi steps

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

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 17, normalized size = 0.3 \begin{align*} -{\frac{\sqrt{2}{\it Artanh} \left ( \tan \left ( 2+3\,x \right ) \sqrt{2} \right ) }{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.61108, size = 46, normalized size = 0.77 \begin{align*} \frac{1}{12} \, \sqrt{2} \log \left (-\frac{\sqrt{2} - 2 \, \tan \left (3 \, x + 2\right )}{\sqrt{2} + 2 \, \tan \left (3 \, x + 2\right )}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.40464, size = 232, normalized size = 3.87 \begin{align*} \frac{1}{24} \, \sqrt{2} \log \left (-\frac{7 \, \cos \left (3 \, x + 2\right )^{4} - 4 \, \cos \left (3 \, x + 2\right )^{2} - 4 \,{\left (\sqrt{2} \cos \left (3 \, x + 2\right )^{3} - 2 \, \sqrt{2} \cos \left (3 \, x + 2\right )\right )} \sin \left (3 \, x + 2\right ) - 4}{9 \, \cos \left (3 \, x + 2\right )^{4} - 12 \, \cos \left (3 \, x + 2\right )^{2} + 4}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/24*sqrt(2)*log(-(7*cos(3*x + 2)^4 - 4*cos(3*x + 2)^2 - 4*(sqrt(2)*cos(3*x + 2)^3 - 2*sqrt(2)*cos(3*x + 2))*s
in(3*x + 2) - 4)/(9*cos(3*x + 2)^4 - 12*cos(3*x + 2)^2 + 4))

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(-1+3*sin(2+3*x)**2),x)

[Out]

Exception raised: TypeError

________________________________________________________________________________________

Giac [A]  time = 1.17198, size = 53, normalized size = 0.88 \begin{align*} \frac{1}{12} \, \sqrt{2} \log \left (\frac{{\left | -2 \, \sqrt{2} + 4 \, \tan \left (3 \, x + 2\right ) \right |}}{{\left | 2 \, \sqrt{2} + 4 \, \tan \left (3 \, x + 2\right ) \right |}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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