# Nodes and Weights of Gauss-Legendre

## Calculates the nodes and weights of the Gauss-Legendre integration.

 $\normal{\large\int_{\small -1}^{\hspace{25}\small 1}}f(x)dx\simeq{\large\sum_{\small i=1}^{n}}w_{i}f(x_i)\\\ nodes\hspace{30} x_i:\hspace{10} P_n(x_i)=0\\\ weights\hspace{15} w_i={\large\frac{2(1-x^2)}{n[P_{n-1}(x)]^2}}={\large \frac{-2}{[P_n^1(x_i)]^2}\\$
nodes
 half(x>=0) all
order n
 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 n=2,3,4,..,100

i xi wi

 $\normal\ i=1,2,...,n\\(1)\ x_{i0}=\left(1-{\large\frac{n-1}{8n^3}}\right)cos(\frac{4i-1}{4n+2}\pi)\\(2)\ solve\ x_i\hspace{20}P_n(x_i)=0\\ \hspace{15}Halley's\ method\hspace{10}x\leftarrow x-{\large\frac{2yy^'}{2[y^']^2-yy^{''}}}\\ \hspace{20}y^'=P^'_n(x)={\large\frac{n(P_{n-1}(x)-xP_n(x))}{1-x^2}}\\ \hspace{20}y^{''}=P^{''}_n(x)={\large\frac{2xP^'_n(x)-n(n+1)P_n(x)}{1-x^2}}\\[10](3)\ w_i={\large\frac{2(1-x^2)}{n[P_{n-1}(x)]^2}}={\large \frac{-2}{[P_n^1(x_i)]^2}\\$

To improve this library, please fill in questionnaire.

Gender
Male Female
Age
Under 20 years old 20 years old level 30 years old level
40 years old level 50 years old level 60 years old level or over
Occupation
Elementary school/ Junior high-school student
High-school/ University/ Grad student A homemaker An office worker / A public employee
Self-employed people An engineer A teacher / A researcher Others
Useful?
Very A little Not at All
Purpose of use?