Task 05

Task 05ΒΆ

deadline: 28/03/2021 23:59 CET

[0.5 points]: Approximate the function

\[\begin{split} f(x) = \begin{cases} -1 & \text{if $ x \leq 5 $} \\ 1 & \text{if $ x > 5 $} \end{cases} \end{split}\]

in the \( [0, 10] \) interval with the Lagrange interpolating polynomial using the roots of the \( 10 \)-th degree Chebyshev polynomial (you may use the scipy.interpolate.lagrange and scipy.special.roots_chebyt functions). Print the interpolating polynomial.

[0.5 points]: Plot the function \( f(x) \), the interpolating polynomial, and the absolute error of the approximation.

# add your code here