# A question I have about my L.A. textbook (2)

Gold Member
The other question I have is about deriving a polynomial to approximate a function. The example given is the function sin((pi * x^2)/ 2). The textbook says you can't integrate that (I don't remember that much calculus), so it shows finding a polynomial that approximates it and integrating that instead.

The text shows finding: f(0)=0, f(.25)=.098017, f(.5)=.382683, f(.75)=.77301, f(1)=1

Then it somehow uses linear algebra (matrices representing a system of equations or something?) to find the approximating polynomial p(x)=.098796x + .762356x^2 + 2.14429x^3 - 2.00544x^4

Could someone show how to do this?

your second question seems like an excellent introduction to Vandermonde Matrices. I wouldn't recommend solving this 5x5 matrix by hand. With some cleverness you can get it down to a 4x4 matrix but still a lot of work to do by hand. A good computer exercise. It would be worth learning to derive the determinant formula for Vandermonde Matrix though.

(You can see its effect in your first question but sketching the equation and solving it the 'regular way' seems preferable for intuition I think.)

The big idea is that a degree ##n## single variable polynomial (that isn't identically zero) is completely specified by ##n+1## distinct data points.

Gold Member
@gibberingmouther

it looks like mods bipartitioned your thread with my response specifically into this one. Happy to discuss here. If you want to do polynomial interpolation with standard linear algebra tools, you need to spend some time learning the Vandermonde Matrix. Most introductory texts will mention it (perhaps not by name) and suggest it is useful though not really tell you why.

It's quite flexible for an awful lot of proofs and 'real problems'.

• gibberingmouther
Okay, I think I'm done for today. I'll probably post again tomorrow. I need to understand how my textbook treats "polynomial interpolation" as well as this new info about the "Vandermonde Matrix". Thanks for your time, I will be on this tomorrow.

Gold Member
sounds good. A sneak preview:

##
\mathbf{Ac} = \begin{bmatrix}
1 & a_1 & a_1^2 & a_1^3 & a_1^4\\
1 & a_2 & a_2^2 & a_2^3 & a_2^4\\
1 & a_3 & a_3^2 & a_3^3 & a_3^4\\
1 & a_4 & a_4^2 & a_4^3 & a_4^4\\
1 & a_5 & a_5^2 & a_5^3 & a_5^4
\end{bmatrix} \begin{bmatrix}
c_0\\
c_1\\
c_2\\
c_3\\
c_4\\
\end{bmatrix} = \mathbf y
##

##\mathbf A## is a Vandermonde matrix. It has a lot of special 'patterns' that can be exploited.

Last edited:
Gold Member
Can someone explain where the column of 1's comes from?

EDIT: Nevermind, I get it now.

These two sites explained it pretty well, though you need to look at both.

https://en.wikiversity.org/wiki/Numerical_Analysis/Vandermonde_example

https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/05Interpolation/vandermonde/

How are you coming on Vandermonde matrices ? I'd strongly suggest working through the Vandermonde Determinant. Happy to discuss here. For what it's worth it is the only closed form determinant formula that I know by heart. You should be able to see its direct effects in the denominantors of your polynomial interpolation problems.

- - - -
You may be surprised to learn that I had in mind Vandermonde matrices to solve this recent project euler problem posting

there is some very nice intermixing between matrices and computer science, if you know where to look...

• gibberingmouther
How are you coming on Vandermonde matrices ? I'd strongly suggest working through the Vandermonde Determinant. Happy to discuss here. For what it's worth it is the only closed form determinant formula that I know by heart. You should be able to see its direct effects in the denominantors of your polynomial interpolation problems.

- - - -
You may be surprised to learn that I had in mind Vandermonde matrices to solve this recent project euler problem posting