Find a, b, c and d of a function $f(x) = ax^4 + bx^3 + cx^2 + dx + 1$, given values f(1), f(2), f(3), ...

66 Views Asked by At

I have a (very-likely) 4-grade function, and I know all the values, but I am having problems to find the formula of the function itself.

The number without the x is a one for sure.

The functions points are:

(0  |    1)
(1  |    9)
(2  |   41)
(3  |  129)
(4  |  321)
(5  |  681)
(6  | 1289)

I have been calculated with the following starting-grid:

$$ \begin{cases} a + b + c + d + 1 = 9\\ 16a + 8b + 4c + 2d + 1 = 41\\ 81a + 27b + 9c + 3d + 1 = 129\\ 256a + 64b + 16c + 4d + 1 = 321\\ \end{cases} $$

I came to a = $2\over3$, b = $4\over3$, c = $16\over3$, d = $2\over3$, yet it's another function.

I have over 2 pages of calculations and handwriting only I can read, so my question is: Can I calculate it much faster/ simpler/ cleaner? - Checking through every addition to find one mistake just seems lame.

Is there an online (free) calculator for stuff like these?

PS. Be nice to add the tag find-formula :)

2

There are 2 best solutions below

0
On

In the comment section of the answer I found the interpolating polynomial {{0,1},{1, 9},{2, 41},{3, 129},{4, 321},{5, 681},{6, 1289}} method for wolfram alpha. The solution is

$$2 x^4 + 4 x^3 + 10 x^2 + 8 x + 3 \over 3$$

so a, b, c and d are equivalently $2\over3$, $4\over3$, $10\over3$, $8\over3$

0
On

Given $7$ distinct data points , we can use polynomial interpolation in the Lagrange from such that:

$\color{red}{\left(0,1\right)},\color{green}{\left(1,9\right)},\color{pink}{\left(2,41\right)},\color{blue}{\left(3,129\right)},\left(4,321\right),\color{olive}{\left(5,681\right)},\color{orange}{\left(6,1289\right)}$

$$\sum_{j=0}^{6}y_{j}l_{j}\left(x\right)=\sum_{j=0}^{6}y_{j}\prod_{0\le m\le6}^{ }\frac{x-x_{m}}{x_{i}-x_{m}}$$$$=\frac{x-1}{0-1}\frac{x-2}{0-2}\frac{x-3}{0-3}\frac{x-4}{0-4}\frac{x-5}{0-5}\frac{x-6}{0-6}\color{red}{\cdot1}+$$$$\frac{x-0}{1-0}\frac{x-2}{1-2}\frac{x-3}{1-3}\frac{x-4}{1-4}\frac{x-5}{1-5}\frac{x-6}{1-6}\color{green}{\cdot9}+$$$$\frac{x-0}{2-0}\frac{x-1}{2-1}\frac{x-3}{2-3}\frac{x-4}{2-4}\frac{x-5}{2-5}\frac{x-6}{2-6}\color{pink}{\cdot41}+$$$$\frac{x-0}{3-0}\frac{x-1}{3-1}\frac{x-2}{3-2}\frac{x-4}{3-4}\frac{x-5}{3-5}\frac{x-6}{3-6}\color{blue}{\cdot129}+$$$$\frac{x-0}{4-0}\frac{x-1}{4-1}\frac{x-2}{4-2}\frac{x-3}{4-3}\frac{x-5}{4-5}\frac{x-6}{4-6}\cdot321+$$$$\frac{x-0}{5-0}\frac{x-1}{5-1}\frac{x-2}{5-2}\frac{x-3}{5-3}\frac{x-4}{5-4}\frac{x-6}{5-6}\color{olive}{\cdot681}+$$$$\frac{x-0}{6-0}\frac{x-1}{6-1}\frac{x-2}{6-2}\frac{x-3}{6-3}\frac{x-4}{6-4}\frac{x-5}{6-5}\color{orange}{\cdot1289}$$

Another way would be using Horner's method.