Exercicis de Mètode Lagrange

Determina el valor de $$f\Big( \dfrac{\pi}{3}\Big) $$ on $$f(x)= \sin(x)$$ sabent els següents valors de la funció:

$$x$$ $$0$$ $$\dfrac{\pi}{6}$$ $$\dfrac{\pi}{2}$$
$$\sin(x)$$ $$0$$ $$\dfrac{1}{2}$$ $$1$$

i dóna una cota de l'error.

Veure desenvolupament i solució

Desenvolupament:

Tenim $$n +1 = 3$$ punts, per tant $$n = 2$$. El polinomi de Lagrange s'escriu:

$$ \begin{array}{rl} P_2(x) =& f_0\cdot l_0(x)+f_1\cdot l_1(x)+f_2\cdot l_2(x) \\ =& 0\cdot l_0(x)+\dfrac{1}{2}\cdot l_1(x)+\dfrac{1}\cdot l_2(x)= \dfrac{1}{2}\cdot l_1(x)+l_2(x) \end{array} $$

Calculem $$l_1(x)$$ i $$l_2(x)$$:

$$$ \begin{array}{rl} l_1(x)=& \dfrac{(x-x_0)\cdot(x-x_2)}{(x_1-x_0)\cdot(x_1-x_2)} = \dfrac{(x-0)\cdot(x-\dfrac{\pi}{2})}{(\dfrac{\pi}{6}-0)\cdot(\dfrac{\pi}{6}-\dfrac{\pi}{2})} \\ =& \dfrac{x^2-\dfrac{\pi}{2}x}{\dfrac{\pi}{6}\cdot\big(\dfrac{-\pi}{3})}= -\dfrac{18}{\pi^2}x^2+\dfrac{9}{\pi}x \\ l_2(x) =& \dfrac{(x-x_0)\cdot(x-x_1)}{(x_2-x_0)\cdot(x_2-x_1)} = \dfrac{(x-0)\cdot(x-\dfrac{\pi}{6})}{(\dfrac{\pi}{2}-0)\cdot(\dfrac{\pi}{2}-\dfrac{\pi}{6})} \\ =& \dfrac{x^2-\dfrac{\pi}{6}x}{\dfrac{\pi}{2}\cdot\big(\dfrac{\pi}{3})}= \dfrac{6}{\pi^2}x^2-\dfrac{1}{\pi}x \end{array} $$$

Substituint els valors trobats:

$$$ \begin{array}{rl} P_2(x)=&\dfrac{1}{2}\cdot l_1(x)+l_2(x)= \dfrac{1}{2}\cdot\Big( -\dfrac{18}{\pi^2}x^2+\dfrac{9}{\pi}x \Big) + \dfrac{6}{\pi^2}x^2-\dfrac{1}{\pi}x \\ =& -\dfrac{9}{\pi^2}x^2+\dfrac{9}{2\pi}x + \dfrac{6}{\pi^2}x^2-\dfrac{1}{\pi}x = -\dfrac{3}{\pi^2}x^2+\dfrac{7}{2\pi}x \end{array} $$$

D'aquesta manera:

$$$\sin\Big( \dfrac{\pi}{3} \Big) = f\Big( \dfrac{\pi}{3} \Big) \approx P_2 \Big( \dfrac{\pi}{3} \Big) = \dfrac{5}{6}=0.8333\dots$$$

Per calcular la cota de l'error, ens cal saber $$f^{(n+1)}(x)=f^{(3)}(x)$$. En el nostre cas,

$$$f^{(3)}(x)=-\cos(x) \Rightarrow |f^{(3)}(x)|=|\cos(x)|\leqslant 1$$$

Per tant:

$$$\Big| f\Big( \dfrac{\pi}{3} \Big) - P_2 \Big( \dfrac{\pi}{3} \Big) \Big| \leqslant \dfrac{1}{6}\cdot \dfrac{\pi}{3}\cdot \dfrac{\pi}{6}\cdot \dfrac{\pi}{6} = \dfrac{\pi}{648}=0.047 \leqslant 0.5 \cdot 10^{-1}$$$

Solució:

$$\sin\Big( \dfrac{\pi}{3} \Big) =0.8333 \quad$$ i $$\quad |\text{error}|\leqslant 0.05$$

Amagar desenvolupament i solució
Veure teoria