# Examples of Lagrange Interpolation

Example No 1: Interpolate the value of the function corresponding to $X = 4$ using Lagrange’s interpolation formula from the following set of data:

 $X$ 2 3 5 8 12 $f\left( X \right)$ 10 15 25 40 60

Solution: Using Lagrange's formula of interpolation, we have

Now simplify the bracketed terms and write them in brackets with their proper sign

Now, count the number of negative signs in the numerator and the denominator of each term. For example, the 1st term contains seven negative signs while the 2nd term contains six negative signs, etc. If the number of negative signs in a term is even (i.e. 0, 2, 4, 6, … etc.), place a positive sign before that term in the next step. If the number of negative signs is odd (i.e. 1, 3, 5, 7, … etc.), place a negative sign before that term in the next step. Once the sign of each term is ascertained, forget the negative signs in each bracket, treating all of them as positive, simplify term by term, and cancel the common factors occurring in the numerator and denominator. Thus,

Hence, the value of the function corresponding to $X = 4$  is $20$.

Example No 2: The population of Mississippi during three census periods was as follows:

 Year: 1951 1961 1971 Population (Million): 2.8 3.2 4.5

Interpolate the population during 1966.

Solution: Using Lagrange's formula of interpolation, we have
$a = 1951,\,\,\,\,\,\,\,b = 1961,\,\,\,\,\,\,\,c = 1971$      $X = 1966$

If we proceed to interpolating with these values we might make a mistake in our calculations. Therefore we should reduce these values by (1) subtracting some values as the origin, e.g., 1951, and (2) if possible, divide each subtracted value by the common factor. We may use either both techniques of reduction or only the 1st one. Thus, subtracting 1951 as the origin and dividing by the common factor 5, the new values are
${a_1} = 0,\,\,\,\,\,\,\,\,\,\,{b_1} = 2,\,\,\,\,\,\,\,\,\,\,{c_1} = 4$         ${X_1} = 3$

Substituting these into Lagrange’s interpolation formula, we get

Hence, the population of Mississippi during 1966 was about 3.74 million.