4.1 Rudiments of Numerical Calculus

In 3.2 Lagrange Polynomials and 3.3 Newton Polynomials, we labelled the nodes of an interpolating function x0,x1,,xn. It will be beneficial to begin calling them x0+θ0h,x0+θ1h,,x0+θnh instead.

To see how this helps with the analysis, consider the degree at most 2 interpolating polynomial of f with nodes

x0+θ0h,x0+θ1h,andx0+θ2h.

3.2 Lagrange Polynomials gives us:

P2(x)=(xx1)(xx2)(x0x1)(x0x2)f(x0)+(xx0)(xx2)(x1x0)(x1x2)f(x1)+(xx0)(xx1)(x2x0)(x2x1)f(x2),

but with the new notation, we replace x0 by x0+θ0h, x1 by x0+θ1h, x2 by x0+θ2h, and x by x0+θh, giving us

P2(x0+θh)=(θθ1)(θθ2)(θ0θ1)(θ0θ2)f(x0+θ0h)+(θθ0)(θθ2)(θ1θ0)(θ1θ2)f(x0+θ1h)+(θθ0)(θθ1)(θ2θ0)(θ2θ1)f(x0+θ2h).

Stencils

Pasted image 20250313224957.webp|289

f(x016h)P2=(16)2+162f(x016h)+(1(16)2)f(x0)+(16)216bf(x0+16h)=7f(x016h)+70f(x0)5f(x0+16h)72

Not Evenly Spaced

Pasted image 20250313225508.webp|308
Deriving P2(x0) gives us:

θ=0,θ0=1,θ1=13,θ2=1P2(x0)=(13)(1)(43)(2)f(x0h)+(1)(1)(43)(23)f(x0+13h)+(1)(13)(2)(23)f(x0+h)=f(x0h)+9f(x0+13h)2f(x0+h)8

Derivatives

Example: Want P2(x016h)
Over:
Pasted image 20250314131432.webp

We can think of x as a function of θ where x=x0+hθ, so ddθx=h
Using chain rule ddθP2(θ)=ddxP2(x)ddθx=hddxP2(x)

ddxP2(x)=ddθP2(θ)h=(θθ1)+(θθ2)h(θ0θ1)(θ0θ2)f(x0+θ0h)+(θθ0)+(θθ2)h(θ1θ0)(θ1θ2)f(x0+θ1h)+(θ.θ0)+(θθ1)h(θ2θ0)(θ2θ1)f(x0+θ2h)

Based on the stencil θ0=1,θ1=0,θ2=1,θ=16

P2(x016h)=1676h(1)(2)f(x0h)+5676h(1)(1)f(x0)+5616h(2)(1)f(x0+h)=2f(x0h)+f(x0)+f(x0+h)3h.

If we did x0:

P2(x0)=1h(1)(2)f(x0h)+1+(1)h(1)(1)f(x0)+1h(2)(1)f(x0+h)=f(x0+h)f(x0h)2h,

Integrals

Pasted image 20250314133532.webp|477

x0+2.5hx0+6hf(x)dxh138240[42056f(x0+6h)+201831f(x0+5h)+63357f(x0+4h)+195902f(x0+3h)28518f(x0+2h)+10731f(x0+h)1519f(x0)].

Pasted image 20250314133803.webp|474

x0hx0+6hf(x)dxh8640[5257f(x0+6h)5880f(x0+5h)+59829f(x0+4h)81536f(x0+3h)+102459f(x0+2h)50568f(x0+h)+30919f(x0)].