Finding second degree polynomial using newton’s method

calculusnumerical methodspolynomials

I know what is newton-Raphson's method, i.e., to approximate the value of roots using numerical analysis. But, when there is no function and only data is given, then how to find actual function. Question is: how to find second degree polynomial if data is:
$$
\begin{array}{c|cccc}
x & 0.0 & 0.2 & 0.4 & 0.6 \\
\hline
f(x) & 15.0 & 21.0 & 30.0 & 51.0
\end{array}
$$

And also to estimate the value of $f(0.1)$ and $f(0.5)$. I searched rigorously, but couldn't understand more advanced topics of calculus etc. I think two posts are quite helpful, but too difficult for me to properly grasp the ideas. {https://math.stackexchange.com/questions/1616995/finding-all-roots-of-multivariate-polynomial-using-newtons-method}, {https://math.stackexchange.com/questions/742871/newtons-method-for-roots-of-polynomials}. If any one guide me properly I will be highly thankful.

Best Answer

As suggested by @AlexBurdin it has 4 points so it is of third degree polynomial i.e., $4_{points}-1 = 3_{degree}$. It can be solved using the Lagrange polynomial method. $$ L(x) = \sum_{j=0}^{k=data\: points}y_jl_j(x) \\ l_j(x) = {\prod_{0\le m \le k}} \frac{x-x_m}{x_j-x_m} $$ For my case it is four points, so j = 0-3. Where, $m \ne k$ and $f(x) = y$. $$ f(x) = y_0 \cdot \frac{x-x_1}{x_0-x_1} \cdot \frac{x-x_2}{x_0-x_2} \cdot\frac{x-x_3}{x_0-x_3} + y_1 \cdot \frac{x-x_0}{x_1-x_0} \cdot \frac{x-x_2}{x_1-x_2} \cdot\frac{x-x_3}{x_1-x_3} \\+ y_2 \cdot \frac{x-x_0}{x_2-x_0} \cdot \frac{x-x_1}{x_2-x_1} \cdot\frac{x-x_3}{x_2-x_3}+ y_3 \cdot \frac{x-x_0}{x_3-x_0} \cdot \frac{x-x_1}{x_3-x_1} \cdot\frac{x-x_2}{x_3-x_2} $$ Plugging the values: $$ f(x) = 15 \cdot \frac{x-0.2}{0-0.2} \cdot \frac{x-0.4}{0.0-0.4} \cdot\frac{x-0.6}{0.0-0.6}+ 21 \cdot \frac{x-0}{0.2-0} \cdot \frac{x-0.4}{0.2-0.4} \cdot\frac{x-0.6}{0.2-0.6}\\ + 30 \cdot \frac{x-0}{0.4-0} \cdot \frac{x-0.2}{0.4-0.2} \cdot\frac{x-0.6}{0.4-0.6}+ 51 \cdot \frac{x-0}{0.6-0} \cdot \frac{x-0.2}{0.6-0.2} \cdot\frac{x-0.4}{0.6-0.4} \\ $$ $$ f(x)=\frac{-312}{2}(x-0.2)(x-0.4)(x-0.6) + \frac{2625}{2}(x-0.0)(x-0.4)(x-0.6)\\ + \frac{-1875}{1}(x-0.0)(x-0.2)(x-0.6)+ \frac{2125}{2}(x-0.0)(x-0.2)(x-0.4) $$ Solving and we get: $$ f(x) = \frac{375}{2}x^3-\frac{150}{2}x^2+\frac{75}{2}x + 15 $$ By putting 0.1 and 0.5 values into the function we get: $$ f(0.1) = \frac{375}{2}0.1^3-\frac{150}{2}0.1^2+\frac{75}{2}0.1 + 15 = 18.1875\\ f(0.5) = \frac{375}{2}0.5^3-\frac{150}{2}0.5^2+\frac{75}{2}0.5 + 15 = 38.1844 $$ Proof: If we put the given x data values into the function then we get the function values given in the table: $$ f(0.0) = \frac{375}{2}0.0-\frac{150}{2}0.0^2+\frac{75}{2}0.0 + 15 = 15\\ f(0.2) = \frac{375}{2}0.2^3-\frac{150}{2}0.2^2+\frac{75}{2}0.2 + 15 = 21 $$ and so on. Hope this helps.