3.5.47 \(\int \frac {\sec ^2(x) (-\cos (2 x)+2 \tan ^2(x))}{(\tan (x) \tan (2 x))^{3/2}} \, dx\) [447]

Optimal. Leaf size=100 \[ 2 \tanh ^{-1}\left (\frac {\tan (x)}{\sqrt {\tan (x) \tan (2 x)}}\right )-\frac {11 \tanh ^{-1}\left (\frac {\sqrt {2} \tan (x)}{\sqrt {\tan (x) \tan (2 x)}}\right )}{4 \sqrt {2}}+\frac {\tan (x)}{2 (\tan (x) \tan (2 x))^{3/2}}+\frac {2 \tan ^3(x)}{3 (\tan (x) \tan (2 x))^{3/2}}+\frac {3 \tan (x)}{4 \sqrt {\tan (x) \tan (2 x)}} \]

[Out]

2*arctanh(tan(x)/(tan(x)*tan(2*x))^(1/2))-11/8*arctanh(2^(1/2)*tan(x)/(tan(x)*tan(2*x))^(1/2))*2^(1/2)+3/4*tan
(x)/(tan(x)*tan(2*x))^(1/2)+1/2*tan(x)/(tan(x)*tan(2*x))^(3/2)+2/3*tan(x)^3/(tan(x)*tan(2*x))^(3/2)

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(208\) vs. \(2(100)=200\).
time = 0.72, antiderivative size = 208, normalized size of antiderivative = 2.08, number of steps used = 22, number of rules used = 11, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.379, Rules used = {4482, 12, 1986, 15, 6857, 272, 43, 52, 65, 209, 455} \begin {gather*} -\frac {11 \tan (x) \text {ArcTan}\left (\sqrt {\tan ^2(x)-1}\right )}{4 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}} \sqrt {\tan ^2(x)-1}}+\frac {2 \tan (x) \text {ArcTan}\left (\frac {\sqrt {\tan ^2(x)-1}}{\sqrt {2}}\right )}{\sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}} \sqrt {\tan ^2(x)-1}}+\frac {\left (1-\tan ^2(x)\right ) \tan (x)}{3 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}}}+\frac {3 \tan (x)}{4 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}}}+\frac {\left (1-\tan ^2(x)\right ) \cot (x)}{4 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(3*Tan[x])/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]) + (Cot[x]*(1 - Tan[x]^2))/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - T
an[x]^2)]) + (Tan[x]*(1 - Tan[x]^2))/(3*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]) - (11*ArcTan[Sqrt[-1 + Tan[x]^2
]]*Tan[x])/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]*Sqrt[-1 + Tan[x]^2]) + (2*ArcTan[Sqrt[-1 + Tan[x]^2]/Sqrt[
2]]*Tan[x])/(Sqrt[Tan[x]^2/(1 - Tan[x]^2)]*Sqrt[-1 + Tan[x]^2])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 15

Int[(u_.)*((a_.)*(x_)^(n_))^(m_), x_Symbol] :> Dist[a^IntPart[m]*((a*x^n)^FracPart[m]/x^(n*FracPart[m])), Int[
u*x^(m*n), x], x] /; FreeQ[{a, m, n}, x] &&  !IntegerQ[m]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + 1))), x] - Dist[d*(n/(b*(m + 1))), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, c, d, n
}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, -1] &&  !IntegerQ[n] && GtQ[n, 0]

Rule 52

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^n/(b*(
m + n + 1))), x] + Dist[n*((b*c - a*d)/(b*(m + n + 1))), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 209

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

Rule 272

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 455

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 1986

Int[(u_.)*((e_.)*((a_.) + (b_.)*(x_)^(n_.))^(q_.)*((c_) + (d_.)*(x_)^(n_))^(r_.))^(p_), x_Symbol] :> Dist[Simp
[(e*(a + b*x^n)^q*(c + d*x^n)^r)^p/((a + b*x^n)^(p*q)*(c + d*x^n)^(p*r))], Int[u*(a + b*x^n)^(p*q)*(c + d*x^n)
^(p*r), x], x] /; FreeQ[{a, b, c, d, e, n, p, q, r}, x]

Rule 4482

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 3.38, size = 169, normalized size = 1.69 \begin {gather*} \frac {\left (-\cos (2 x)+2 \tan ^2(x)\right ) \left (\frac {4 \sqrt {2} \left (-2 \tanh ^{-1}\left (\sqrt {\frac {\cos (2 x)}{1+\cos (2 x)}}\right )+\sqrt {2} \tanh ^{-1}\left (\sqrt {1-\tan ^2(x)}\right )\right ) \cos (2 x) \tan (x)}{\sqrt {1-\tan ^2(x)}}-3 \tan ^{-1}\left (\sqrt {-1+\tan ^2(x)}\right ) \cos (x) \sin (x) \sqrt {-1+\tan ^2(x)}+\frac {1}{3} \left (-3 \cot (x)-4 \cos (x) \sin (x)+(5+9 \cos (2 x)) \tan ^3(x)\right )\right ) \tan ^2(2 x)}{2 (-3+6 \cos (2 x)+\cos (4 x)) (\tan (x) \tan (2 x))^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((-Cos[2*x] + 2*Tan[x]^2)*((4*Sqrt[2]*(-2*ArcTanh[Sqrt[Cos[2*x]/(1 + Cos[2*x])]] + Sqrt[2]*ArcTanh[Sqrt[1 - Ta
n[x]^2]])*Cos[2*x]*Tan[x])/Sqrt[1 - Tan[x]^2] - 3*ArcTan[Sqrt[-1 + Tan[x]^2]]*Cos[x]*Sin[x]*Sqrt[-1 + Tan[x]^2
] + (-3*Cot[x] - 4*Cos[x]*Sin[x] + (5 + 9*Cos[2*x])*Tan[x]^3)/3)*Tan[2*x]^2)/(2*(-3 + 6*Cos[2*x] + Cos[4*x])*(
Tan[x]*Tan[2*x])^(3/2))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(558\) vs. \(2(78)=156\).
time = 0.64, size = 559, normalized size = 5.59

method result size
default \(\text {Expression too large to display}\) \(559\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-cos(2*x)+2*tan(x)^2)/cos(x)^2/(tan(x)*tan(2*x))^(3/2),x,method=_RETURNVERBOSE)

[Out]

1/96*2^(1/2)*4^(1/2)*(cos(x)-1)^2*(48*cos(x)^4*arctanh(1/2*2^(1/2)*cos(x)*4^(1/2)*(cos(x)-1)/((2*cos(x)^2-1)/(
1+cos(x))^2)^(1/2)/sin(x)^2)*2^(1/2)-22*cos(x)^4*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-201*cos(x)^4*ln(-2*(cos(x
)^2*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-2*cos(x)^2+cos(x)-((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)+1)/sin(x)^2)+168
*cos(x)^4*ln(-4*(cos(x)^2*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-2*cos(x)^2+cos(x)-((2*cos(x)^2-1)/(1+cos(x))^2)^
(1/2)+1)/sin(x)^2)-33*cos(x)^4*arctanh(1/2*4^(1/2)*(2*cos(x)^2-3*cos(x)+1)/((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)
/sin(x)^2)-48*cos(x)^3*arctanh(1/2*2^(1/2)*cos(x)*4^(1/2)*(cos(x)-1)/((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)/sin(x
)^2)*2^(1/2)+201*cos(x)^3*ln(-2*(cos(x)^2*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-2*cos(x)^2+cos(x)-((2*cos(x)^2-1
)/(1+cos(x))^2)^(1/2)+1)/sin(x)^2)-168*cos(x)^3*ln(-4*(cos(x)^2*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-2*cos(x)^2
+cos(x)-((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)+1)/sin(x)^2)+33*cos(x)^3*arctanh(1/2*4^(1/2)*(2*cos(x)^2-3*cos(x)+
1)/((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)/sin(x)^2)+36*cos(x)^2*((2*cos(x)^2-1)/(1+cos(x))^2)^(1/2)-8*((2*cos(x)^
2-1)/(1+cos(x))^2)^(1/2))/cos(x)^3/sin(x)^3/(sin(x)^2/(2*cos(x)^2-1))^(3/2)/((2*cos(x)^2-1)/(1+cos(x))^2)^(3/2
)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((2*tan(x)^2 - cos(2*x))/((tan(2*x)*tan(x))^(3/2)*cos(x)^2), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (78) = 156\).
time = 1.01, size = 271, normalized size = 2.71 \begin {gather*} -\frac {24 \, {\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \log \left (-\frac {4 \, \sqrt {2} {\left (8 \, \cos \left (x\right )^{5} - 6 \, \cos \left (x\right )^{3} + \cos \left (x\right )\right )} \sqrt {-\frac {\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} - {\left (32 \, \cos \left (x\right )^{4} - 16 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{\sin \left (x\right )}\right ) \sin \left (x\right ) - 33 \, {\left (\sqrt {2} \cos \left (x\right )^{5} - \sqrt {2} \cos \left (x\right )^{3}\right )} \log \left (\frac {4 \, {\left (\sqrt {2} {\left (2 \, {\left (3 \, \sqrt {2} - 4\right )} \cos \left (x\right )^{3} - {\left (3 \, \sqrt {2} - 4\right )} \cos \left (x\right )\right )} \sqrt {-\frac {\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} + {\left (3 \, {\left (2 \, \sqrt {2} - 3\right )} \cos \left (x\right )^{2} - 2 \, \sqrt {2} + 3\right )} \sin \left (x\right )\right )}}{{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )}\right ) \sin \left (x\right ) - 2 \, \sqrt {2} {\left (22 \, \cos \left (x\right )^{6} - 47 \, \cos \left (x\right )^{4} + 26 \, \cos \left (x\right )^{2} - 4\right )} \sqrt {-\frac {\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} - 44 \, {\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )}{48 \, {\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/48*(24*(cos(x)^5 - cos(x)^3)*log(-(4*sqrt(2)*(8*cos(x)^5 - 6*cos(x)^3 + cos(x))*sqrt(-(cos(x)^2 - 1)/(2*cos
(x)^2 - 1)) - (32*cos(x)^4 - 16*cos(x)^2 + 1)*sin(x))/sin(x))*sin(x) - 33*(sqrt(2)*cos(x)^5 - sqrt(2)*cos(x)^3
)*log(4*(sqrt(2)*(2*(3*sqrt(2) - 4)*cos(x)^3 - (3*sqrt(2) - 4)*cos(x))*sqrt(-(cos(x)^2 - 1)/(2*cos(x)^2 - 1))
+ (3*(2*sqrt(2) - 3)*cos(x)^2 - 2*sqrt(2) + 3)*sin(x))/((cos(x)^2 - 1)*sin(x)))*sin(x) - 2*sqrt(2)*(22*cos(x)^
6 - 47*cos(x)^4 + 26*cos(x)^2 - 4)*sqrt(-(cos(x)^2 - 1)/(2*cos(x)^2 - 1)) - 44*(cos(x)^5 - cos(x)^3)*sin(x))/(
(cos(x)^5 - cos(x)^3)*sin(x))

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 193 vs. \(2 (78) = 156\).
time = 0.86, size = 193, normalized size = 1.93 \begin {gather*} -\frac {\sqrt {2} {\left (2 \, {\left (-\tan \left (x\right )^{2} + 1\right )}^{\frac {3}{2}} + 3 \, \sqrt {-\tan \left (x\right )^{2} + 1}\right )}}{12 \, \mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right )} + \frac {11 \, \sqrt {2} \log \left (\sqrt {-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right )} - \frac {11 \, \sqrt {2} \log \left (-\sqrt {-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right )} + \frac {\log \left (\frac {\sqrt {2} - \sqrt {-\tan \left (x\right )^{2} + 1}}{\sqrt {2} + \sqrt {-\tan \left (x\right )^{2} + 1}}\right )}{\mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right )} - \frac {\sqrt {2} \sqrt {-\tan \left (x\right )^{2} + 1}}{8 \, \mathrm {sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm {sgn}\left (\tan \left (x\right )\right ) \tan \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/12*sqrt(2)*(2*(-tan(x)^2 + 1)^(3/2) + 3*sqrt(-tan(x)^2 + 1))/(sgn(tan(x)^2 - 1)*sgn(tan(x))) + 11/16*sqrt(2
)*log(sqrt(-tan(x)^2 + 1) + 1)/(sgn(tan(x)^2 - 1)*sgn(tan(x))) - 11/16*sqrt(2)*log(-sqrt(-tan(x)^2 + 1) + 1)/(
sgn(tan(x)^2 - 1)*sgn(tan(x))) + log((sqrt(2) - sqrt(-tan(x)^2 + 1))/(sqrt(2) + sqrt(-tan(x)^2 + 1)))/(sgn(tan
(x)^2 - 1)*sgn(tan(x))) - 1/8*sqrt(2)*sqrt(-tan(x)^2 + 1)/(sgn(tan(x)^2 - 1)*sgn(tan(x))*tan(x)^2)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} -\int \frac {\cos \left (2\,x\right )-2\,{\mathrm {tan}\left (x\right )}^2}{{\cos \left (x\right )}^2\,{\left (\mathrm {tan}\left (2\,x\right )\,\mathrm {tan}\left (x\right )\right )}^{3/2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(cos(2*x) - 2*tan(x)^2)/(cos(x)^2*(tan(2*x)*tan(x))^(3/2)),x)

[Out]

-int((cos(2*x) - 2*tan(x)^2)/(cos(x)^2*(tan(2*x)*tan(x))^(3/2)), x)

________________________________________________________________________________________