How to find $\max\int_{a}^{b}\left (\frac{3}{4}-x-x^2 \right )\,dx$ over all possible values of $a$ and $b$, $(aI tried finding the maxima of $f(x)=\frac{3}{4}-x-x^2$ by taking the derivative and so on and use the fact that $\displaystyle\int_{a}^{b}f(x)\,dx \leq M(b-a)$ where $M$ is the global maximum, but then the maximum value depends on the values of $a$ and $b$.
 A: Given $$f(a,b) = \int_{a}^{b}\left(\frac{3}{4}-x-x^2\right)dx$$
Do the integration to get:
$$f(a,b) = \frac{a^3}{3}+\frac{a^2}{2}-\frac{3 a}{4}-\frac{b^3}{3}-\frac{b^2}{2}+\frac{3 b}{4} $$
Diff  $f(a,b)$ with w.r.t $a$ and set  to $0$
$$a^2+a-\frac{3}{4} =0$$
Solve. We get these $2$ critical points:
$$a = - \frac{3}{2} \ \  a=\frac{1}{2} $$
Diff  $f(a,b)$ with wrt $b$ and set to $0$
$$-b^2-b+\frac{3}{4} = 0$$
We get these $2$ critical points:
$$ b = - \frac{3}{2} \ \ b=\frac{1}{2} $$
only $\displaystyle a = -\frac{3}{2}  \ \  b = \frac{1}{2} $ need to be tried. $( a < b )$
$$f\left( - \frac{3}{2} , \frac{1}{2}\right) = \frac{4}{3} .$$
A: Let's look at a brute force approach.
$$f(a,b)=\int_a^b\left({3\over 4}-x-x^2\right)dx={3\over 4}(b-a)-{b^2-a^2\over 2}-{b^3-a^3\over 3}$$
Now this is maximum when
$$\begin{align} {{\partial{f(a,b)}\over\partial{a}}}&=0\\{{\partial{f(a,b)}\over\partial{b}}}&=0\end{align}$$
Which leads to
$$\begin{align} -{3\over 4}+a+a^2=0\\{3\over 4}-b-b^2=0\end{align}$$
This means the maximum is attained for $a$ and $b$ roots of the quadratic
$$X^2+X-{3\over 4}=0$$
This means $a=-{3\over 2}$ and $b={1\over 2}$
A: Evaluating the integrand and solving the optimisation problem (as in marwalix and juantheron's answers) is quite unnecessary. Simply notice that the integrand is a parabola which is positive on $[-3/2, 1 /2]$ and negative everywhere else. Therefore the integral is greatest when it is taken only on the largest interval where the integrand is positive, namely when $a=-3/2$ and $b=1 /2$,
A: Hint: Over what interval is the integrand $\frac{3}{4}-x-x^2$ non-negative?
It may be useful to sketch the curve $y=\frac{3}{4}-x-x^2$ to see what's going on.
