If the range of a function is $[a,b]$ ,where $a,b \in \mathbb N$ ,find $f(a+b)$. Let  $f(x)= (x+1) (x+2) (x+3) (x+4) + 5$  where $x \in [-6,6]$. If the range of this function is $[a,b]$ ,where $a,b \in \mathbb  N$ ,find $f(a+b)$.
ATTEMPT:
Sketching the graph the we know that minima of this function is between $-1$ and $-2$, and since the function is strictly increasing in the interval $[-1,6]$, maxima will be at $6$.
But how to get the minima?
 A: Let $$x:=t-{5\over2}\qquad\left(-{7\over2}\leq t\leq{17\over2}\right)\ .$$ We have to find the range of
$$g(t):=\left(t-{3\over2}\right)\left(t-{1\over2}\right)\left(t+{1\over2}\right)\left(t+{3\over2}\right)=\left(t^2-{9\over4}\right)\left(t^2-{1\over4}\right)$$
when $t$ ranges in the given interval. Since $t^2$ then assumes values between $0$ and ${289\over4}$,  the new variable $u:=t^2-{5\over4}$ assumes values between $-{5\over4}$ and $71$. Expressing $g$ in terms of $u$ we obtain
$$h(u):=(u-1)(u+1)=u^2-1\ ,$$
which then assumes values between $-1$ and $71^2-1=5040$.
Taking the $+5$ in the definition of $f$ into account we conclude that the minimal value of $f$ is $a=4$, and the maximal value is $b=5045$. I leave it to you to compute $f(5049)$.
A: Hint
$$(x+1)(x+2)(x+3)(x+4)+5=[(x+1)(x+4)][(x+2)(x+3)]+5=(x^2+5x+4)(x^2+5x+6)+5
=(x^2+5x+5)^2+4$$
A: $\bf{My\; Solution::}$ Let $\displaystyle \left(x+\frac{1}{2}\right) = t\;,$ and $\displaystyle -\frac{11}{2}\leq t \leq \frac{13}{2}$. 
Then expression convert into 
$$\displaystyle f(t) = \left(t-\frac{3}{2}\right)\cdot \left(t-\frac{1}{2}\right)\cdot \left(t+\frac{1}{2}\right)\cdot \left(t+\frac{3}{2}\right)=\left(t^2-\frac{9}{4}\right)\cdot \left(t^2-\frac{1}{4}\right)+5$$
So $$\displaystyle f(t) = t^4-\frac{5}{2}t^2+\frac{9}{16}+5$$ and $$\displaystyle0 \leq t^2\leq \frac{169}{4}$$
So we get $$\displaystyle f(t) = \left(t^2-\frac{5}{4}\right)^2+\frac{89}{16}-\frac{25}{16}\Rightarrow f(t) = \left(t^2-\frac{5}{4}\right)^2+4$$ and $$\displaystyle0 \leq t^2\leq \frac{169}{4}$$
So $\displaystyle \bf{f(t)_{Min.} = 4}$ when $\displaystyle t^2=\frac{5}{4}$ 
And $\displaystyle \bf{f(t)_{max.} = \left(\frac{169}{4}-\frac{5}{4}\right)^2+4=(41)^2+4 = 1681+4 = 1685,}$ When $\displaystyle t^2= \frac{169}{4}$
A: Indeed Cameron, thanks. I was not using pen and paper. Doing it in my head, but I still think the derivative will factor out by grouping terms as below (hopefully right this time :)).
f'(x) = (x+1)(x+2)(x+3)+(x+2)(x+3)(x+4)+(x+1)(x+3)(x+4)+(x+1)(x+2)(x+4)
      = (x+2)(x+3)(2x+5)+(x+1)(2x+5)(x+4)
      = (2x+5)[(x+3)(x+2)+(x+1)(x+4)]
The derivative nicely factors out. So it should be easy to find all the zeros in [-6,6] and test the sub-intervals
The absolute min for a continuous function can only be at one of the local mins or at end-points. You've already ruled out the right end-point. So just test the local mins and the value of the function at x=-6 for absolute min
