Skip to main content

Lagrange: y at x = 3.0

Short answer

Using Lagrange interpolation, y(3.0)=20.2672. Sum of products yᵢ·Lᵢ(3.0) with coefficients L₀=0.664773, L₁=0.361634, L₂=−0.004295, L₃=−0.030545, L₄=0.008433.

Use Lagrange's Interpolation formula to find the value of y when x = 3.0, from the following table.

x3.22.71.04.85.6
y22.017.814.238.351.7

The x values are unequally spaced and unordered, so Lagrange's formula is the right tool:

y(x) = Σ yᵢ·Lᵢ(x), Lᵢ(x) = Π (x − xⱼ)/(xᵢ − xⱼ) (j ≠ i)

Data: x₀ = 3.2, x₁ = 2.7, x₂ = 1.0, x₃ = 4.8, x₄ = 5.6 with y = 22.0, 17.8, 14.2, 38.3, 51.7. Required x = 3.0.

Lagrange coefficients at x = 3.0

For example L₀(3) = [(3−2.7)(3−1.0)(3−4.8)(3−5.6)] / [(3.2−2.7)(3.2−1.0)(3.2−4.8)(3.2−5.6)] = (0.3)(2.0)(−1.8)(−2.6) / (0.5)(2.2)(−1.6)(−2.4) = 2.808/4.224 = 0.664773.

TermNumerator Π(3 − xⱼ)Denominator Π(xᵢ − xⱼ)Value
L0(3)(0.3) × (2.0) × (-1.8) × (-2.6)(0.5) × (2.2) × (-1.6) × (-2.4)0.664773
L1(3)(-0.2) × (2.0) × (-1.8) × (-2.6)(-0.5) × (1.7) × (-2.1) × (-2.9)0.361634
L2(3)(-0.2) × (0.3) × (-1.8) × (-2.6)(-2.2) × (-1.7) × (-3.8) × (-4.6)-0.004295
L3(3)(-0.2) × (0.3) × (2.0) × (-2.6)(1.6) × (2.1) × (3.8) × (-0.8)-0.030545
L4(3)(-0.2) × (0.3) × (2.0) × (-1.8)(2.4) × (2.9) × (4.6) × (0.8)0.008433

Sum

iyᵢLᵢ(3.0)yᵢ·Lᵢ(3.0)
022.00.66477314.6250
117.80.3616346.4371
214.2-0.004295-0.0610
338.3-0.030545-1.1699
451.70.0084330.4360
Sum20.2672

Check: ΣLᵢ = 1.000000 (must equal 1).

Answer: y(3.0) ≈ 20.2672

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 4 questions →