Write a Python code that applies the Newton divided difference algorithm for interpolation for the below function and in the specified interval. Please do all steps including comments for task 6.
tanh^(-1)[-1,1]
1. (2.5 points) Initially choose 6 points (N = 6) including both lower and upper limits of the interval {}. Then evaluate the original function f on these points. For example, if your interval is [0,5], then your points will be {0,1,2,3,4,5}.
2. (2.5 points) Use newton_interpolation to obtain the interpolated polynomial P using {f} you obtained above.
3. (2.5 points) Use evaluate_newton_interpolation to evaluate both the original function f and the polynomial P on a much finer grid, say X = np.linspace(x_l, x_u, 1000, endpoint=True), where x_l and x_u are the lower and upper limits of your interval.
4. (2.5 points) Plot both f and P on this finer grid: i.e., against x. Also plot f - P against x. Don't forget to put labels on the x and y axis of your plot, and add legends as well.
5. (10 points) Repeat the tasks 1-4 with N = 12.
6. (5 points) Give useful comments about these simulations.