202011051527 Exercise 1 (Q1)

If f(x)=2x^2-4x+1, find the values of f(1), f(0), f(2), f(-2), f(a), f(x+\delta x).


Solution.

Given f(x)=2x^2-4x+1.

\begin{aligned} f(1) & =2(1)^2-4(1)+1=-1 \\ f(0) & = 2(0)^2 - 4(0) +1 = 1 \\ f(2) & = 2(2)^2-4(2)+1 =1 \\ f(-2) & = 2(-2)^2-4(-2)+1=17\\ f(a) & = 2a^2 - 4a +1 \\ f(x+\delta x) & = 2(x+\delta x)^2 - 4 (x+\delta x) +1 \end{aligned}

This exercise is done.


On reflection.

Suppose you are given the following conditions:

\begin{aligned} x_0 = 0 & \qquad f(x_0) = 1 \\ x_1 = 1 &\qquad  f(x_1) = -1 \\ x_2 = 2 &\qquad f(x_2) =1 \end{aligned}

and you are asked to interpolate by Lagrange polynomials over the range [0,2].

\begin{aligned} \mathcal{L}(x)  & = (1)\bigg( \displaystyle{\frac{x-1}{0-1}} \bigg)\bigg( \displaystyle{\frac{x-2}{0-2}} \bigg) +  (-1)\bigg( \displaystyle{\frac{x-0}{1-0}} \bigg) \bigg( \displaystyle{\frac{x-2}{1-2}} \bigg) + (1)\bigg( \displaystyle{\frac{x-0}{2-0}} \bigg) \bigg( \displaystyle{\frac{x-1}{2-1}} \bigg) \\ & = \displaystyle{\frac{(x-1)(x-2)}{2}} + x(x-2) + \displaystyle{\frac{x(x-1)}{2}} \\ & = \displaystyle{\frac{(x-1)(x-2)+2x(x-2)+x(x-1)}{2}} \\ & = \displaystyle{\frac{x^2-3x+2+2x^2-4x+x^2-x}{2}} \\ & = \displaystyle{\frac{4x^2-8x+2}{2}} \\ & = 2x^2-4x+1\\ \end{aligned}

The interpolating polynomial \mathcal{L}(x) checks with the original function f(x).