
has derivative

We want this to have critical points at
and
; we want
to be 0 or undefined at these points. Since
is a polynomial, it is continuous, so the derivative will always exist.
So we need

We also want
and
. This means

so the previous system reduces to

So the function is
