This question is meant to be answered in Python 35 PLEASE ON
This question is meant to be answered in Python 3.5. PLEASE ONLY ANSWER IF YOU HAVE THE CODE REQUIRED.
The following is the procedure provided. I just need help constructing my python codes to do the following.
Use \"import numpy.polynomial.legendre as lpoly\" to load the module for working with Legendre polynomials.
1) plot the first 5 legendre polynomials between -1 and +1
2) use \"scipy.optimize.brentq\" to determine the zeros of the 5th order Legendre polynomial
3) write a function to find zeros using the \"secant method\" as described in https://en.wikipedia.org/wiki/Secant_method. This is essentially the same as Newton\'s method, but uses a discrete approximation for the derivative.
4) apply your function to determine the zeros of the 5th order Legendre polynomial
Solution
1.) import scipy.special as sp
sp.legendre(2)
poly1d([ 1.5, 0. , -0.5])
sp.legendre(2)(np.linspace(-1,1,5))
2.)
3.)
