# Finding a cubic polynomial that attains a max/min value over an open interval

1. Feb 5, 2013

### phosgene

1. The problem statement, all variables and given/known data

Give an example of a cubic polynomial, defined on the open interval (-1,4), which reaches both its maximum and minimum values.

2. Relevant equations

-

3. The attempt at a solution

I can see that I would need a function such that there is some f(a) and f(b) in (f(-1),f(4)) such that f(a) >= all f(x) for x in (-1,4) and f(b) <= all f(x) for x in (-1,4). I used an online tool to adjust the coefficients of a cubic until I got what I needed. But I have no idea how to do this by myself. All that I can think of is to somehow use the fact that at extrema, a function's derivative is zero.

2. Feb 5, 2013

### Staff: Mentor

Write your cubic as y = (x - a)(x - b)(x - c). The x-intercepts are at (a, 0), (b, 0), and (c, 0). Without too much effort you can put in values for a, b, and c so that all three intercepts are in the interval (-1, 4), with a local maximum between a and b, and a local minimum between b and c.

3. Feb 5, 2013

### Ray Vickson

You could find just any old cubic p(x) that has distinct maxima and minima, then shift and re-scale x until the max and min lie in your interval.