Wikipedia:Reference desk/Archives/Mathematics/2021 May 9

= May 9 =

Deriving polynomial coefficients "synthetically"
Suppose you wanted to find the unknown coefficients the quadratic polynomial p(x) = Ax^2 + Bx + C, which happens to be 5x^2 + 13x^1 + 17. First, observe that the constant term C can be extracted by simply evaluating the polynomial at zero, ie: C = p(0) = 17. Furthermore, the sum of all coefficients is p(1) = 35 and the difference between even and odd terms of the polynomial given by p(-1) = 9. Remove the constant term from both to obtain the sum and difference of A and B, as in K = p(1) - p(0) = 35 - 17 = 5 + 13 = 18 and D = p(-1) - p(0) = 9 - 17 = 5 - 13 = -8, then solve with A = ((K + D)/2) = ((18 + (-8)) / 2) = 5 and B = ((K - D)/2) = ((18 - (-8)) / 2) = 13. Could this be extended to higher polynomials? Earl of Arundel (talk) 18:04, 9 May 2021 (UTC)
 * Yes. For any set of pairs $$(x_1,y_1),(x_2,y_2),...,(x_n,y_n)$$ in which all $$x_i$$ values are distinct, there is a unique polynomial $$P(x)$$ of degree at most $$n{-}1$$ such that $$P(x_i)=y_i,i=1,2,...,n.$$ See . Taking the $$n$$ coefficients of the polynomial $P(x)=\sum_j c_j x^j$ as unknowns, the $$n$$ equations
 * $$\sum_{j=0}^{n{-}1}c_j x_i^j=y_i,i=1,2,...,n$$
 * form a linear system of $$n$$ equations with $$n$$ unknowns. See . --Lambiam 19:03, 9 May 2021 (UTC)
 * Awesome, thank you! Earl of Arundel (talk) 21:11, 9 May 2021 (UTC)
 * FYI, there's a systematic way to solve this system of linear equations, which is the Lagrange interpolation formula. It can come in handy a lot of times. Duckmather (talk) 20:18, 10 May 2021 (UTC)
 * Thank you! Yes, it looks like matrices are the way to go with that. Earl of Arundel (talk) 00:49, 12 May 2021 (UTC)