How does one create a polynomial equation based on graphic features?

So as many of you know, graphs of polynomial equations with degree greater than 2 have what are known (to me) as local minima and local maxima (the point(s) on its graph where the derivative of the function is zero, the point to which output values converge inside a certain range of input values). Based on the coordinates of these points, and other information taken from the graph, is it possible to create an equation that describes it? For example, if I asked, "Create the equation of a cubic function with positive-positive end behavior that has a local maximum at (3,5) and a local minimum at (6,2), with the graph passing through the origin. Is there a systematic way to do this? Also, if there is not enough information, I would like to know, and why. Thanks!

• Your cubic here is actually overspecified: you've got 5 constraints and only four values to determine. Also if "positive-positive end behavior" is supposed to mean what I think it means you'll be highly disappointed in the behavior of cubics in general... – Dan Uznanski Aug 12 '18 at 22:29
• @Dan Uznanski I'm sorry, I don't follow....I count four constraints....I imagine a cubic function is possible with those values. Obviously, a cubic function could not pass through the origin with both the maximum and the minimum being positive y values but with one negative x value. I also mean by "positive-positive end behavior" that as the x values approach positive infinity, so does y, and vice verse. Could you give me a little more in depth explanation as to what I'm missing? I would like to know. It's very possible it's just my inadequacy at explaining concepts in my head... – Abel Palmer Aug 12 '18 at 22:36
• You have three points that this curve passes through: $(3,5)$, $(6,2)$, and $(0,0)$. You also have two known derivatives: $(3,0)$ and $(6,0)$. This is five constraints; matching all but the origin one gives $f(x) = \frac{2}{9}x^3 - 3x^2 + 12x - 10$, which passes through $(0,-10)$ instead of the origin. For cubics you have four free variables which means you can match four constraints. Also it looks like I was wrong about what you meant with positive-positive: I thought you meant that $f(x)$ tended toward positive infinity for both negative and positive $x$, which is impossible among cubics. – Dan Uznanski Aug 12 '18 at 22:42
• Ok, I see what you mean with five constraints....my problem. But also, what did you mean by my being disappointed with the behavior of cubics? I simply want to know if there is a systematic way to create an equation for a polynomial based on knowing certain features from its graph.... – Abel Palmer Aug 12 '18 at 22:55
• Also, maybe I used the wrong word when I said derivatives. I meant that the slope of a tangent line to the graph at (3,5) and at (6,2) was zero...... – Abel Palmer Aug 12 '18 at 22:57

Taking the points with the maximum and minimum, which are sufficient to define the cubic, we can just write the cubic as $y=ax^3+bx^2+cx+d$ and plug in the data we have. $$5=a3^3+b3^2+c3+d\\2=a6^3+b6^2+c6+d\\0=3a3^2+2b3+c\\0=3a6^2+3b6+c$$ This is four equations in four unknowns which can be solved by the usual techniques to yield $a,b,c,d$.

For a polynomial $p(x) = a_nx^n + a_{n-1}x^{n-1} + \cdots + a_1x + a_0$ to pass through a point $(x_1, y_1)$, it clearly must be true that $y_1 = p(x_1)$. So we'll plug that in, and get $$\color{blue}{y_1} = a_n\color{blue}{x_1^n} + a_{n-1}\color{blue}{x_1^{n-1}} + \cdots + a_1\color{blue}{x_1} + a_0$$

Notice that in this, all the blue stuff is actually constants: since we know what it is already, we have a linear equation in $n+1$ unknowns, namely the list of $a_i$ values. From here, it is pretty obvious that given $n+1$ points that the polynomial must pass through, we can come up with a polynomial of degree $n$ that passes through those points, by finding these equations and solving the system for the various $a_i$.

But, of course, we don't have just points here - we also have derivatives. The first derivative of $p(x)$ is $p'(x) = na_nx^{n-1} + (n-1)a_{n-1}x^{n-2} + \cdots + 2a_2x + a_1$. Once again plugging in $y'_1$ and $x_1$, we have

$$\color{blue}{y'_1} = \color{blue}{n}a_n\color{blue}{x_1^{n-1}} + \color{blue}{(n-1)}a_{n-1}\color{blue}{x_1^{n-2}} + \cdots + \color{blue}{2}a_2\color{blue}{x_1} + a_1$$

where once again the blue parts are constants, so we once again have a linear equation, but this time in $n$ unknowns! We're missing $a_0$, so we have to have at least one actual point to find the complete polynomial.

We can continue in this way: the second derivative is $p''(x)=\sum_{i=0}^n\color{blue}{i(i-1)}a_i\color{blue}{x^{i-2}}$, and we end up without $a_1$ as well, so we need at least two pieces of information that are first derivatives or higher, and in general the $k$th derivative is $p^{(k)}(x)=\sum_{i=0}^n\color{blue}{(i)_k}a_i\color{blue}{x^{i-k}}$ where $(i)_k$ is the falling factorial. In every case, we end up with a linear equation with the coefficients of our unknown polynomial as its unknowns; we need merely have enough information: $n+1$ data points for a degree $n$ polynomial, at least $k+1$ of which are from the $k$th derivative or lower.

This discussion does leave out one thing you mentioned in your original request: the end behavior. End behavior tells us exactly one thing: the sign of the coefficient of the highest power. If the polynomial tends toward $+\infty$ as $x$ approaches $+\infty$, $a_n$ is positive; if it approaches $-\infty$ instead, $a_n$ is negative. The other end, where $x$ approaches $-\infty$, is automatically determined by the parity of $n$: for even $n$, it is the same as when $x$ approaches $+\infty$; for odd, it is the opposite.