\(\int ((-3+x)^7+x-\sin (3-x)) \, dx\) [80]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 27 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {1}{8} (3-x)^8+\frac {x^2}{2}-\cos (3-x) \]

[Out]

1/8*(-x+3)^8+1/2*x^2-cos(-3+x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2718} \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {x^2}{2}+\frac {1}{8} (3-x)^8-\cos (3-x) \]

[In]

Int[(-3 + x)^7 + x - Sin[3 - x],x]

[Out]

(3 - x)^8/8 + x^2/2 - Cos[3 - x]

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{8} (3-x)^8+\frac {x^2}{2}-\int \sin (3-x) \, dx \\ & = \frac {1}{8} (3-x)^8+\frac {x^2}{2}-\cos (3-x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.07 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {1}{8} (-3+x)^8+\frac {x^2}{2}-\cos (3) \cos (x)-\sin (3) \sin (x) \]

[In]

Integrate[(-3 + x)^7 + x - Sin[3 - x],x]

[Out]

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

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.74

method result size
default \(\frac {x^{2}}{2}+\frac {\left (-3+x \right )^{8}}{8}-\cos \left (-3+x \right )\) \(20\)
derivativedivides \(-9+3 x +\frac {\left (-3+x \right )^{2}}{2}+\frac {\left (-3+x \right )^{8}}{8}-\cos \left (-3+x \right )\) \(26\)
parts \(-2187 x +2552 x^{2}-1701 x^{3}+\frac {2835 x^{4}}{4}-189 x^{5}+\frac {63 x^{6}}{2}-3 x^{7}+\frac {x^{8}}{8}-\cos \left (-3+x \right )\) \(46\)
risch \(2552 x^{2}+\frac {x^{8}}{8}-3 x^{7}+\frac {63 x^{6}}{2}-189 x^{5}+\frac {2835 x^{4}}{4}-1701 x^{3}-2187 x +\frac {6561}{8}-\cos \left (-3+x \right )\) \(47\)
parallelrisch \(\frac {x^{8}}{8}-3 x^{7}+\frac {63 x^{6}}{2}-189 x^{5}+\frac {2835 x^{4}}{4}-1701 x^{3}+2552 x^{2}-2187 x -1-\cos \left (-3+x \right )\) \(47\)
norman \(\frac {-2187 x +2552 x^{2}-1701 x^{3}+\frac {2835 x^{4}}{4}-189 x^{5}+\frac {63 x^{6}}{2}-3 x^{7}+\frac {x^{8}}{8}-2187 x \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}+2552 x^{2} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}-1701 x^{3} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}+\frac {2835 x^{4} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}}{4}-189 x^{5} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}+\frac {63 x^{6} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}}{2}-3 x^{7} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}+\frac {x^{8} \tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}}{8}-2}{1+\tan \left (-\frac {3}{2}+\frac {x}{2}\right )^{2}}\) \(156\)

[In]

int(x+(-3+x)^7+sin(-3+x),x,method=_RETURNVERBOSE)

[Out]

1/2*x^2+1/8*(-3+x)^8-cos(-3+x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (19) = 38\).

Time = 0.26 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.67 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {1}{8} \, x^{8} - 3 \, x^{7} + \frac {63}{2} \, x^{6} - 189 \, x^{5} + \frac {2835}{4} \, x^{4} - 1701 \, x^{3} + 2552 \, x^{2} - 2187 \, x - \cos \left (x - 3\right ) \]

[In]

integrate(x+(-3+x)^7+sin(-3+x),x, algorithm="fricas")

[Out]

1/8*x^8 - 3*x^7 + 63/2*x^6 - 189*x^5 + 2835/4*x^4 - 1701*x^3 + 2552*x^2 - 2187*x - cos(x - 3)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.56 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {x^{2}}{2} + \frac {\left (x - 3\right )^{8}}{8} - \cos {\left (x - 3 \right )} \]

[In]

integrate(x+(-3+x)**7+sin(-3+x),x)

[Out]

x**2/2 + (x - 3)**8/8 - cos(x - 3)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.70 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {1}{8} \, {\left (x - 3\right )}^{8} + \frac {1}{2} \, x^{2} - \cos \left (x - 3\right ) \]

[In]

integrate(x+(-3+x)^7+sin(-3+x),x, algorithm="maxima")

[Out]

1/8*(x - 3)^8 + 1/2*x^2 - cos(x - 3)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.70 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=\frac {1}{8} \, {\left (x - 3\right )}^{8} + \frac {1}{2} \, x^{2} - \cos \left (x - 3\right ) \]

[In]

integrate(x+(-3+x)^7+sin(-3+x),x, algorithm="giac")

[Out]

1/8*(x - 3)^8 + 1/2*x^2 - cos(x - 3)

Mupad [B] (verification not implemented)

Time = 16.24 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.67 \[ \int \left ((-3+x)^7+x-\sin (3-x)\right ) \, dx=2552\,x^2-\cos \left (x-3\right )-2187\,x-1701\,x^3+\frac {2835\,x^4}{4}-189\,x^5+\frac {63\,x^6}{2}-3\,x^7+\frac {x^8}{8} \]

[In]

int(x + sin(x - 3) + (x - 3)^7,x)

[Out]

2552*x^2 - cos(x - 3) - 2187*x - 1701*x^3 + (2835*x^4)/4 - 189*x^5 + (63*x^6)/2 - 3*x^7 + x^8/8