Integrand size = 9, antiderivative size = 44 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {35 x}{8}-\frac {35 \tan (x)}{8}+\frac {35 \tan ^3(x)}{24}-\frac {7}{8} \sin ^2(x) \tan ^3(x)-\frac {1}{4} \sin ^4(x) \tan ^3(x) \] Output:
35/8*x-35/8*tan(x)+35/24*tan(x)^3-7/8*sin(x)^2*tan(x)^3-1/4*sin(x)^4*tan(x )^3
Time = 0.03 (sec) , antiderivative size = 38, normalized size of antiderivative = 0.86 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {35 x}{8}-\frac {3}{4} \sin (2 x)+\frac {1}{32} \sin (4 x)-\frac {10 \tan (x)}{3}+\frac {1}{3} \sec ^2(x) \tan (x) \] Input:
Integrate[(-Cos[x] + Sec[x])^4,x]
Output:
(35*x)/8 - (3*Sin[2*x])/4 + Sin[4*x]/32 - (10*Tan[x])/3 + (Sec[x]^2*Tan[x] )/3
Time = 0.23 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.32, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.667, Rules used = {3042, 4889, 252, 252, 254, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (\sec (x)-\cos (x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (\sec (x)-\cos (x))^4dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle \int \frac {\tan ^8(x)}{\left (\tan ^2(x)+1\right )^3}d\tan (x)\) |
\(\Big \downarrow \) 252 |
\(\displaystyle \frac {7}{4} \int \frac {\tan ^6(x)}{\left (\tan ^2(x)+1\right )^2}d\tan (x)-\frac {\tan ^7(x)}{4 \left (\tan ^2(x)+1\right )^2}\) |
\(\Big \downarrow \) 252 |
\(\displaystyle \frac {7}{4} \left (\frac {5}{2} \int \frac {\tan ^4(x)}{\tan ^2(x)+1}d\tan (x)-\frac {\tan ^5(x)}{2 \left (\tan ^2(x)+1\right )}\right )-\frac {\tan ^7(x)}{4 \left (\tan ^2(x)+1\right )^2}\) |
\(\Big \downarrow \) 254 |
\(\displaystyle \frac {7}{4} \left (\frac {5}{2} \int \left (\tan ^2(x)+\frac {1}{\tan ^2(x)+1}-1\right )d\tan (x)-\frac {\tan ^5(x)}{2 \left (\tan ^2(x)+1\right )}\right )-\frac {\tan ^7(x)}{4 \left (\tan ^2(x)+1\right )^2}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {7}{4} \left (\frac {5}{2} \left (\arctan (\tan (x))+\frac {\tan ^3(x)}{3}-\tan (x)\right )-\frac {\tan ^5(x)}{2 \left (\tan ^2(x)+1\right )}\right )-\frac {\tan ^7(x)}{4 \left (\tan ^2(x)+1\right )^2}\) |
Input:
Int[(-Cos[x] + Sec[x])^4,x]
Output:
-1/4*Tan[x]^7/(1 + Tan[x]^2)^2 + (7*(-1/2*Tan[x]^5/(1 + Tan[x]^2) + (5*(Ar cTan[Tan[x]] - Tan[x] + Tan[x]^3/3))/2))/4
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x )^(m - 1)*((a + b*x^2)^(p + 1)/(2*b*(p + 1))), x] - Simp[c^2*((m - 1)/(2*b* (p + 1))) Int[(c*x)^(m - 2)*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c }, x] && LtQ[p, -1] && GtQ[m, 1] && !ILtQ[(m + 2*p + 3)/2, 0] && IntBinomi alQ[a, b, c, 2, m, p, x]
Int[(x_)^(m_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^2, x], x] /; FreeQ[{a, b}, x] && IGtQ[m, 3]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Time = 0.91 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.91
method | result | size |
default | \(\frac {\left (\cos \left (x \right )^{3}+\frac {3 \cos \left (x \right )}{2}\right ) \sin \left (x \right )}{4}+\frac {35 x}{8}-2 \sin \left (x \right ) \cos \left (x \right )-4 \tan \left (x \right )-\left (-\frac {2}{3}-\frac {\sec \left (x \right )^{2}}{3}\right ) \tan \left (x \right )\) | \(40\) |
parts | \(\frac {\left (\cos \left (x \right )^{3}+\frac {3 \cos \left (x \right )}{2}\right ) \sin \left (x \right )}{4}+\frac {35 x}{8}-2 \sin \left (x \right ) \cos \left (x \right )-4 \tan \left (x \right )-\left (-\frac {2}{3}-\frac {\sec \left (x \right )^{2}}{3}\right ) \tan \left (x \right )\) | \(40\) |
parallelrisch | \(\frac {2520 \cos \left (x \right ) x +840 x \cos \left (3 x \right )-525 \sin \left (x \right )-847 \sin \left (3 x \right )+3 \sin \left (7 x \right )-63 \sin \left (5 x \right )}{192 \cos \left (3 x \right )+576 \cos \left (x \right )}\) | \(50\) |
risch | \(\frac {35 x}{8}-\frac {i {\mathrm e}^{4 i x}}{64}+\frac {3 i {\mathrm e}^{2 i x}}{8}-\frac {3 i {\mathrm e}^{-2 i x}}{8}+\frac {i {\mathrm e}^{-4 i x}}{64}-\frac {4 i \left (6 \,{\mathrm e}^{4 i x}+9 \,{\mathrm e}^{2 i x}+5\right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3}}\) | \(65\) |
norman | \(\frac {-\frac {35 x}{8}+\frac {35 \tan \left (\frac {x}{2}\right )^{3}}{6}-\frac {329 \tan \left (\frac {x}{2}\right )^{5}}{12}-17 \tan \left (\frac {x}{2}\right )^{7}-\frac {329 \tan \left (\frac {x}{2}\right )^{9}}{12}+\frac {35 \tan \left (\frac {x}{2}\right )^{11}}{6}+\frac {35 \tan \left (\frac {x}{2}\right )^{13}}{4}+\frac {105 x \tan \left (\frac {x}{2}\right )^{4}}{8}+\frac {105 x \tan \left (\frac {x}{2}\right )^{6}}{8}-\frac {105 x \tan \left (\frac {x}{2}\right )^{8}}{8}-\frac {105 x \tan \left (\frac {x}{2}\right )^{10}}{8}+\frac {35 x \tan \left (\frac {x}{2}\right )^{12}}{8}+\frac {35 x \tan \left (\frac {x}{2}\right )^{14}}{8}-\frac {35 \tan \left (\frac {x}{2}\right )^{2} x}{8}+\frac {35 \tan \left (\frac {x}{2}\right )}{4}}{\left (1+\tan \left (\frac {x}{2}\right )^{2}\right )^{4} \left (\tan \left (\frac {x}{2}\right )^{2}-1\right )^{3}}\) | \(143\) |
Input:
int((-cos(x)+sec(x))^4,x,method=_RETURNVERBOSE)
Output:
1/4*(cos(x)^3+3/2*cos(x))*sin(x)+35/8*x-2*sin(x)*cos(x)-4*tan(x)-(-2/3-1/3 *sec(x)^2)*tan(x)
Time = 0.07 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.84 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {105 \, x \cos \left (x\right )^{3} + {\left (6 \, \cos \left (x\right )^{6} - 39 \, \cos \left (x\right )^{4} - 80 \, \cos \left (x\right )^{2} + 8\right )} \sin \left (x\right )}{24 \, \cos \left (x\right )^{3}} \] Input:
integrate((-cos(x)+sec(x))^4,x, algorithm="fricas")
Output:
1/24*(105*x*cos(x)^3 + (6*cos(x)^6 - 39*cos(x)^4 - 80*cos(x)^2 + 8)*sin(x) )/cos(x)^3
Time = 3.99 (sec) , antiderivative size = 44, normalized size of antiderivative = 1.00 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {35 x}{8} - 2 \sin {\left (x \right )} \cos {\left (x \right )} - \frac {4 \sin {\left (x \right )}}{\cos {\left (x \right )}} + \frac {\sin {\left (2 x \right )}}{4} + \frac {\sin {\left (4 x \right )}}{32} + \frac {\tan ^{3}{\left (x \right )}}{3} + \tan {\left (x \right )} \] Input:
integrate((-cos(x)+sec(x))**4,x)
Output:
35*x/8 - 2*sin(x)*cos(x) - 4*sin(x)/cos(x) + sin(2*x)/4 + sin(4*x)/32 + ta n(x)**3/3 + tan(x)
Time = 0.03 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.59 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {1}{3} \, \tan \left (x\right )^{3} + \frac {35}{8} \, x + \frac {1}{32} \, \sin \left (4 \, x\right ) - \frac {3}{4} \, \sin \left (2 \, x\right ) - 3 \, \tan \left (x\right ) \] Input:
integrate((-cos(x)+sec(x))^4,x, algorithm="maxima")
Output:
1/3*tan(x)^3 + 35/8*x + 1/32*sin(4*x) - 3/4*sin(2*x) - 3*tan(x)
Time = 0.11 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.80 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {1}{3} \, \tan \left (x\right )^{3} + \frac {35}{8} \, x - \frac {13 \, \tan \left (x\right )^{3} + 11 \, \tan \left (x\right )}{8 \, {\left (\tan \left (x\right )^{2} + 1\right )}^{2}} - 3 \, \tan \left (x\right ) \] Input:
integrate((-cos(x)+sec(x))^4,x, algorithm="giac")
Output:
1/3*tan(x)^3 + 35/8*x - 1/8*(13*tan(x)^3 + 11*tan(x))/(tan(x)^2 + 1)^2 - 3 *tan(x)
Time = 14.99 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.82 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {35\,x}{8}+\frac {\frac {35\,{\mathrm {tan}\left (\frac {x}{2}\right )}^{13}}{4}+\frac {35\,{\mathrm {tan}\left (\frac {x}{2}\right )}^{11}}{6}-\frac {329\,{\mathrm {tan}\left (\frac {x}{2}\right )}^9}{12}-17\,{\mathrm {tan}\left (\frac {x}{2}\right )}^7-\frac {329\,{\mathrm {tan}\left (\frac {x}{2}\right )}^5}{12}+\frac {35\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{6}+\frac {35\,\mathrm {tan}\left (\frac {x}{2}\right )}{4}}{{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^3\,{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )}^4} \] Input:
int((cos(x) - 1/cos(x))^4,x)
Output:
(35*x)/8 + ((35*tan(x/2))/4 + (35*tan(x/2)^3)/6 - (329*tan(x/2)^5)/12 - 17 *tan(x/2)^7 - (329*tan(x/2)^9)/12 + (35*tan(x/2)^11)/6 + (35*tan(x/2)^13)/ 4)/((tan(x/2)^2 - 1)^3*(tan(x/2)^2 + 1)^4)
Time = 0.16 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.52 \[ \int (-\cos (x)+\sec (x))^4 \, dx=\frac {-6 \cos \left (x \right )^{2} \sin \left (x \right )^{5}-27 \cos \left (x \right )^{2} \sin \left (x \right )^{3}+33 \cos \left (x \right )^{2} \sin \left (x \right )+105 \cos \left (x \right ) \sin \left (x \right )^{2} x -105 \cos \left (x \right ) x -80 \sin \left (x \right )^{3}+72 \sin \left (x \right )}{24 \cos \left (x \right ) \left (\sin \left (x \right )^{2}-1\right )} \] Input:
int((-cos(x)+sec(x))^4,x)
Output:
( - 6*cos(x)**2*sin(x)**5 - 27*cos(x)**2*sin(x)**3 + 33*cos(x)**2*sin(x) + 105*cos(x)*sin(x)**2*x - 105*cos(x)*x - 80*sin(x)**3 + 72*sin(x))/(24*cos (x)*(sin(x)**2 - 1))