3.107 \(\int \cos (x) \tan (4 x) \, dx\)

Optimal. Leaf size=71 \[ -\cos (x)+\frac {1}{4} \sqrt {2-\sqrt {2}} \tanh ^{-1}\left (\frac {2 \cos (x)}{\sqrt {2-\sqrt {2}}}\right )+\frac {1}{4} \sqrt {2+\sqrt {2}} \tanh ^{-1}\left (\frac {2 \cos (x)}{\sqrt {2+\sqrt {2}}}\right ) \]

[Out]

-cos(x)+1/4*arctanh(2*cos(x)/(2-2^(1/2))^(1/2))*(2-2^(1/2))^(1/2)+1/4*arctanh(2*cos(x)/(2+2^(1/2))^(1/2))*(2+2
^(1/2))^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.08, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {12, 1279, 1166, 207} \[ -\cos (x)+\frac {1}{4} \sqrt {2-\sqrt {2}} \tanh ^{-1}\left (\frac {2 \cos (x)}{\sqrt {2-\sqrt {2}}}\right )+\frac {1}{4} \sqrt {2+\sqrt {2}} \tanh ^{-1}\left (\frac {2 \cos (x)}{\sqrt {2+\sqrt {2}}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]*Tan[4*x],x]

[Out]

(Sqrt[2 - Sqrt[2]]*ArcTanh[(2*Cos[x])/Sqrt[2 - Sqrt[2]]])/4 + (Sqrt[2 + Sqrt[2]]*ArcTanh[(2*Cos[x])/Sqrt[2 + S
qrt[2]]])/4 - Cos[x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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])

Rule 1166

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Di
st[e/2 + (2*c*d - b*e)/(2*q), Int[1/(b/2 - q/2 + c*x^2), x], x] + Dist[e/2 - (2*c*d - b*e)/(2*q), Int[1/(b/2 +
 q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - a*e^2, 0] && PosQ[b^
2 - 4*a*c]

Rule 1279

Int[((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> Simp[(e*f
*(f*x)^(m - 1)*(a + b*x^2 + c*x^4)^(p + 1))/(c*(m + 4*p + 3)), x] - Dist[f^2/(c*(m + 4*p + 3)), Int[(f*x)^(m -
 2)*(a + b*x^2 + c*x^4)^p*Simp[a*e*(m - 1) + (b*e*(m + 2*p + 1) - c*d*(m + 4*p + 3))*x^2, x], x], x] /; FreeQ[
{a, b, c, d, e, f, p}, x] && NeQ[b^2 - 4*a*c, 0] && GtQ[m, 1] && NeQ[m + 4*p + 3, 0] && IntegerQ[2*p] && (Inte
gerQ[p] || IntegerQ[m])

Rubi steps

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

________________________________________________________________________________________

Mathematica [C]  time = 59.55, size = 6196, normalized size = 87.27 \[ \text {Result too large to show} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Cos[x]*Tan[4*x],x]

[Out]

Result too large to show

________________________________________________________________________________________

fricas [A]  time = 0.94, size = 101, normalized size = 1.42 \[ \frac {1}{8} \, \sqrt {\sqrt {2} + 2} \log \left (\sqrt {\sqrt {2} + 2} + 2 \, \cos \relax (x)\right ) - \frac {1}{8} \, \sqrt {\sqrt {2} + 2} \log \left (\sqrt {\sqrt {2} + 2} - 2 \, \cos \relax (x)\right ) + \frac {1}{8} \, \sqrt {-\sqrt {2} + 2} \log \left (\sqrt {-\sqrt {2} + 2} + 2 \, \cos \relax (x)\right ) - \frac {1}{8} \, \sqrt {-\sqrt {2} + 2} \log \left (\sqrt {-\sqrt {2} + 2} - 2 \, \cos \relax (x)\right ) - \cos \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*tan(4*x),x, algorithm="fricas")

[Out]

1/8*sqrt(sqrt(2) + 2)*log(sqrt(sqrt(2) + 2) + 2*cos(x)) - 1/8*sqrt(sqrt(2) + 2)*log(sqrt(sqrt(2) + 2) - 2*cos(
x)) + 1/8*sqrt(-sqrt(2) + 2)*log(sqrt(-sqrt(2) + 2) + 2*cos(x)) - 1/8*sqrt(-sqrt(2) + 2)*log(sqrt(-sqrt(2) + 2
) - 2*cos(x)) - cos(x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos \relax (x) \tan \left (4 \, x\right )\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*tan(4*x),x, algorithm="giac")

[Out]

integrate(cos(x)*tan(4*x), x)

________________________________________________________________________________________

maple [A]  time = 0.08, size = 68, normalized size = 0.96 \[ -\cos \relax (x )+\frac {\left (\sqrt {2}-1\right ) \sqrt {2}\, \arctanh \left (\frac {2 \cos \relax (x )}{\sqrt {2-\sqrt {2}}}\right )}{4 \sqrt {2-\sqrt {2}}}+\frac {\left (1+\sqrt {2}\right ) \sqrt {2}\, \arctanh \left (\frac {2 \cos \relax (x )}{\sqrt {2+\sqrt {2}}}\right )}{4 \sqrt {2+\sqrt {2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)*tan(4*x),x)

[Out]

-cos(x)+1/4*(2^(1/2)-1)*2^(1/2)/(2-2^(1/2))^(1/2)*arctanh(2*cos(x)/(2-2^(1/2))^(1/2))+1/4*(1+2^(1/2))*2^(1/2)/
(2+2^(1/2))^(1/2)*arctanh(2*cos(x)/(2+2^(1/2))^(1/2))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ -\cos \relax (x) - \int -\frac {{\left (\sin \left (7 \, x\right ) - \sin \relax (x)\right )} \cos \left (8 \, x\right ) - {\left (\cos \left (7 \, x\right ) - \cos \relax (x)\right )} \sin \left (8 \, x\right ) + \sin \left (7 \, x\right ) - \sin \relax (x)}{\cos \left (8 \, x\right )^{2} + \sin \left (8 \, x\right )^{2} + 2 \, \cos \left (8 \, x\right ) + 1}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*tan(4*x),x, algorithm="maxima")

[Out]

-cos(x) - integrate(-((sin(7*x) - sin(x))*cos(8*x) - (cos(7*x) - cos(x))*sin(8*x) + sin(7*x) - sin(x))/(cos(8*
x)^2 + sin(8*x)^2 + 2*cos(8*x) + 1), x)

________________________________________________________________________________________

mupad [B]  time = 2.45, size = 295, normalized size = 4.15 \[ -\frac {\mathrm {atanh}\left (\frac {219747975168\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\sqrt {2-\sqrt {2}}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-20887633920}-\frac {15971909632\,\sqrt {2-\sqrt {2}}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-20887633920}-\frac {130056978432\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\sqrt {2-\sqrt {2}}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-20887633920}\right )\,\sqrt {2-\sqrt {2}}}{4}-\frac {2}{{\mathrm {tan}\left (\frac {x}{2}\right )}^2+1}-\frac {\mathrm {atanh}\left (\frac {15971909632\,\sqrt {\sqrt {2}+2}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+20887633920}-\frac {219747975168\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\sqrt {\sqrt {2}+2}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+20887633920}-\frac {130056978432\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\sqrt {\sqrt {2}+2}}{6098518016\,\sqrt {2}-254015438848\,\sqrt {2}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-386664497152\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+20887633920}\right )\,\sqrt {\sqrt {2}+2}}{4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(4*x)*cos(x),x)

[Out]

- (atanh((219747975168*tan(x/2)^2*(2 - 2^(1/2))^(1/2))/(6098518016*2^(1/2) - 254015438848*2^(1/2)*tan(x/2)^2 +
 386664497152*tan(x/2)^2 - 20887633920) - (15971909632*(2 - 2^(1/2))^(1/2))/(6098518016*2^(1/2) - 254015438848
*2^(1/2)*tan(x/2)^2 + 386664497152*tan(x/2)^2 - 20887633920) - (130056978432*2^(1/2)*tan(x/2)^2*(2 - 2^(1/2))^
(1/2))/(6098518016*2^(1/2) - 254015438848*2^(1/2)*tan(x/2)^2 + 386664497152*tan(x/2)^2 - 20887633920))*(2 - 2^
(1/2))^(1/2))/4 - 2/(tan(x/2)^2 + 1) - (atanh((15971909632*(2^(1/2) + 2)^(1/2))/(6098518016*2^(1/2) - 25401543
8848*2^(1/2)*tan(x/2)^2 - 386664497152*tan(x/2)^2 + 20887633920) - (219747975168*tan(x/2)^2*(2^(1/2) + 2)^(1/2
))/(6098518016*2^(1/2) - 254015438848*2^(1/2)*tan(x/2)^2 - 386664497152*tan(x/2)^2 + 20887633920) - (130056978
432*2^(1/2)*tan(x/2)^2*(2^(1/2) + 2)^(1/2))/(6098518016*2^(1/2) - 254015438848*2^(1/2)*tan(x/2)^2 - 3866644971
52*tan(x/2)^2 + 20887633920))*(2^(1/2) + 2)^(1/2))/4

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \cos {\relax (x )} \tan {\left (4 x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)*tan(4*x),x)

[Out]

Integral(cos(x)*tan(4*x), x)

________________________________________________________________________________________