#### Throughout this section, we will be representing polynomials as vectors of coefficients, in the usual way in Matlab. The Legendre polyonomials are** a basis for the set of all polynomials, just as the usual monomial powers of are.** They are appropriate for use on the interval [-1,1] because they are orthogonal when considered as members of. The **Legendre** **polynomials** are also special solutions of the so-called **Legendre** differential equation, which often appears in physics and engineering problems when you are using spherical coordinates. **Legendre** spectral methods (all files are zipped: **Legendre**.zip) lepoly.m (evaluate **Legendre polynomial** and its first-order derivative) lepolym.m (evaluate **Legendre polynomials** and their first-order derivatives up to degree n) legs.m (compute **Legendre**-Gauss quadrature nodes and weights) legsndm.m (compute **Legendre**-Gauss points by the eigen-method).

Abstract

**Legendre polynomial**(LP) has found extensive use in solutions of various physical phenomena. The roots of LP up to 44th order can be obtained using the popular and widely available**MATLAB**. My hope was that by using the Chebfun package to compute only the zeroth-order**polynomials**, I would gain some efficiency in the code. As a preliminary test, I simply timed the two functions (i.e.**MATLAB**'s**legendre**.m versus CHEBFUN's legpoly.m) while computing a**Legendre polynomial**of degree 100 over a densely sampled domain of [-1,1]. 20.035577718385575 Julia []. This function computes the points and weights of an N-point Gauss–**Legendre**quadrature rule on the interval (a,b).It uses the O(N 2) algorithm described in Trefethen & Bau, Numerical Linear Algebra, which.vankyo s20 custom rom