Subjects algebra

Lagrange Interpolation 240211

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **Problem Statement:** Given the points $(-2,3)$, $(0,-1)$, $(1,1)$, and $(2,5)$, find the Lagrange interpolation polynomial $L(x)$ that passes through these points. 2. **Formula:** The Lagrange interpolation polynomial is given by $$L(x) = \sum_{i=0}^n y_i \cdot l_i(x)$$ where $$l_i(x) = \prod_{j=0, j \neq i}^n \frac{x - x_j}{x_i - x_j}$$ Each $l_i(x)$ is the Lagrange basis polynomial. 3. **Calculate each basis polynomial:** - For $i=0$, $x_0 = -2$, $$l_0(x) = \frac{x - 0}{-2 - 0} \cdot \frac{x - 1}{-2 - 1} \cdot \frac{x - 2}{-2 - 2} = \frac{x}{-2} \cdot \frac{x - 1}{-3} \cdot \frac{x - 2}{-4}$$ - For $i=1$, $x_1 = 0$, $$l_1(x) = \frac{x + 2}{0 + 2} \cdot \frac{x - 1}{0 - 1} \cdot \frac{x - 2}{0 - 2} = \frac{x + 2}{2} \cdot \frac{x - 1}{-1} \cdot \frac{x - 2}{-2}$$ - For $i=2$, $x_2 = 1$, $$l_2(x) = \frac{x + 2}{1 + 2} \cdot \frac{x - 0}{1 - 0} \cdot \frac{x - 2}{1 - 2} = \frac{x + 2}{3} \cdot x \cdot \frac{x - 2}{-1}$$ - For $i=3$, $x_3 = 2$, $$l_3(x) = \frac{x + 2}{2 + 2} \cdot \frac{x - 0}{2 - 0} \cdot \frac{x - 1}{2 - 1} = \frac{x + 2}{4} \cdot \frac{x}{2} \cdot (x - 1)$$ 4. **Simplify each basis polynomial:** - $l_0(x) = \frac{x}{-2} \cdot \frac{x - 1}{-3} \cdot \frac{x - 2}{-4} = \frac{x(x - 1)(x - 2)}{-2 \cdot -3 \cdot -4} = \frac{x(x - 1)(x - 2)}{-24}$ - $l_1(x) = \frac{x + 2}{2} \cdot \frac{x - 1}{-1} \cdot \frac{x - 2}{-2} = \frac{(x + 2)(x - 1)(x - 2)}{2 \cdot (-1) \cdot (-2)} = \frac{(x + 2)(x - 1)(x - 2)}{4}$ - $l_2(x) = \frac{x + 2}{3} \cdot x \cdot \frac{x - 2}{-1} = -\frac{(x + 2) x (x - 2)}{3}$ - $l_3(x) = \frac{x + 2}{4} \cdot \frac{x}{2} \cdot (x - 1) = \frac{(x + 2) x (x - 1)}{8}$ 5. **Construct the polynomial:** $$L(x) = 3 \cdot l_0(x) + (-1) \cdot l_1(x) + 1 \cdot l_2(x) + 5 \cdot l_3(x)$$ 6. **Substitute and expand:** $$L(x) = 3 \cdot \frac{x(x - 1)(x - 2)}{-24} - \frac{(x + 2)(x - 1)(x - 2)}{4} - \frac{(x + 2) x (x - 2)}{3} + 5 \cdot \frac{(x + 2) x (x - 1)}{8}$$ 7. **Simplify coefficients:** $$L(x) = -\frac{1}{8} x(x - 1)(x - 2) - \frac{1}{4} (x + 2)(x - 1)(x - 2) - \frac{1}{3} (x + 2) x (x - 2) + \frac{5}{8} (x + 2) x (x - 1)$$ 8. **Expand each term:** - $x(x - 1)(x - 2) = x(x^2 - 3x + 2) = x^3 - 3x^2 + 2x$ - $(x + 2)(x - 1)(x - 2) = (x + 2)(x^2 - 3x + 2) = x^3 - 3x^2 + 2x + 2x^2 - 6x + 4 = x^3 - x^2 - 4x + 4$ - $(x + 2) x (x - 2) = x(x + 2)(x - 2) = x(x^2 - 4) = x^3 - 4x$ - $(x + 2) x (x - 1) = x(x + 2)(x - 1) = x(x^2 + x - 2) = x^3 + x^2 - 2x$ 9. **Substitute back:** $$L(x) = -\frac{1}{8}(x^3 - 3x^2 + 2x) - \frac{1}{4}(x^3 - x^2 - 4x + 4) - \frac{1}{3}(x^3 - 4x) + \frac{5}{8}(x^3 + x^2 - 2x)$$ 10. **Distribute coefficients:** $$L(x) = -\frac{1}{8}x^3 + \frac{3}{8}x^2 - \frac{1}{4}x - \frac{1}{4}x^3 + \frac{1}{4}x^2 + x - 1/1 - \frac{1}{3}x^3 + \frac{4}{3}x + \frac{5}{8}x^3 + \frac{5}{8}x^2 - \frac{5}{4}x$$ 11. **Combine like terms:** - $x^3$ terms: $-\frac{1}{8} - \frac{1}{4} - \frac{1}{3} + \frac{5}{8} = -\frac{1}{8} - \frac{2}{8} - \frac{8}{24} + \frac{15}{24} = (-\frac{3}{8}) + (\frac{7}{24}) = -\frac{9}{24} + \frac{7}{24} = -\frac{2}{24} = -\frac{1}{12}$ - $x^2$ terms: $\frac{3}{8} + \frac{1}{4} + \frac{5}{8} = \frac{3}{8} + \frac{2}{8} + \frac{5}{8} = \frac{10}{8} = \frac{5}{4}$ - $x$ terms: $-\frac{1}{4} + 1 + \frac{4}{3} - \frac{5}{4} = (-\frac{1}{4} - \frac{5}{4}) + 1 + \frac{4}{3} = -\frac{6}{4} + 1 + \frac{4}{3} = -\frac{3}{2} + 1 + \frac{4}{3} = (-\frac{3}{2} + 1) + \frac{4}{3} = -\frac{1}{2} + \frac{4}{3} = \frac{-3 + 8}{6} = \frac{5}{6}$ - Constant term: $-1$ 12. **Final polynomial:** $$L(x) = -\frac{1}{12} x^3 + \frac{5}{4} x^2 + \frac{5}{6} x - 1$$ This polynomial passes through all given points. **Answer:** $$\boxed{L(x) = -\frac{1}{12} x^3 + \frac{5}{4} x^2 + \frac{5}{6} x - 1}$$