We have the function : $f(x)=\cos(x) + \sin(x)$ and $x_0=0$, $x_1=0.25$ , $x_2=0.5$, $x_3=1$
a)Find Lagrange polynomial for this function.
So $L_3(x)=f_0(x) l_0(x)+f_1(x) l_1(x)+f_2(x) l_2(x)+f_3(x) l_3(x)$
$f_0=\sin0+\cos0=1$, $f_1=\sin0.25+\cos0.25=(0.999992289+0.00392698)=1.0039$
$f_2= 0.999969157+0.0078539= 1.0078$, $f_3=0.0151707+0.9998766=1.0015$
I have also found $l_0$, $l_1$, $l_3$, $l_4$ but they are too long and I cant write them here.
So my Lagrange polynomial is $-0.014 x^3 -5.974 x^2 +1.3068 x +5.7$
$b)$ Find the real approximation error.
$C)$ Find the limit of the maximum error in $[x_0;x_3]$
The problem with b and c is that I dont know where to use this formula : https://i.stack.imgur.com/MmSmL.jpg
My intuition tells me I should use this in c.But how do find b)?
EDIT : So,instead of calculating in radians,I calculated in degree.But still this just changes a number,nothing big.I still need to know b) and c)