Lagrange polynomials are used in the method of interpolation of polynomials. Lagrange polynomial is said to be a polynomial if a set of points $x_{i}s$ is given and $y_{j}s$ be their corresponding values, in such a way that the polynomial has least degree. Thus, we can say that the functions at each point coincide. This interpolating polynomial has to be unique, so that it is said to have “Lagrange form”. It was named after the mathematician who published it in 1795, Joseph Louis Lagrange. Though, it was first discovered by Edward Waring in 1779.

Lagrange interpolation is based on the fact that if interpolation points are changed, the entire interpolation process must be recalculated. In this case, the Newton polynomials are much susceptible. We are going to go ahead in this article and understand about Lagrange polynomial in detail.

## Lagrange Polynomial Definition

We are given k + 1 points, say $(x_{0}, y_{0})$, $(x_{1}, y_{1})$, …, $(x_{i}, y_{i})$, …, $(x_{k}, y_{k})$. No two $x_{i}’s$ are same. Then, the Lagrange interpolating polynomial is the linear combination -

$L (x)$ = $\sum_{(i = 0)}^{k}\ [y_{i}\ l_{i}\ (x)]$ of the Lagrange basis polynomials

Where, $l_{i}\ (x)$ = $\pi_{( m\ \neq\ I,\ 0\ <=\ m\ <=\ k)}$ $[\frac{(x – x_{m})}{(x_{i} – x_{m})}]$

= $\frac{(x – x_{0})}{(x_{i} – x_{0})}$$\frac{(x – x_{(i – 1)})}{(x_{i} – x_{(i – 1)})}$ $\frac{(x – x_{(i + 1)})}{(x_{i} – x_{(i + 1)})}$ … $\frac{(x – x_{k})}{(x_{i} – x_{k})}$

Here, $0\ <=\ i\ <= k$.

## Lagrange Polynomial Properties

The Lagrange interpolation polynomial and Lagrange basis has the following properties:

1) They all are the l_k polynomials that satisfy the property that $l_{k}\ (x_{i})\ =\ d_{(ki)}$, which is further equal to 1 if $i\ =\ k$ and equals $0$ if $i\ \neq\ k$, for all, $i\ =\ 0,\ 1,\ ….,\ n$.

2) They all form a basis for the vector space $P_{n}$ which are polynomials with highest possible degree equal to n, that is, $\sum_{(k = 0)}^{n}$ $[a_{k}\ l_{k}\ (x)]\ =\ 0$.

Now when we take $x\ =\ x_{i}$, we will get $\sum_{(k = 0)}^{n}$ $[a_{k}\ l_{k}\ (x_{i})]$ = $\sum_{(k = 0)}^{n}$ $[a_{k}\ d_{(ki)}]\ =\ 0$, which implies that $a_{i}\ =\ 0$.

The set is now linearly independent and is consisting clearly of $n\ +\ 1$ vectors, which thus, forms the basis of $P_{n}$.

## Lagrange Polynomial Derivative

We know that the derivative of a constant is zero, the derivative of a polynomial of degree 1 will be a constant and the polynomial of a degree n > 1 is always a polynomial of degree (n – 1).

The Lagrange basis polynomials is given as :

$l_{i}\ (x)\ =\ \pi_{( m\ \neq\ i,\ 0\ <=\ m\ <=\ k)}$ $[\frac{(x – x_{m})}{(x_{i} – x_{m})}]$

Then, the first derivative in elementary sense will be :

$l’_{i}\ (x)\ =\ l_{i}\ (x)\ \pi_{( m\ \neq\ i)}$ $[\frac{1}{(x_{m}\ –\ x_{i})}]$

## How to Solve Lagrange Polynomial

Suppose the function f is tabulated to n + 1, but it is not necessary that the points are equidistant and approximated by the polynomial given as

$P_{n}\ (x)\ =\ c_{n}\ x^{n}\ +\ c_{(n – 1)}\ x^{(n – 1)}\ +\ …\ +\ c_{1}\ x\ +\ c_{0}$, with maximum possible degree to be n in such a manner that

$f_{i}\ =\ f\ (x_{i})\ =\ P_{n}\ (x_{i})$ for $i\ =\ 0,\ 1,\ …,\ n$.

Now, $L_{k}\ (x)$ = $\frac{[(x – x_{0})\ (x – x_{1})\ …\ (x – x_{(k – 1)})\ (x – x_{(k + 1)}0) … (x – x_{n})]}{[(x_{k}\ –\ x_{0})\ (x_{k}\ –\ x)1)\ …\ (x_{k}\ –\ x_{(k – 1)})\ (x_{k}\ –\ x_{(k + 1)})\ …\ (x_{k}\ –\ x_{n})]}$

is a polynomial of degree n for $k\ =\ 0,\ 1,\ …,\ n,$ that is satisfying $L_{k}\ (x_{i})\ =\ 0$, when $i\ \neq\ k$ and $L_{k}\ (x_{k})\ =\ 1$,

then, $P_{n}\ (x)$ = $\sum_{(k = 0)}^{n}\ L_{k}\ (x)\ f_{k}$ will be a polynomial whose degree can be maximum n in such a manner that $P_{n}\ (x_{i})\ =\ f_{i}$,

for $i\ =\ 0,\ 1,\ …,\ n$, which is a unique polynomial of interpolation.

## Lagrange Polynomial Error

If we have $x_{0},\ x_{1},\ x_{2},\ …,\ x_{n}$ distinct numbers lying in the interval $[m, n]$ and $f\ \epsilon\ C^{(n + 1)}\ [m, n]$, then for every $x$ in the interval $[m, n]$ a number $e\ (x)$ which is mostly unknown lying between $x_{0},\ x_{1},\ x_{2},\ …,\ x_{n}$ and thus lying in the interval $(m, n)$, exists, satisfying the condition

$f\ (x)\ =\ P\ (x)$ + $[\frac{[f^{(n + 1)}\ (\epsilon\ (x))]}{(n + 1)!}]$ $(x\ –\ x_{0})\ (x\ –\ x_{1})\ (x\ –\ x_{2})\ …\ (x\ –\ x_{n})$

here, $P\ (x)$ is the interpolating polynomial and is defined as

$P\ (x)\ =\ f\ (x_{0})\ L_{(n,0)}\ (x)\ +\ f\ (x_{1})\ L_{(n,1)}\ (x)\ +\ …\ +\ f\ (x_{n})\ L_{(n,n)}\ (x)$

$\Rightarrow\ P\ (x)\ =\ \sum_{(k = 0)}^{n}\ f\ (x_{k})\ L_{(n,k)}\ (x)$

## Lagrange Polynomial Example

Find the interpolating polynomial $P_{3}$ which passes through the points $(0,\ 3),\ (1,\ 2),\ (2,\ 7)$ and $(4,\ 59)$. Approximate it to find the value of $f\ (3)$ by $P_{3}\ (3)$.

Solution:

The coefficients of Lagrange are

$L_{0}\ (x)$ = $\frac{(x – 1)\ (x – 2)\ (x – 4)}{[(0 – 1)\ (0 – 2)\ (0 – 4)]}$ = $\frac{-1}{8}$ $[x^{3}\ –\ 7\ x^{2}\ +\ 14\ x\ –\ 8]$

Similarly, $L_{1}\ (x)$ = $\frac{1}{8}$ $[x^{3}\ –\ 6\ x^{2}\ +\ 8x]$

$L_{2}\ (x)$ = $\frac{-1}{4}$ $[x^{3}\ –\ 5\ x^{2}\ +\ 4x]$

And $L_{3}\ (x)$ = $\frac{1}{24}$ $[x^{3}\ –\ 3x^{2}\ +\ 2x]$

We can clearly see that $L_{0}\ (x)\ +\ L_{1}\ (x)\ +\ L_{2}\ (x)\ +\ L_{3}\ (x)\ =\ 1$.

Thus, the required polynomial is now,

$P_{3}\ (x)\ =\ 3\ L_{0}\ (x)\ +\ 2\ L_{1}\ (x)\ +\ 7\ L_{2}\ (x)\ +\ 59\ L_{3}\ (x)$

$\Rightarrow\ P_{3}\ (x)$ = $\frac{-3}{8}$ $[x^{3}\ –\ 7\ x^{2}\ +\ 14\ x\ –\ 8]$ + $\frac{1}{4}$ $[x^{3}\ –\ 6\ x^{2}\ +\ 8x]$ – $\frac{7}{4}$ $[x^{3}\ –\ 5\ x^{2}\ +\ 4x]$ + $\frac{59}{24}$ $[x^{3}\ –\ 3\ x^{2}\ +\ 2x]$

$\Rightarrow\ P_{3}\ (x)\ =\ x^{3}\ –\ 2\ x\ +\ 3$

Therefore, $P_{3}\ (3)\ =\ 3^{3}\ +\ 2\ (3)\ +\ 3\ =\ 24$.