Is there a method for estimating the parabolic function using three points, or at least the highest/lowest point of that parabola?

404 Views Asked by At

Say I have the following three points:

|  x  |  y  |
|-----|-----|
|6,13 | 73  |
|5,76 | 77,7|
|5,39 | 78,6|

This would result in a graph looking something like this:

enter image description here

If you'd try and draw a curved line closest to these points there would be a peak somewhere to the left. My question is, is there a way to find the parabolic function closest to these three points, or at least the optimal point of that parabola?

1

There are 1 best solutions below

3
On BEST ANSWER

Let $x_1 < x_2 < x_3$ be three real numbers, and let $y_1,$ $y_2,$ and $y_3$ be real numbers. Then there is exactly one quadratic function $f$ such that $y_1 = f(x_1),$ $y_2 = f(x_2),$ and $y_3 = f(x_3).$ The graph of $f$ is a parabola that passes exactly through the three points $(x_1,y_1),$ $(x_2,y_2),$ and $(x_3,y_3).$

One way to write the formula for the function $f$ is $$ f(x) = \frac{(x-x_2)(x-x_3)}{(x_1-x_2)(x_1-x_3)}y_1 + \frac{(x-x_1)(x-x_3)}{(x_2-x_1)(x_2-x_3)}y_2 + \frac{(x-x_2)(x-x_1)}{(x_3-x_2)(x_3-x_1)}y_3. $$ You can search for "Lagrange interpolating polynomial" for more information about this function.

It is reasonably straightforward to confirm that $f$ as written above is a quadratic function and that it satisfies the necessary conditions $y_1 = f(x_1),$ $y_2 = f(x_2),$ and $y_3 = f(x_3).$ The derivative of the function is $$ f'(x) = \frac{2x-x_2-x_3}{(x_1-x_2)(x_1-x_3)}y_1 + \frac{2x-x_1-x_3}{(x_2-x_1)(x_2-x_3)}y_2 + \frac{2x-x_2-x_1}{(x_3-x_2)(x_3-x_1)}y_3. $$ To find the extreme point of $f,$ substitute $0$ for $f'(x)$ in the equation above and solve for $x.$

In order to make the equations a little less intimidating, you can write \begin{align} k_1 & = \frac{y_1}{(x_1-x_2)(x_1-x_3)}, \\ k_2 & = \frac{y_2}{(x_2-x_1)(x_2-x_3)}, \\ k_3 & = \frac{y_3}{(x_3-x_2)(x_3-x_1)}, \end{align} so that you can calculate the three numbers $k_1,$ $k_2,$ and $k_3$ directly from known values, and then \begin{align} f(x) &= k_1(x-x_2)(x-x_3) + k_2(x-x_1)(x-x_3) + k_3(x-x_2)(x-x_1), \tag1\\ f'(x) &= 2(k_1+k_2+k_3)x - k_1(x_2+x_3) - k_2(x_1+x_3) - k_3(x_2+x_1). \tag2 \end{align}

We therefore have $f'(x) = 0$ when $$ x = \frac{k_1(x_2+x_3) + k_2(x_1+x_3) + k_3(x_2+x_1)}{2(k_1+k_2+k_3)}. \tag3 $$

Note that the original condition $x_1 < x_2 < x_3$ is more than we actually need to make these equations work. The actual necessary condition is that no two of the three $x_i$ values are the same; putting them in increasing order is merely an easy way to enforce that condition.


In your particular example, we plug in the known values \begin{align} x_1 & = 5.39, & y_1 &= 78.6, \\ x_2 & = 5.76, & y_2 &= 77.7, \\ x_3 & = 6.13, & y_3 &= 73. \end{align}

We then get $k_1 \approx 266.6179693207,$ $k_2 \approx -567.5675675676,$ and $k_3 \approx 287.0708546384.$ (I write $\approx$ rather than $=$ to reflect the fact that these values have been rounded off to ten decimal places rather than written as exact fractions.) Plugging these known values into Equation $1$ and collecting terms in equal powers of $x,$ we get $$ f(x) \approx -13.8787436085 x^2 + 152.315558802 x - 339.1742147553. \tag4 $$ Plugging values into Equation $3$ tells us that the maximum value of $f(x)$ occurs when $x = 5.4873684211,$ and then Equation $4$ implies that the maximum value is given (to within the error introduced by rounding off) by $$ f(5.4873684211) \approx 78.7315789474. $$