# High-school calculus question - do I have enough information to figure out the function?

**URL:** <https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935>\
**Category:** Factual Questions\
**Created:** [April 6, 2015, 12:48am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935 "2015-04-06T00:48:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![D18](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@D18](https://boards.straightdope.com/u/D18)\
**Post date:** [April 6, 2015, 12:48am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/1 "2015-04-06T00:48:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 1:22am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/2 "2015-04-06T01:22:27Z")

</div>

> [@D18](#):
>
> 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?

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

> [@](#):
>
> 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.

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.

> [@](#):
>
> 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).

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

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 1:30am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/3 "2015-04-06T01:30:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [April 6, 2015, 1:30am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/4 "2015-04-06T01:30:42Z")

</div>

> [@D18](#):
>
> 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.

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:

> [@](#):
>
> 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).

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:

Use integration.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 1:35am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/5 "2015-04-06T01:35:55Z")

</div>

> [@D18](#):
>
> I’ve been working away at this, and the algebra gets very complicated very fast.

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?

---

<div class="post-metadata">

**Author:** ![D18](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@D18](https://boards.straightdope.com/u/D18)\
**Post date:** [April 6, 2015, 1:54am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/6 "2015-04-06T01:54:27Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [April 6, 2015, 1:58am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/7 "2015-04-06T01:58:53Z")

</div>

> [@Indistinguishable](#):
>
> 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)…

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).

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:03am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/8 "2015-04-06T02:03:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:05am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/9 "2015-04-06T02:05:34Z")

</div>

> [@OldGuy](#):
>
> 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).

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)”.

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [April 6, 2015, 2:06am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/10 "2015-04-06T02:06:27Z")

</div>

> [@D18](#):
>
> But that was a lot of algebra. So what’s the simpler method? And/or how could integration have been my friend?

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]

Now integrate this last

f(x) = 1/4 x[sup]3[/sup] - 1/3 (x[sub]1[/sub]+x[sub]2[/sub]+x[sub]1[/sub])x[sup]2[/sup] + 1/2 (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]

af(x) + b is the general answer

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:09am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/11 "2015-04-06T02:09:37Z")

</div>

> [@Indistinguishable](#):
>
> Thus, if a \< b \< c **and we want local maxes at a and c but a local min at b** , 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.

Missing words reinstated in bold.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:11am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/12 "2015-04-06T02:11:52Z")

</div>

> [@OldGuy](#):
>
> Now integrate this last
> 
> f(x) = 1/4 x[sup]3[/sup] - 1/3 (x[sub]1[/sub]+x[sub]2[/sub]+x[sub]1[/sub])x[sup]2[/sup] + 1/2 (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).

> [@](#):
>
> af(x) + b is the general answer

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.

---

<div class="post-metadata">

**Author:** ![D18](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@D18](https://boards.straightdope.com/u/D18)\
**Post date:** [April 6, 2015, 2:15am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/13 "2015-04-06T02:15:47Z")

</div>

:smack: but in a 😉 way!

Thank you all!

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [April 6, 2015, 2:18am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/14 "2015-04-06T02:18:32Z")

</div>

Thanks Indistinguishable. I was just making a post to correct those. It timed out on me on the edit.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:27am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/15 "2015-04-06T02:27:34Z")

</div>

> [@OldGuy](#):
>
> Thanks Indistinguishable. I was just making a post to correct those. It timed out on me on the edit.

Ah; a horror I know well. 🙂

---

<div class="post-metadata">

**Author:** ![eschereal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/eschereal/32/18939_2.png) [@eschereal](https://boards.straightdope.com/u/eschereal)\
**Post date:** [April 6, 2015, 2:42am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/16 "2015-04-06T02:42:23Z")

</div>

> [@Indistinguishable](#):
>
> 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.

I think the more concise way to put that is that for extrema, f’(x) = 0 and f’‘(x) != 0 (for a max, f’‘(x) \< 0 , for a min, f’'(x) \> 0).

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:47am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/17 "2015-04-06T02:47:14Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 6, 2015, 2:55am UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/18 "2015-04-06T02:55:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [April 7, 2015, 10:02pm UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/19 "2015-04-07T22:02:38Z")

</div>

Provided, of course, that the function is differentiable there.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [April 7, 2015, 10:28pm UTC](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935/20 "2015-04-07T22:28:09Z")

</div>

Yes; I’ve tried thrice to indicate that everything I’m saying in this thread assumes sufficient differentiability. 🙂

[Next page](https://boards.straightdope.com/t/high-school-calculus-question-do-i-have-enough-information-to-figure-out-the-function/716935.md?page=2)
