18.01.2015 Views

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

Appunti di Calcolo Numerico - Esercizi e Dispense - Università degli ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3. Interpolazione polinomiale<br />

In x 1 si ha f (x 1 ) = p 2 (x 1 ) = f (x 0 ) + f [x 0 , x 1 ](x 1 − x 0 ).<br />

In x 2 si ha f (x 2 ) = p 2 (x 2 ) = f (x 0 ) + f [x 0 , x 1 ](x 2 − x 0 ) + c 2 (x 2 − x 0 )(x 2 − x 1 ).<br />

Sottraendo membro a membro la prima equazione dalla seconda si ricava:<br />

Quin<strong>di</strong><br />

f (x 2 ) − f (x 1 ) = f [x 0 , x 1 ](x 2 − x 0 − x 1 + x 0 ) + c 2 (x 2 − x 0 )(x 2 − x 1 )<br />

f (x 2 ) − f (x 1 ) = f [x 0 , x 1 ](x 2 − x 1 ) + c 2 (x 2 − x 0 )(x 2 − x 1 )<br />

f (x 2 ) − f (x 1 ) − f [x 0 , x 1 ](x 2 − x 1 ) = c 2 (x 2 − x 0 )(x 2 − x 1 )<br />

f (x 2 ) − f (x 1 )<br />

x 2 − x 1<br />

− f [x 0 , x 1 ] x 2 − x 1<br />

x 2 − x 1<br />

= c 2 (x 2 − x 0 )<br />

Ma f (x 2) − f (x 1 )<br />

x 2 − x 1<br />

f (x 2 ) − f (x 1 )<br />

x 2 − x 1<br />

− f [x 0 , x 1 ] = c 2 (x 2 − x 0 )<br />

= f [x 1 , x 2 ] è la <strong>di</strong>fferenza <strong>di</strong>visa del primo or<strong>di</strong>ne tra x 1 e x 2 da cui<br />

f [x 1 , x 2 ] − f [x 0 , x 1 ] = c 2 (x 2 − x 0 ) =⇒ c 2 = f [x 1, x 2 ] − f [x 0 , x 1 ]<br />

x 2 − x 0<br />

La quantità chiamata c 2 prende il nome <strong>di</strong> <strong>di</strong>fferenza <strong>di</strong>visa del secondo or<strong>di</strong>ne e si in<strong>di</strong>ca con<br />

f [x 0 , x 1 , x 2 ] = f [x 1, x 2 ] − f [x 0 , x 1 ]<br />

x 2 − x 0<br />

.<br />

Facendo le opportune sostituzioni si ricava c 2 = − 4 6 = − 2 3 . Quin<strong>di</strong>, p 2(x) = f (x 0 ) + f [x 0 , x 1 ](x − x 0 ) +<br />

f [x 0 , x 1 , x 2 ](x − x 0 )(x − x 1 ) Nell’esempio considerato: p 2 (x) = 1 + 2(x − 1) − 2 (x − 1)(x − 2)<br />

3<br />

Date le stesse coppie <strong>di</strong> punti, abbiamo visto come cambia la rappresentazione (usando come funzioni<br />

base i monomi, poi i polinomi <strong>di</strong> Lagrange e ora la formulazione <strong>di</strong> Newton) ma il polinomio finale è sempre<br />

lo stesso essendo unico il polinomio interpolatore.<br />

Da questo esempio, si può vedere come la rappresentazione secondo Newton sia <strong>di</strong> tipo ricorsivo: il polinomio<br />

p 1 (x) = f (x 0 ) + f [x 0 , x 1 ](x − x 0 ) (che si ha arrestandosi ai primi due passi del proce<strong>di</strong>mento appena<br />

effettuato) è un polinomio, in tal caso una retta, che interpola i dati (x 0 , y 0 ), e (x 1 , y 1 ). Il polinomio p 2 (x) è dato<br />

dalla somma <strong>di</strong> p 1 (x) e del termine f [x 0 , x 1 , x 2 ](x − x 0 )(x − x 1 ). Quin<strong>di</strong>, una volta determinato il polinomio<br />

p n−1 che interpola i primi n dati, possiamo usare questa rappresentazione per costruire p n che interpola i<br />

dati precedenti cui si aggiunge la coppia (x n , y n ).<br />

Il coefficiente c j del polinomio interpolatore <strong>di</strong> Newton si chiama <strong>di</strong>fferenza <strong>di</strong>visa <strong>di</strong> or<strong>di</strong>ne j e viene<br />

in<strong>di</strong>cata con f [x 0 , x 1 ,..., x j ].<br />

Perciò:<br />

f [x 0 ] = c 0 , f [x 0 , x 1 ] = c 1 , ..., f [x 0 , x 1 ,..., x n ] = c n<br />

La notazione utilizzata ci permette <strong>di</strong> capire anche da quali coppie <strong>di</strong> punti <strong>di</strong>pende il coefficiente c j .<br />

69

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!