3.86 \(\int \sec (3 x) \sin (x) \, dx\)

Optimal. Leaf size=21 \[ \frac{1}{3} \log (\cos (x))-\frac{1}{6} \log \left (3-4 \cos ^2(x)\right ) \]

[Out]

Log[Cos[x]]/3 - Log[3 - 4*Cos[x]^2]/6

________________________________________________________________________________________

Rubi [A]  time = 0.0273773, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 7, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.714, Rules used = {4357, 266, 36, 29, 31} \[ \frac{1}{3} \log (\cos (x))-\frac{1}{6} \log \left (3-4 \cos ^2(x)\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sec[3*x]*Sin[x],x]

[Out]

Log[Cos[x]]/3 - Log[3 - 4*Cos[x]^2]/6

Rule 4357

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, -Dist[d/(
b*c), Subst[Int[SubstFor[1, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a
+ b*x)]/d, u, x]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

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

Mathematica [A]  time = 0.0081411, size = 17, normalized size = 0.81 \[ -\frac{1}{3} \tanh ^{-1}\left (\frac{1}{3} \left (8 \sin ^2(x)-5\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[3*x]*Sin[x],x]

[Out]

-ArcTanh[(-5 + 8*Sin[x]^2)/3]/3

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 18, normalized size = 0.9 \begin{align*}{\frac{\ln \left ( \cos \left ( x \right ) \right ) }{3}}-{\frac{\ln \left ( 4\, \left ( \cos \left ( x \right ) \right ) ^{2}-3 \right ) }{6}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(3*x)*sin(x),x)

[Out]

1/3*ln(cos(x))-1/6*ln(4*cos(x)^2-3)

________________________________________________________________________________________

Maxima [B]  time = 1.47328, size = 109, normalized size = 5.19 \begin{align*} -\frac{1}{12} \, \log \left (-2 \,{\left (\cos \left (2 \, x\right ) - 1\right )} \cos \left (4 \, x\right ) + \cos \left (4 \, x\right )^{2} + \cos \left (2 \, x\right )^{2} + \sin \left (4 \, x\right )^{2} - 2 \, \sin \left (4 \, x\right ) \sin \left (2 \, x\right ) + \sin \left (2 \, x\right )^{2} - 2 \, \cos \left (2 \, x\right ) + 1\right ) + \frac{1}{6} \, \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(3*x)*sin(x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.53631, size = 61, normalized size = 2.9 \begin{align*} -\frac{1}{6} \, \log \left (4 \, \cos \left (x\right )^{2} - 3\right ) + \frac{1}{3} \, \log \left (-\cos \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(3*x)*sin(x),x, algorithm="fricas")

[Out]

-1/6*log(4*cos(x)^2 - 3) + 1/3*log(-cos(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sin{\left (x \right )} \sec{\left (3 x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(3*x)*sin(x),x)

[Out]

Integral(sin(x)*sec(3*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.23202, size = 68, normalized size = 3.24 \begin{align*} -\frac{1}{6} \, \log \left ({\left | \frac{14 \,{\left (\cos \left (x\right ) - 1\right )}}{\cos \left (x\right ) + 1} + \frac{{\left (\cos \left (x\right ) - 1\right )}^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1 \right |}\right ) + \frac{1}{3} \, \log \left ({\left | -\frac{\cos \left (x\right ) - 1}{\cos \left (x\right ) + 1} - 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(3*x)*sin(x),x, algorithm="giac")

[Out]

-1/6*log(abs(14*(cos(x) - 1)/(cos(x) + 1) + (cos(x) - 1)^2/(cos(x) + 1)^2 + 1)) + 1/3*log(abs(-(cos(x) - 1)/(c
os(x) + 1) - 1))