3.27 \(\int \frac {\sec ^2(2+3 x)}{-2+\tan ^2(2+3 x)} \, dx\)

Optimal. Leaf size=61 \[ \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}} \]

[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]  time = 0.04, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3675, 207} \[ \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}} \]

Antiderivative was successfully verified.

[In]

Int[Sec[2 + 3*x]^2/(-2 + Tan[2 + 3*x]^2),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 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])

Rule 3675

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps

\begin {align*} \int \frac {\sec ^2(2+3 x)}{-2+\tan ^2(2+3 x)} \, dx &=\frac {1}{3} \operatorname {Subst}\left (\int \frac {1}{-2+x^2} \, dx,x,\tan (2+3 x)\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]  time = 0.02, size = 22, normalized size = 0.36 \[ -\frac {\tanh ^{-1}\left (\frac {\tan (3 x+2)}{\sqrt {2}}\right )}{3 \sqrt {2}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[2 + 3*x]^2/(-2 + Tan[2 + 3*x]^2),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 85, normalized size = 1.39 \[ \frac {1}{24} \, \sqrt {2} \log \left (-\frac {7 \, \cos \left (3 \, x + 2\right )^{4} - 10 \, \cos \left (3 \, x + 2\right )^{2} + 4 \, {\left (\sqrt {2} \cos \left (3 \, x + 2\right )^{3} + \sqrt {2} \cos \left (3 \, x + 2\right )\right )} \sin \left (3 \, x + 2\right ) - 1}{9 \, \cos \left (3 \, x + 2\right )^{4} - 6 \, \cos \left (3 \, x + 2\right )^{2} + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/24*sqrt(2)*log(-(7*cos(3*x + 2)^4 - 10*cos(3*x + 2)^2 + 4*(sqrt(2)*cos(3*x + 2)^3 + sqrt(2)*cos(3*x + 2))*si
n(3*x + 2) - 1)/(9*cos(3*x + 2)^4 - 6*cos(3*x + 2)^2 + 1))

________________________________________________________________________________________

giac [A]  time = 1.29, size = 37, normalized size = 0.61 \[ -\frac {1}{12} \, \sqrt {2} \log \left ({\left | \sqrt {2} + \tan \left (3 \, x + 2\right ) \right |}\right ) + \frac {1}{12} \, \sqrt {2} \log \left ({\left | -\sqrt {2} + \tan \left (3 \, x + 2\right ) \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.28, size = 18, normalized size = 0.30 \[ -\frac {\sqrt {2}\, \arctanh \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(sec(2+3*x)^2/(-2+tan(2+3*x)^2),x)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.34, size = 32, normalized size = 0.52 \[ \frac {1}{12} \, \sqrt {2} \log \left (-\frac {\sqrt {2} - \tan \left (3 \, x + 2\right )}{\sqrt {2} + \tan \left (3 \, x + 2\right )}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 2.40, size = 17, normalized size = 0.28 \[ -\frac {\sqrt {2}\,\mathrm {atanh}\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*(tan(3*x + 2)^2 - 2)),x)

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{2}{\left (3 x + 2 \right )}}{\tan ^{2}{\left (3 x + 2 \right )} - 2}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(2+3*x)**2/(-2+tan(2+3*x)**2),x)

[Out]

Integral(sec(3*x + 2)**2/(tan(3*x + 2)**2 - 2), x)

________________________________________________________________________________________