Not homework - just an old guy trying to learn some calculus.

If I am given the x values of two local maximums and one local minimum, do I have enough information to figure out a possible equation for the function?

I figure it can be (has to be?) a fourth degree equation (in order to have that mix of max/mins). Because I know the x values of the max/mins, I know three co-ordinates where the first derivative is 0.

I’m assuming that the x value half way between each max/min is an inflection point, so I know the second derivative is 0 there, yes? (That’s a supposition - please correct me if I’m wrong).

I’ve been working away at this, and the algebra gets very complicated very fast. So before I take another stab at it, I just want to know if it’s possible or not. I keep getting a co-efficient for the x^4 of 0, but that’s impossible, or else it wouldn’t have the max/mins it does, right?

At this point, please just give me a yes or no. (Or let me know if there’s any more information I left out before you can give me a yes or no.) Assuming it’s yes, I’ll give it another try, and will come crawling back for the answer after one last go.

Sure. There will be infinitely many possibilities, but it is possible to mechanically construct particular functions with the desired local maxes and mins, sure.

It doesn’t have to be a fourth degree polynomial, and it may not even be possible for it to be a fourth degree polynomial. You are right that at the specified three co-ordinates the first derivative must be zero, and you are right that to get a function to be zero at three particular points, you can (though do not have to) take it to be a third degree polynomial with those particular roots. However, to be specifically a local max is not just to have a derivative of zero, but also for the derivative to satisfy further conditions (differentiating it from a local min, an inflection point, etc.). You may find that the third-degree polynomials you look at do not and cannot satisfy these further conditions. Only in certain cases will you luck out and get just what you want.

It is certainly not generally true that halfway between a max and a min will always be an inflection point.

That having been said, if the location of the demanded local minimum is between the locations of the two demanded local maxima, then there will be a fourth-degree polynomial solution (unique up to an additive and a positive multiplicative constant) and you can simply find it in this way. The second paragraph above was about the fully general case where these locations have not been so constrained.

Yes, you can always find such a polynomial. However, it is not unique:
[ul][li]The constant term in the polynomial will be arbitrary, since adding a constant to a function doesn’t change the locations of its extrema.[]One of the remaining coefficients of the polynomial is not determined. Rather, the relative ratios of the remaining coefficients are what are uniquely determined. This allows you to set any one of them to be whatever you want, and then the others will be determined relative to that. I recommend setting the coefficient of the x[sup]4[/sup] term to be -1.[]Other than the above freedoms, there is a unique polynomial that has extrema at the values a, b, and c, with a < b < c.[/ul][/li]Also:

This is not in fact true. It’s true for third-order polynomial, but not for any higher order of polynomial.

There’s actually a pretty slick way to solve this problem, BTW. I’ll put a vague hint (not the full solution) in the spoiler box below:

You’ve had some great ideas and some red herrings. Let me point you back to a great idea: finding a degree 3 polynomial (to be the derivative) with 3 particular zeros.

There’s a way to do this where the algebra is very, very simple. Can you think of what that would be?

Thank you both! First of all - thank you for correcting my faulty supposition on the inflection points.

So taking the guidance of the two of you, I got one of the infinite numbers of answers, but the algebra was hellacious.

I set f(x) to: -ax^4+bx^3+cx^2+dx+e
f’(x) then = -4a^3+3bx^2+2cx+d
I then used the three local maximum and minimums to get b, c, and d in terms of a.

At that point, I had (as MikeS pointed out), the ratio for the co-efficients, but - duh - I didn’t see it like that. I thought there would be one value for a, not infinite. So I set a to 1, set the constant (e) to 0 and worked it out. Plugged it into Desmos and found out I got a correct answer.

But that was a lot of algebra. So what’s the simpler method? And/or how could integration have been my friend?

It really is nice of you guys to take the time to help out.

(I’m shutting down for the day, so if I don’t reply to you tonight that’s why.)

A local minimum must be between the two local maximum assuming the function is defined in the interval and is not flat from the one to the other (personally I wouldn’t call them local maxima if it were).

If you want a third-degree polynomial to have zeros at a, b, and c, you can always use any multiple of (x - a)(x - b)(x - c).

Note that, if f has a local maximum at a point, not only must its derivative be zero at that point, but furthermore, its derivative must be positive just below that point and negative just above that point. Similarly, at a local minimum, the derivative is zero, but just below the derivative is negative and just above the derivative is positive.

Thus, if a < b < c, we will want to use a negative multiple of (x - a)(x - b)(x - c) as our derivative, to be positive, zero, and negative in the right places. Any negative multiple of (x - a)(x - b)(x - c) will do.

Finally, once we know the derivative of the function we seek, we can integrate it to get our solution.

I wasn’t supposing the requested two local maxima and one local minimum to be an exhaustive list of all the local extrema, though; someone certainly could ask me “Hey, can you come up with a function with a local maximum at 0, a local maximum at 1, and a local minimum at 2?”, and I certainly could honestly answer “Yes; many such, in fact (though none are fourth-degree polynomials)”.

You know three zeros of the cubic equation that is the function’s derivative; the three local extrema. Call them x[sub]1[/sub] x[sub]2[/sub] and x[sub]3[/sub]. Then the cubic equation of the derivatives is
0 = (x-x[sub]1[/sub])(x-x[sub]2[/sub])(x-x[sub]3[/sub]) = x[sup]3[/sup] - (x[sub]1[/sub]+x[sub]2[/sub]+x[sub]1[/sub])x[sup]2[/sup] + (x[sub]1[/sub]x[sub]2[/sub]+x[sub]1[/sub]x[sub]3[/sub]+x[sub]2[/sub]x[sub]3[/sub])x - x[sub]1[/sub]x[sub]2[/sub]x[sub]3[/sub]

Increase all the exponents by 1 (including on the constant term).

Yes, although let’s note that while b can be arbitrary, a must be negative (supposing we intend the middle extremum to be a local min and the other two to be local maxes); otherwise, we get the opposite of what’s intended: a local max inbetween two local mins.

But that’s not necessarily true: x[sup]4[/sup] has a local minimum at 0, even though its second derivative is zero there.

Rather, the accurate condition (where sufficiently differentiable) is that in the sequence f’(x), f’’(x), f’’’(x), etc., when we first find one that is nonzero, it must be an eventh-numbered derivative, at which point, as you note, the sign of that nonzero value will determine whether we are dealing with a min or a max (negative for a max, positive for a min).

The accurate condition along the lines you mention, I mean. The “local extrema occur precisely where the derivative changes sign” account is also accurate.