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.

10. INTEGRAZIONE NUMERICA<br />

Figura 10.1: Formula dei trapezi: l’integrale della funzione f (zona tratteggiata in blu) viene approssimata<br />

me<strong>di</strong>ante l’area del trapezio sotteso alla retta <strong>di</strong> interpolazione per f (a) e f (b) (zona verde).<br />

Quin<strong>di</strong> x − x j = x 0 + sh − (x 0 + j h) = (s − j )h e x i − x j = (i − j )h, da cui il polinomio <strong>di</strong> Lagrange si può<br />

scrivere come<br />

L i (x) =<br />

n∏ s − j<br />

i − j = L i (s)<br />

j =0<br />

j ≠i<br />

Da f (x) = p n (x) + E(x) dove E(x) è l’errore della formula <strong>di</strong> interpolazione, passando all’integrale,<br />

abbiamo<br />

∫ b<br />

a<br />

f (x)d x =<br />

∫ b<br />

a<br />

p n (x)d x +<br />

∫ b<br />

a<br />

E(x)d x<br />

Il primo integrale a secondo membro rappresenta la formula che approssima l’integrale della f mentre il<br />

secondo integrale rappresenta l’errore della formula <strong>di</strong> quadratura.<br />

La formula <strong>di</strong> quadratura è quin<strong>di</strong> data dal valore dell’integrale <strong>di</strong> p n :<br />

∫ b<br />

∫ b n∑<br />

n∑<br />

I = f (x)d x ≈ f (x i )L i (x)d x = f (x i )<br />

a<br />

a<br />

i=0<br />

i=0<br />

∫ b<br />

a<br />

L i (x)d x<br />

La formula <strong>di</strong> quadratura ha dunque come no<strong>di</strong> i punti x i e come pesi gli integrali ∫ b<br />

a L i (x)d x.<br />

Sia x 0 = a e x n = b, tenendo presente che L i (x) = L i (s) con x = x 0 + sh, da cui d x = hd s abbiamo<br />

∫ b<br />

a<br />

∫ xn<br />

L i (x)d x = L i (x)d x =<br />

x 0<br />

Allora<br />

∫ b<br />

n∑<br />

I = f (x)d x ≈ h f (x i )<br />

a<br />

i=0<br />

∫ n<br />

0<br />

∫ n<br />

0<br />

L i (s)hd s = h<br />

L i (s)d s<br />

∫ n<br />

0<br />

L i (s)d s<br />

144

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

Saved successfully!

Ooh no, something went wrong!