After all this hard work let's look at the functions, namely the Legendre polynomials of degree 0, which is a constant it's a black line; of degree 1, which is a red line; of degree 2, which is the yellow line; of degree 3, which is the green one; 4 is a blue. 