Find the $x$ at which the local maxima of a function ocours. 
The function $f(x) = \int\limits_{-1}^{x}t(e^t-1)(t-1)(t-2)^3(t-3)^5 dt$ has a local maxima at $x=?$

First, I differentiated $f(x)$ and found its roots.
That came out to be $x = 0,1,2,3$. Now, one of those numbers, when plugged into $f(x)$, must give the largest value compared to the others.
In our case, since we are integrating, we would need to find the $x$ that minimizes the negative area of the function that we are integrating.
By further work and analyzing the function, I figured out that the answer must be $0$ or $2.$
But, I don't know what to do next?
Any help would be appreciated. 
 A: HINT:
The sign of $$f^{'}(x)=x(e^x-1)(x-1)(x-2)^3(x-3)^5$$  is $-,+,-,+$ respectively on the intervals $(-1,1),(1,2),(2,3),(3,\infty).$ From this you can finish without further calculation.
A: You differentiated and found the roots correctly:
$$f^{'}(x)=x(e^x-1)(x-1)(x-2)^3(x-3)^5=0 \Rightarrow \\
x_0=\{0,1,2,3\};$$
Method 1. Check the neighborhood of the critical points:
$$\begin{array}{c|c|c|c}
x_0&f'(x_0-\epsilon)&f'(x_0+\epsilon)&\text{Type of stationary point}\\
\hline
0&-&-&\text{inflection}\\
1&-&+&\text{local minimum}\\
2&+&-&\text{local maximum}\\
3&-&+&\text{local minimum}\\
\end{array}$$
Method 2. Check the second (or higher) order derivative at the critical points:
$$\begin{align}f''(0)&=0 \ \ \ \text{(inconclusive)}\\
f''(1)&=32(e-1)>0 \ \ \text{(local minimum)}\\
f''(2)&=0 \ \ \text{(inconclusive)}\\
f''(3)&=0 \ \ \text{(inconclusive)}\\
\end{align}$$
Now you can use higher order derivative test:
$$\begin{align}f'''(0)&<0 \ \ \text{(strictly decreasing inflection point)}\\
f'''(2)&=0, f^{(4)}(2)<0 \ \ \text{(local maximum)}\\
f'''(3)&=f^{(4)}(3)=f^{(5)}(3)=0, f^{(6)}(3)>0 \ \ \text{(local minimum)}.\end{align}$$
Note: You don't have to calculate the higher order derivatives completely, but you should focus on the corresponding factor and the resulting sign.
