User:Egm6321.f09.Team1.andy/HW6

= Problem 13: Legendre Polynomials' Orthogonality = From lecture slide 34-2

Given
Consider the boundary condition
 * {| style="width:100%" border="0" align="left"

\psi(1,\theta) = f(\theta) = T_0 \cos \theta $$ $$ where
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 1)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

f(\mu) = T_0 \sqrt{1 - \mu^2} $$ $$ is even, and
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 2)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

\mu = \sin \theta $$ $$ Eq. 5 from lecture slide 33-2
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 3)
 * }
 * }
 * {| style="width:100%" border="0" align="left"

A_n = \frac{2n + 1}{2}  $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 4)
 * }
 * }

Find
1. Without calculation, find property of $$\displaystyle A_n$$, i.e.
 * {| style="width:100%" border="0" align="left"

\begin{cases} A_{2k} = 0 \\ A_{2k+1} = 0 \end{cases} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle (Eq. 5)
 * }
 * }

2. Compute 3 non-zero coefficients of $$\displaystyle A_n$$

2a. Analytical, using either $$\displaystyle \theta$$ or $$\displaystyle \mu$$ as integrating variable

2b. Numerically, using Gauss-Legendre, accurately within $$\displaystyle 5\%$$

Solution
2.

2a.

The expression for $$\displaystyle A_n $$ is given by,


 * {| style="width:100%" border="0" align="left"

\begin{align} A_n & = \frac{2n+1}{2} \int_{-\pi/2}^{\pi/2} f(\theta)P_n(\sin\theta)d(\sin\theta) \\ & = \frac{2n+1}{2} \int_{-1}^{1} f(\mu)P_n(\mu)d\mu \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

where $$\displaystyle \mu = \sin\theta $$ and $$\displaystyle f(\mu) = T_0 \sqrt{1-\mu^2} $$.

$$\displaystyle A_n = 0 $$ for odd values of $$\displaystyle n $$.

(i.) When $$\displaystyle n = 0 $$, we know $$\displaystyle P_n(\mu) = 1 $$ and so,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

A_0 = \frac{2(0)+1}{2} \int_{-1}^{1} T_0 \sqrt{1-\mu^2} d\mu

$$ $$
 * $$\displaystyle (Eq. 12)


 * }.
 * }.

Using definite integrals in Matlab, we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\int_{-1}^{1} \sqrt{1-\mu^2} d\mu = \left[ \frac{\pi}{2} \right]

$$ $$
 * $$\displaystyle (Eq. 13)


 * }.
 * }.

Substituting equation (13) in (12),


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow A_0 = \frac{T_0}{2} \left[ \frac{\pi}{2} \right]

$$
 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_0 = \frac{\pi T_0}{4}

$$ $$
 * style= |
 * $$\displaystyle (Eq. 14)
 * }.
 * }.

(ii.) When $$\displaystyle n = 2 $$, we know $$\displaystyle P_n(\mu) = \frac{1}{2} (3

\mu^2 - 1) $$ and so,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

A_2 = \frac{2(2)+1}{2} \int_{-1}^{1} T_0 \sqrt{1-\mu^2} \left[\frac{1}{2} (3\mu^2 - 1) \right]d\mu

$$ $$
 * $$\displaystyle (Eq. 15)


 * }.
 * }.

Using definite integrals in Matlab, we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\int_{-1}^{1} \sqrt{1-\mu^2}\left[\frac{1}{2} (3\mu^2 - 1) \right] d\mu = \left[ \frac{-\pi}{16} \right]

$$ $$
 * $$\displaystyle (Eq. 16)


 * }.
 * }.

Substituting equation (16) in (15),


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow A_2 = \frac{5T_0}{2} \left[ \frac{-\pi}{16} \right]

$$
 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_2 = \frac{-5\pi T_0}{32}

$$ $$
 * style= |
 * $$\displaystyle (Eq. 17)
 * }.
 * }.

(iii) When $$\displaystyle n = 4 $$, we know $$\displaystyle P_n(\mu) = \frac{35}{8} \mu^4 - \frac{15}{4} \mu^2 + \frac{3}{8} $$ and so,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

A_4 = \frac{2(2)+1}{2} \int_{-1}^{1} T_0 \sqrt{1-\mu^2} \left[\frac{35}{8} \mu^4 - \frac{15}{4} \mu^2 + \frac{3}{8} \right]d\mu

$$ $$
 * $$\displaystyle (Eq. 18)


 * }.
 * }.

Using definite integrals in Matlab, we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\int_{-1}^{1} \sqrt{1-\mu^2}\left[\frac{35}{8} \mu^4 - \frac{15}{4} \mu^2 + \frac{3}{8} \right] d\mu = \left[ \frac{-\pi}{128} \right]

$$ $$
 * $$\displaystyle (Eq. 19)


 * }.
 * }.

Substituting equation (19) in (18),


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow A_4 = \frac{9T_0}{2} \left[ \frac{-\pi}{128} \right]

$$
 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_4 = \frac{-9\pi T_0}{256}

$$ $$
 * style= |
 * $$\displaystyle (Eq. 20)
 * }.
 * }.

2b. The expression for $$\displaystyle A_n $$ is given by,


 * {| style="width:100%" border="0" align="left"

\begin{align} A_n & = \frac{2n+1}{2} \int_{-1}^{1} f(\mu)P_n(\mu)d\mu \\ & = \frac{2n+1}{2} \sum_{j=1}^{m} w_jf(x_j)P_n(x_j) \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }
 * }

where,


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{(n+1)P'_m(x_j)P_{m+1}(x_j)} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.

(i.) For n = 0 and m = 20 we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_0 = 1

$$


 * }
 * }

and,


 * {| style="width:100%" border="0" align="left"

\begin{align} \Rightarrow A_0 & = \frac{2(0)+1}{2} \sum_{j=1}^{20} T_0 w_j \sqrt{1-x_{j}^{2}}\\ & = \frac{T_0}{2} \left[ 1.570892146048340 \right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_0 = 7.854460730241699\cdot 10^{-1} \cdot T_0

$$ $$
 * style= |
 * $$\displaystyle (Eq. 21)
 * }.
 * }.

(ii.) For n = 2 and m = 20 we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_2 = \frac{1}{2} (3x^2-2)

$$


 * }
 * }

and,


 * {| style="width:100%" border="0" align="left"

\begin{align} \Rightarrow A_2 & = \frac{2(2)+1}{2} \sum_{j=1}^{20} T_0 w_j (\frac{1}{2}) (3x_{j}^{2}-2) \sqrt{1-x_{j}^{2}}\\ & = \frac{5T_0}{2} \left[ -1.962526165998847\cdot 10^{-1} \right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_2 = -4.906315414997119\cdot 10^{-1} \cdot T_0

$$ $$
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 22)
 * }.
 * }.

(iii.) For n = 4 and m = 20 we get,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_4 = \frac{35}{8} x^4 - \frac{15}{4} x^2 + \frac{3}{8}

$$


 * }
 * }

and,


 * {| style="width:100%" border="0" align="left"

\begin{align} \Rightarrow A_4 & = \frac{2(4)+1}{2} \sum_{j=1}^{20} T_0 w_j \left(\frac{35}{8} x_{j}^{4} - \frac{15}{4} x_{j}^{2} + \frac{3}{8} \right) \sqrt{1-x_{j}^{2}}\\ & = \frac{9T_0}{2} \left[ -2.444412881080017 \cdot 10^{-2} \right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle


 * }.
 * }.


 * {| style="width:100%" border="0" align="left"

$$\displaystyle
 * style="width:2%; padding:10px; border:2px solid #8888aa" |
 * style="width:2%; padding:10px; border:2px solid #8888aa" |

\Rightarrow A_4 = -1.099985796486008 \cdot 10^{-1}\cdot T_0

$$ $$ These numerical solutions are all less than 1 % from the exact solution.
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 23)
 * }.
 * }.

 Matlab Code: 

Please refer and download matlab files from Gauss-Legendre Matlab Central. Below is the file functions.m that will be called by gausslege.m function.

Below is the function call to find the numerical integrals every time after modifying the functions.m file for corresponding n values [This is done at the command line or can be done as script].

= Problem 14: Gauss-Legendre Quadrature = From lecture slide 35-3

Given
From lecture slide 31-3, general expression for Legendre Polynomial is given by,


 * {| style="width:100%" border="0" align="left"

P_n(x) = \sum_{i=0}^{\lfloor n/2 \rfloor} \frac{1 \cdot 3 \dots \left(2n - 2i - 1\right)}{2^i i! (n-2i)!} (-1)^i x^{n-2i} $$
 * $$\displaystyle
 * $$\displaystyle


 * },
 * },

and from lecture slide 35-2, weights $$\displaystyle w_j $$ of the Legendre Polynomial $$\displaystyle P_n(x)$$ are given by,


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{(n+1)P'_n(x_j)P_{n+1}(x_j)} $$ \left[\forall j=1,2,...,n \right] $$ where each $$\displaystyle x_j $$ are the roots of $$\displaystyle P_n(x) = 0 $$.
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.
 * }.

Find
1. Verify the expressions on Wikipedia for the Legendre polynomials $$\displaystyle P_n$$ with $$\displaystyle n = 0, 1,..., 6$$. (See homework on lecture slide 31-3)

2. Verify the table for Gauss-Legendre quadrature in Wikipedia, analytical expressions of $$\displaystyle \{x_j\}$$ and $$\displaystyle \{w_j\}$$, $$\displaystyle j=1,...,5$$, and $$\displaystyle n=1,...,5$$, where $$\displaystyle n$$ is the number of integration points.

3. Evaluate numerically $$\displaystyle \{x_j\}$$ and $$\displaystyle \{w_j\}$$ and compare results with Abramovitz & Stegum. See [http://en.wikiversity.org/wiki/User:Egm6321.f09/Lecture_plan lecture plan].

Solution
1. The general expression for Legendre Polynomial is given by,


 * {| style="width:100%" border="0" align="left"

P_n(x) = \sum_{i=0}^{\lfloor n/2 \rfloor} \frac{1 \cdot 3 \dots \left(2n - 2i - 1\right)}{2^i i! (n-2i)!} (-1)^i x^{n-2i} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 1)


 * }.
 * }.

Please refer Problem 6 Solution above, for $$\displaystyle P_0(x),\ P_1(x),\ P_2(x),\ P_3(x),\ P_4(x) $$.

Substituting $$\displaystyle n=5$$ into Eq. 1 gives,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_5(x) = \sum_{i=0}^{\lfloor 5/2 \rfloor} \frac{1 \cdot 3 \dots \left(2n - 2i - 1\right)}{2^i i!(n-2i)!}(-1)^i x^{n - 2i}

$$


 * }.
 * }.

The sum is then expanded,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_5(x)  = \frac{1 \cdot 3 \cdot 5 \cdot 7 \cdot 9} {1 \cdot 2 \cdot 3 \cdot 4 \cdot 5} x^5 + \frac{1 \cdot 3 \cdot 5 \cdot 7 } {2 \cdot (3!)} (-1)x^3 +  \frac{1 \cdot 3 \cdot 5} {2^2 \cdot (2!)} (-1)^2 x

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 2)
 * }.
 * }.

Equation (2) is then,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow P_5(x) = \frac{63}{8} x^5 - \frac{35}{4} x^3 + \frac{15}{8} x $$ $$.
 * style="width:30%; padding:10px; border:2px solid #8888aa" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 3)
 * }
 * }

Substituting $$\displaystyle n=6$$ into Eq. 1 gives,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_6(x) = \sum_{i=0}^{\lfloor 6/2 \rfloor} \frac{1 \cdot 3 \cdot \cdot \cdot \left(2n - 2i - 1\right)}{2^i i!(n-2i)!}(-1)^i x^{n - 2i}

$$


 * }.
 * }.

The sum is then expanded,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

\Rightarrow P_6(x)  = \frac{1 \cdot 3 \cdot 5 \cdot 7 \cdot 9 \cdot 11} {1 \cdot 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6} x^6 + \frac{1 \cdot 3 \cdot 5 \cdot 7 \cdot 9} {2 \cdot (4!)} (-1)x^4 +  \frac{1 \cdot 3 \cdot 5 \cdot 7} {2^2 \cdot (2!) \cdot (2!)} (-1)^2 x^2 +  \frac{1 \cdot 3 \cdot 5} {2^3 \cdot (3!)} (-1)^3 x^0

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 4)
 * }.
 * }.

Equation (4) is then,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow P_6(x) = \frac{231}{16} x^6 - \frac{315}{16} x^4 + \frac{105}{16} x^2 - \frac{5}{16} $$ $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 5)
 * }.
 * }.

The equations (3), (5) and equations (10), (13), (16), (19), (22) of Problem 6 match the equations in Wikipedia.

2. The weights $$\displaystyle w_j $$ of the Legendre Polynomial $$\displaystyle P_n(x)$$ are given by,


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{(n+1)P'_n(x_j)P_{n+1}(x_j)} $$ \left[\forall j=1,2,...,n \right] $$ $$ where each $$\displaystyle x_j $$ are the roots of $$\displaystyle P_n(x) = 0 $$.
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 6)
 * }.
 * }.

(i). When $$\displaystyle n = 1 $$,


 * {| style="width:100%" border="0" align="left"

P_1(x) = x;\ P'_1(x) = 1; \ P_2(x) = \frac{1}{2}(3x^2-1);when\ P_1(x) = 0 \Rightarrow\ x_1 = 0; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 7)
 * }
 * }

Substituting values of Equation (7) into (6)


 * {| style="width:100%" border="0" align="left"

w_1 = \frac{-2}{(1+1)(1)(1/2)(-1)} = 2 $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

And so,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle x_1 = 0;\ w_1 = 2 $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 8)
 * }.
 * }.

(ii). When $$\displaystyle n = 2 $$,


 * {| style="width:100%" border="0" align="left"

P_2(x) = \frac{1}{2}(3x^2-1);\ P'_2(x) = 3x; P_3(x) = \frac{1}{2}(5x^3-3x);when\ P_2(x) = 0 \Rightarrow\ x_{1,2} = \bigg\{\frac{-1}{\sqrt{3}},\frac{1}{\sqrt{3}} \bigg\}; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 9)
 * }
 * }

Substituting values of Equation (9) into (6),


 * {| style="width:100%" border="0" align="left"

w_1 = \frac{-2}{3(3)(\frac{-1}{\sqrt{3}})(\frac{1}{2})\left[5(-1/\sqrt{3})^3 - 3(-1/\sqrt{3})\right]} = \frac{4}{-5+9} = 1 $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }


 * {| style="width:100%" border="0" align="left"

w_2 = \frac{-2}{3(3)(\frac{1}{\sqrt{3}})(\frac{1}{2})\left[5(1/\sqrt{3})^3 - 3(1/\sqrt{3})\right]} = \frac{-4}{5-9} = 1 $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

And so,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle x_{1,2} = \bigg\{\frac{-1}{\sqrt{3}},\frac{1}{\sqrt{3}} \bigg\};\ w_{1,2} = \bigg\{1,1 \bigg\} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 10)
 * }.
 * }.

(iii). When $$\displaystyle n = 3 $$,


 * {| style="width:100%" border="0" align="left"

P_3(x) = \frac{1}{2}(5x^3-3x);\ P'_3(x) = \frac{1}{2}(15x^2-3);\ P_4(x) = \frac{35}{8}x^4 - \frac{15}{4}x^2 + \frac{3}{8}; when\ P_3(x) = 0 \Rightarrow\ x_{1,2,3} = \bigg\{-\sqrt{\frac{3}{5}},0,\sqrt{\frac{3}{5}} \bigg\}; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 11)
 * }
 * }

Substituting values of Equation (11) into (6),


 * {| style="width:100%" border="0" align="left"

w_1 = w_3 = \frac{-2}{4(1/2)\left[15(3/5) - 3 \right]\left[(35/8)(9/25) - (15/4)(3/5) + (3/8) \right]} = \frac{5}{9} $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * {| style="width:100%" border="0" align="left"
 * {| style="width:100%" border="0" align="left"

w_2 = \frac{-2}{2(-3)\frac{3}{8}} = \frac{8}{9} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

And so,


 * {| style="width:100%" border="0" align="left"

$$\displaystyle x_{1,2,3} = \bigg\{-\sqrt{\frac{3}{5}},0,\sqrt{\frac{3}{5}} \bigg\};\ w_{1,2,3} = \bigg\{\frac{5}{9},\frac{8}{9} ,\frac{5}{9}\bigg\} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 12)
 * }.
 * }.

(iv). When $$\displaystyle n = 4 $$,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

P_4(x) = \frac{35}{8}x^4 - \frac{15}{4}x^2 + \frac{3}{8}

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 13)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

P'_4(x) = \frac{35}{2}x^3 - \frac{15}{2}x; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 14)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

P_5(x) = \frac{63}{8} x^5 - \frac{35}{4} x^3 + \frac{15}{8} x; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 15)
 * }.
 * }.

Substituting (13), (14), (15) into equation (6),


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{(5)(\frac{5{x_j}^2}{16})(7{x_j}^2-3)(63{x_j}^4-70{x_j}^2+15)}; \forall j = 1,2,3,4 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 16)
 * }.
 * }.

When $$\displaystyle P_4(x) = 0 $$,


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_1 = - \sqrt{\frac{3+2\sqrt{6/5}}{7}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 17)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_2 = - \sqrt{\frac{3-2\sqrt{6/5}}{7}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 18)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_3 = \sqrt{\frac{3-2\sqrt{6/5}}{7}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 19)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_4 = \sqrt{\frac{3+2\sqrt{6/5}}{7}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 20)
 * }.
 * }.

Substituting equations (18) and (19) into (16),


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow\ w_{2,3} = \frac{18+\sqrt{30}}{36} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 21)
 * }.
 * }.

Substituting equations (18) and (19) into (16),


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow\ w_{1,4} = \frac{18-\sqrt{30}}{36} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 22)
 * }.
 * }.

(v). When $$\displaystyle n = 5 $$,


 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle
 * $$\displaystyle

P_5(x) = \frac{63}{8}x^5 - \frac{35}{4}x^3 + \frac{15}{8}x

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 23)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

P'_5(x) = \frac{315}{8}x^4 - \frac{105}{4}x^2+\frac{15}{8}; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 24)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

P_6(x) = \frac{231}{16} x^6 - \frac{315}{16} x^4 + \frac{105}{16} x^2 - \frac{5}{16}; $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 25)
 * }.
 * }.

Substituting (23), (24), (25) into equation (6),


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{6(\frac{315}{8}x^4 - \frac{105}{4}x^2+\frac{15}{8})(\frac{231}{16} x^6 - \frac{315}{16} x^4 + \frac{105}{16} x^2 - \frac{5}{16})}; \forall j = 1,2,3,4,5 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 26)
 * }.
 * }.

When $$\displaystyle P_5(x) = 0 $$,


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_1 = - \sqrt{\frac{35+\sqrt{280}}{63}} = - \frac{1}{3}\sqrt{5+2\sqrt{\frac{10}{7}}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 27)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_2 = - \sqrt{\frac{35-\sqrt{280}}{63}} = - \frac{1}{3}\sqrt{5-2\sqrt{\frac{10}{7}}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 28)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_3 = 0 $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 29)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_4 = \sqrt{\frac{35-\sqrt{280}}{63}} = \frac{1}{3}\sqrt{5-2\sqrt{\frac{10}{7}}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 30)
 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow\ x_5 = \sqrt{\frac{35+\sqrt{280}}{63}} = \frac{1}{3}\sqrt{5+2\sqrt{\frac{10}{7}}} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (Eq. 31)
 * }.
 * }.

Substituting equations (29) into (26),


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow\ w_3 = \frac{128}{225} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 32)
 * }.
 * }.

Substituting equations (28) and (30) into (26),


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow\ w_{2,4} = \frac{322+13\sqrt{70}}{900} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 32)
 * }.
 * }.

Substituting equations (27) and (31) into (26),


 * {| style="width:100%" border="0" align="left"

$$\displaystyle \Rightarrow\ w_{1,5} = \frac{322-13\sqrt{70}}{900} $$ $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * <p style="text-align:right;">$$\displaystyle (Eq. 32)
 * }.
 * }.

3.

(i). The numerical values when $$\displaystyle n = 1 $$ are given by equation (8).

(ii). The numerical values when $$\displaystyle n = 2 $$ are,


 * {| style="width:100%" border="0" align="left"

x_{1,2} = \bigg\{\frac{-1}{\sqrt{3}},\frac{1}{\sqrt{3}} \bigg\};\ w_{1,2} = \bigg\{1,1 \bigg\} $$
 * $$\displaystyle
 * $$\displaystyle


 * }
 * }


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} x_1 \\ x_2 \\ \end{bmatrix} = \begin{bmatrix} \frac{-1}{\sqrt{3}} \\ \frac{1}{\sqrt{3}} \\ \end{bmatrix} = \begin{bmatrix} 5.773502691896258e-001 \\ 5.773502691896258e-001 \\ \end{bmatrix}

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 33)
 * },
 * },

and,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} w_1 \\ w_2 \\ \end{bmatrix} = \begin{bmatrix} 1.0000000000000000 \\ 1.0000000000000000 \\ \end{bmatrix} $$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 34)
 * }.
 * }.

(iii). When $$\displaystyle n = 3 $$,


 * {| style="width:100%" border="0" align="left"

w_j = \frac{-2}{(4)(\frac{1}{2})(15x^2-3)(\frac{35}{8}x^4 - \frac{15}{4}x^2 + \frac{3}{8})} $$
 * $$\displaystyle
 * $$\displaystyle

$$
 * <p style="text-align:right;">$$\displaystyle (Eq. 35)
 * },
 * },

the numerical values are calculated to be,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ \end{bmatrix} = \begin{bmatrix} -7.745966692414834e-001 \\ 0.000000000000000 \\   7.745966692414834e-001 \\ \end{bmatrix}

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 36)
 * },
 * },

and,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} w_1 \\ w_2 \\ w_3 \\ \end{bmatrix} = \begin{bmatrix} 5.555555555555554e-001 \\ 8.888888888888888e-001 \\ 5.555555555555554e-001 \\ \end{bmatrix} $$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 37)
 * }.
 * }.

Matlab source code:

.

(iv). When $$\displaystyle n = 4 $$, the expression for $$\displaystyle w_j $$ is given by equation (16) and the numerical values are,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ \end{bmatrix} = \begin{bmatrix} -8.611363115940526e-001 \\ -3.399810435848563e-001 \\ 3.399810435848563e-001 \\ 8.611363115940526e-001 \\ \end{bmatrix}

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 38)
 * },
 * },

and,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} w_1 \\ w_2 \\ w_3 \\ w_4 \\ \end{bmatrix} = \begin{bmatrix} 3.478548451374542e-001\\ 6.521451548625461e-001\\ 6.521451548625461e-001\\ 3.478548451374542e-001\\ \end{bmatrix} $$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 39)
 * }.
 * }.

Matlab source code:

.

(v). When $$\displaystyle n = 5 $$, the expression for $$\displaystyle w_j $$ is given by equation (26) and the numerical values are,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \\ \end{bmatrix} = \begin{bmatrix} -9.061798459386641e-001 \\ -5.384693101056831e-001 \\ 0 \\   5.384693101056831e-001 \\ 9.061798459386641e-001 \\ \end{bmatrix}

$$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 40)
 * },
 * },

and,


 * {| style="width:100%" border="0" align="left"

\Rightarrow
 * $$\displaystyle
 * $$\displaystyle

\begin{bmatrix} w_1 \\ w_2 \\ w_3 \\ w_4 \\ w_5 \\ \end{bmatrix} = \begin{bmatrix} 2.369268850561896e-001 \\ 4.786286704993663e-001 \\ 5.688888888888889e-001 \\ 4.786286704993663e-001 \\ 2.369268850561896e-001 \\ \end{bmatrix} $$ $$
 * <p style="text-align:right;">$$\displaystyle (Eq. 41)
 * }.
 * }.

Matlab source code:


 * {| style="width:100%" border="0" align="left"

The equations (8), (33), (34), (36), (37), (38), (39), (40) and (41) match the numerical values given by Abramovitz & Stegum's table.
 * style="width:78%; padding:10px; border:2px solid #8888aa" |
 * style="width:78%; padding:10px; border:2px solid #8888aa" |
 * style= |
 * }.
 * }.