Determining whether a polynomial is monotonic on a given interval $I$ Consider a regression/data fitting problem with polynomials. 
We have an extra constraint that the solution must be monotonic. So I have the following questions:


  
  For a given polynomial, how to efficiently determine if it is monotonic (at least in a given interval)? 
  Furthermore, how to impose the monotonic constraint (again at least in a given interval)?
  


Thanks a lot in advance!
A polynomial $p(x)$ is monotonic on an interval $I$ iff its derivative $p'(x)$ is everywhere nonnegative or everywhere nonpositive on $I$, or equivalently if all of the roots of $p'(x)$ in the interior of the interval have even order.

As an manually workable example, consider a generic cubic polynomial $$p(x) := Ax^3 + Bx^2 + Cx + D.$$ Differentiating gives $$p'(x) = 3A x^2 + 2B x + C,$$ and (henceforth provided that $A \neq 0$) this has no real roots if $$\Delta := (2B)^2 - 4(3A)(C) = 4(B^2 - 3 A C)$$ is negative and a real double root if $\Delta = 0$. If $\Delta &gt; 0$ then $p'$ has two single roots.

So, $p$ is monotonic on $\mathbb{R}$ iff $\Delta \leq 0$. On an interval $I$, $p$ is monotonic iff either (1) $\Delta \leq 0$ or (2) $\Delta &gt; 0$ and neither of the roots of $\Delta$ (which can be computed with the quadratic formula) are contained in the interior of $I$.
Travis is right, hobs is mistaken I'm afraid. When the roots of the derivative have even multiplicity but are real, there exist values of which the derivative is strictly negative and values of which it is strictly positive. So your polynomial is not monotonic. I think hobs thinks about the matrix of which the derivative is the characteristic equation. Then the roots are the eigenvalues, and the matrix is definite.