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

Optimal. Leaf size=27 \[ \frac {1}{8} (3-x)^8+\frac {x^2}{2}-\cos (3-x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2718} \begin {gather*} \frac {x^2}{2}+\frac {1}{8} (3-x)^8-\cos (3-x) \end {gather*}

Antiderivative was successfully verified.

[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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 29, normalized size = 1.07 \begin {gather*} \frac {1}{8} (-3+x)^8+\frac {x^2}{2}-\cos (3) \cos (x)-\sin (3) \sin (x) \end {gather*}

Antiderivative was successfully verified.

[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]
time = 0.10, size = 20, normalized size = 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 \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )+2552 x^{2} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )-1701 x^{3} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )+\frac {2835 x^{4} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )}{4}-189 x^{5} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )+\frac {63 x^{6} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )}{2}-3 x^{7} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )+\frac {x^{8} \left (\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )\right )}{8}-2}{1+\tan ^{2}\left (-\frac {3}{2}+\frac {x}{2}\right )}\) \(156\)

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

Maxima [A]
time = 0.33, size = 19, normalized size = 0.70 \begin {gather*} \frac {1}{8} \, {\left (x - 3\right )}^{8} + \frac {1}{2} \, x^{2} - \cos \left (x - 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 45 vs. \(2 (19) = 38\).
time = 0.62, size = 45, normalized size = 1.67 \begin {gather*} \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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.05, size = 15, normalized size = 0.56 \begin {gather*} \frac {x^{2}}{2} + \frac {\left (x - 3\right )^{8}}{8} - \cos {\left (x - 3 \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 19, normalized size = 0.70 \begin {gather*} \frac {1}{8} \, {\left (x - 3\right )}^{8} + \frac {1}{2} \, x^{2} - \cos \left (x - 3\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.20, size = 45, normalized size = 1.67 \begin {gather*} 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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Chatgpt [F] Failed to verify
time = 1.00, size = 17, normalized size = 0.63 \begin {gather*} \frac {\left (x -3\right )^{8}}{8}+\frac {x^{2}}{2}+\cos \left (x -3\right ) \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

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

________________________________________________________________________________________