# Formula for coefficients of interpolation polynomial

(Question) What is the (conventional) formula for coefficients of interpolation polynomial?

Consider the interpolation problem: find the polynomial through a given set of points $$(x_0,y_0),...,(x_n,y_n)$$. Suppose we want the polynomial in canonical form (monomial basis): coefficients times powers of $$x$$.

Is there a standard solution to this problem? What would be the formula for the coefficients and how is it obtained?

Note: I found my own solutions for this problem, but I would like to know the ‘standard’ solution. Maybe it involves some Linear Algebra that I am not aware of yet.

## 1 Answer

Here is a general way to obtain it. Your unique polynomial will have to be of degree at most $$n$$, so assume we have $$p(x) = a_0 + a_1x + +\ldots + a_nx^n = \sum_{k=1}^n a_k x^k.$$

Then, plugging in your points, you get the equations $$y_i = \sum_{k=1}^n a_k x_i^k, \quad \forall i \in [n].$$ This is a linear system of $$n+1$$ equations in $$n+1$$ unknowns, guaranteed to be invertible due to the nature of the system. Hence, there is a unique solution, which you can find by Gaussian Elimination, for example.

UPDATE - EXAMPLE

Perhaps an example will help. Consider finding the unique linear polynomial through the points $$(0,0)$$ and $$(1,1)$$. We assume the form $$p(x) = a_0 + a_1x$$ which leads to the equations $$\begin{split} 0 = a_0 + a_1 \cdot 0\\ 1 = a_0 + a_1 \cdot 1 \end{split}$$ and the first equation simplifies to $$a_0=0$$, plugging into the second yields $$a_1=1$$, so we have $$p(x) = 0 + 1 \cdot x = x,$$ which is, of course, the unique line through $$(0,0)$$ and $$(1,1)$$, as expected.

• How would you define $a_k$ specifically? – Max Feb 11 at 16:26
• @Max you are not defining $a_k$, they are variables for which you are solving – gt6989b Feb 11 at 16:29
• Indeed, instead of define, I meant how do you get $a_k$ directly (so a formula for $a_k$). – Max Feb 11 at 16:32
• @Max see update for an example. One can use something like Cramer's Rule if you insist on calculating coefficients directly via a formula instead of a general algorithmic procedure. – gt6989b Feb 11 at 16:34
• I would like the formula for $a_k$ in closed form. As used in the link. – Max Feb 11 at 16:38
{"ft_lang_label":"__label__en","ft_lang_prob":0.92961854,"math_prob":0.9998295,"size":587,"snap":"2019-13-2019-22","text_gpt3_token_len":128,"char_repetition_ratio":0.118353345,"word_repetition_ratio":0.0,"special_character_ratio":0.22316866,"punctuation_ratio":0.15929204,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000056,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-27T09:39:04Z\",\"WARC-Record-ID\":\"<urn:uuid:00c21abf-6229-41a8-90d8-70216cd77a4b>\",\"Content-Length\":\"133884\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:688fc5dc-0560-4151-9635-7700764ad7dd>\",\"WARC-Concurrent-To\":\"<urn:uuid:f8ca706b-ee54-4662-95f4-8189a4fd0690>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/3108921/formula-for-coefficients-of-interpolation-polynomial?noredirect=1\",\"WARC-Payload-Digest\":\"sha1:GDCKXAWX76UVZ3YDGVR6K7DSGPE7BIWJ\",\"WARC-Block-Digest\":\"sha1:GXTIQZ4L3RQHXMDOPW5IXPX334ZCRRMX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232262311.80_warc_CC-MAIN-20190527085702-20190527111702-00363.warc.gz\"}"}