User:Egm6322.s12.team2/HW10

= R 10.1 - Proof of Recurrence Relation RR2 =

Given

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

$$  \displaystyle (n+1)P_{n+1}-(2n+1)\mu P_n + nP_{n-1} = 0 $$     (10.1.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$  \displaystyle \mu[P_0\rho^0 + P_1\rho^1 +\sum_{n=2}P_n{\color{red}\rho^n}]-[P_0\rho^1 + \sum_{n=2}P_{n-1}{\color{red}\rho^n}]=[P_1\rho^0 + P_2\cdot2\cdot\rho^1 +\sum_{n=2}P_{n+1}(n+1){\color{red}\rho^n}]-2\mu[P_1\cdot1\cdot\rho + \sum_{n=2}P_nn{\color{red}\rho^n}] +[\sum_{n=2}P_{n-1}(n-1){\color{red}\rho^n}]$$ (10.1.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find
Show that Eq(10.1.2) satisfy Eq(10.1.1)

Solution
the author may mistake the meaning of this problems,so the solution maybe incorrectproofread by Lang Xia

Ignore initial terms and then extract rest terms


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

$$  \displaystyle \sum_{n=2}P_n{\rho^n}-\sum_{n=2}P_{n-1}{\rho^n}=\sum_{n=2}P_{n+1}(n+1){\rho^n} + \sum_{n=2}P_nn{\rho^n} +\sum_{n=2}P_{n-1}(n-1){\rho^n} $$     (10.1.3) Because every term is summated from n=2, Rearrage it then,
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

we can get


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

$$  \displaystyle (n+1)\sum_{n=2}P_{n+1}-2\mu n \sum_{n=2}P_{n} + \mu P_{n} + (n-1)P_{n-1} + P_{n-1} = 0$$ (10.1.4)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Where $$\rho^n$$ is cancelled out

Taking off $$\sum $$

Rearrage


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

$$  \displaystyle (n+1)P_{n+1}-(2n+1)\mu P_{n} + nP_{n-1} = 0$$ (10.1.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Therefore Eq(10.1.2) satisfy Eq(10.1.1)

Egm6322.s12.sungsik 15:49, 22 February 2012 (UTC)

= R 10.2 - Generating Legendre polynomials using RR2 =

Given
Recurrence relation 2 (RR2):
 * {| style="width:100%" border="0"

$$  \displaystyle (n+1)P_{n+1} - (2n+1)\mu P_n + nP_{n-1} = 0 $$     (10.2.1) Legendre polynomials $$P_0$$ and $$P_1$$:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} P_0(\mu) &= 1 \\ P_1(\mu) &= \mu \end{align} $$     (10.2.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find
Use RR2 to generate $$\left\{P_n,n=3,\cdots, 6\right\}$$ based on the knowledge of $$\left\{P_0,P_1\right\}$$.

Solution
This problem is quite straightforward to solve; it can be simplified slightly by the method used in the [[Media:Pea2.s12.sec44.a.djvu|class notes]] to change the index of the polynomials. Defining $$m=n+1$$ and rearranging, Eq. 10.2.1 becomes:
 * {| style="width:100%" border="0"

$$  \displaystyle P_m = \frac{(2m+1)}{m}\mu P_{m-1} - \frac{(m-1)}{m}P_{m-2} $$     (10.2.3) Since m is a dummy index, it can be replaced by n to yield RR2 in a form more compatible with generating the next Legendre polynomial given the two previous ones:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P_n = \frac{(2n+1)}{n}\mu P_{n-1} - \frac{(n-1)}{n}P_{n-2} $$     (10.2.3) The Legendre polynomial $$P_2$$ must be generated first:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} P_2 &= \frac{(2(2)-1)}{(2)}\mu P_{(1)} - \frac{((2)-1)}{(2)}P_{(0)}\\ &= \frac{3}{2}\mu (\mu) - \frac{1}{2}(1)\\ &= \frac{1}{2}\left(3\mu^2 - 1\right) \end{align} $$     (10.2.4) Similarly, the Legendre polynomials $$P_3, P_4, P_5$$ and $$P_6$$ are generated as:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} P_3 &= \frac{(2(3)-1)}{(3)}\mu P_{(2)} - \frac{((3)-1)}{(3)}P_{(1)} = \frac{5}{3}\mu (\frac{1}{2}\left(3\mu^2 - 1\right)) - \frac{2}{3}(\mu)\\ &= \frac{1}{2}\left(5\mu^3 - 3\mu\right)\\ P_4 &= \frac{(2(4)-1)}{(4)}\mu P_{(3)} - \frac{((4)-1)}{(4)}P_{(2)} = \frac{7}{4}\mu (\frac{1}{2}\left(5\mu^3 - 3\mu\right)) - \frac{3}{4}(\frac{1}{2}\left(3\mu^2 - 1\right))\\ &= \frac{1}{8}\left(35\mu^4 - 30\mu^2 +3\right)\\ P_5 &= \frac{(2(5)-1)}{(5)}\mu P_{(4)} - \frac{((5)-1)}{(5)}P_{(3)} = \frac{9}{5}\mu (\frac{1}{8}\left(35\mu^4 - 30\mu^2 +3\right)) - \frac{4}{5}(\frac{1}{2}\left(5\mu^3 - 3\mu\right))\\ &= \frac{1}{8}\left(63\mu^5 - 70\mu^3 + 15\mu\right)\\ P_6 &= \frac{(2(6)-1)}{(6)}\mu P_{(5)} - \frac{((6)-1)}{(6)}P_{(4)} = \frac{11}{6}\mu (\frac{1}{8}\left(63\mu^5 - 70\mu^3 + 15\mu\right)) - \frac{5}{6}(\frac{1}{8}\left(35\mu^4 - 30\mu^2 +3\right))\\ &= \frac{1}{16}\left(231\mu^6 - 315\mu^4 + 105\mu^2 - 5\right)\\ \end{align} $$     (10.2.5) The Legendre polynomials generated in Eq. 10.2.5 can be compared to those given in the [[Media:Pea1.f11.mtg41.djvu|class notes]] and are seen to be identical
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }

=R10.3 Orthogonality of Legendre Functions by Recurrence Relations=

Given
We are given the following recurrence relation from 44-11. $$h_n = \frac{2n-1}{2n+1} \, h_{n-1}$$

Find
(1) The parameter $$h_0$$ by direct integration and (2) Derive the orthogonality of Legendre Functions from (3) on 44-12. $$h_n := \left \langle P_n,P_n \right \rangle = \frac{2}{2n+1}$$ From lecture notes [[media:pea2.f12.sec44.b.djvu|Mtg 44b]]

Solution
The first step is to define the integration for $$h_0$$. The key is to apply the method from King pp. 30 - 42. Section 2.5 of King defines "Orthogonality of Legendre Polynomials." The method starts with Rodrigues' Formula. Apply the derivatives and integration by parts. The nth derivative of an mth order polynomial is 0 for m n.  $$P_n(x) = \frac{1}{2^n n!} \frac{d^n}{dx^n} {(x^2-1)^n}$$  $$\begin{align} \int_{-1}^1 f(x)P_n(x)dx &= \frac{1}{2^n n!}\int_{-1}^1f(x)\frac{d^n}{dx^n} {(x^2-1)^n} dx\\ &= \frac{-1^n}{2^n n!}\int_{-1}^1{(x^2-1)^n}P_m^{(n)}(x)dx \\ \end{align}$$ In summary, the integral is 0 for m not equal to n.  $$\int_{-1}^1 P_m(x)P_n(x)dx = 0$$ When n = m, the integral becomes  $$\begin{align} \int_{-1}^1 P_n(x)P_n(x)dx &= \frac{-1^n}{2^n n!}\int_{-1}^1{(x^2-1)^n} \frac{1}{2^n n!} (2n)!dx \\ &= \frac{-1^n}{2^n n!} \frac{1}{2^n n!} (2n)! \int_{-1}^1{(x^2-1)^n} dx \end{align}$$ Note that the following integral becomes  $$\int_{-1}^1 (x^2 - 1)^ndx = \frac{2^{2n+2}n!(n+1)!(-1)^n}{(2n+2)!}$$ In summary, the orthogonality of Legendre polynomials is <p style="text-align:center;"> $$\int_{-1}^1 P_n^2(x)dx = \frac{2}{2n+1}$$ So to answer part 1 of the question, let n = 0 to give the solution by direct integration. <p style="text-align:center;"> $$h_0 = <P_0,P_0> = \int_{-1}^1 P_0^2(x)dx = \frac{2}{2(0)+1} = 2$$ Next, we apply the following relationship to deduce (3) p. 43-12 by induction. <p style="text-align:center;"> $$h_n = \frac{2n-1}{2n+1} \, h_{n-1}$$ <p style="text-align:center;"> $$h_1 = \frac{2(1) - 1}{2(1)+1} h_0 = \frac{2}{3}$$ <p style="text-align:center;"> $$h_2 = \frac{2(2) - 1}{2(2)+1} h_1 = \frac{2}{5}$$ <p style="text-align:center;"> $$h_3 = \frac{2(3) - 1}{2(3)+1} h_2 = \frac{2}{7}$$ <p style="text-align:center;"> $$h_4 = \frac{2(4) - 1}{2(4)+1} h_3 = \frac{2}{9}$$ Hence, by induction, the solution to part 2 shows <p style="text-align:center;"> $$h_n = <P_n,P_n> = \frac{2}{2n+1}$$

=R*10.4 -Weight Function =

Given
The following equation: $$\displaystyle w_{j}=\frac{-2}{(n+1)P_{n}'(x_{j})P_{n+1}(x_{j})}$$ <p style="text-align:right">(10.4.1)

where the Legendre polynomial is $$\displaystyle P_{n}(x)=\sum^{m}_{r=0}(-1)^r \frac{(2n-2r)!x^{n-2r}}{2^{n}r!}(n-r)!(n-2r)!$$. <p style="text-align:right">(10.4.2)

Find
Verify that $$\displaystyle w_{2}=1$$

Solution
According to the 10.4.2, we have $$\displaystyle {\displaystyle P_{2}(x)=\frac{1}{2}(3x^{2}-1)}$$ <p style="text-align:right">(10.4.3) $$\displaystyle P_{3}(x)=\frac{1}{2}(5x^{3}-3x)$$ thus $$\displaystyle P_{2}^{'}(x)=3x$$ and the root of 10.4.3 are $$\displaystyle x_{1}=\frac{1}{\sqrt{3}},\quad x_{2}=-\frac{1}{\sqrt{3}} $$ Interms of 10.4.1 $$\displaystyle w_{2}=\frac{-2}{(2+1)P_{2}'(x_{2})P_{2+1}(x_{2})}$$ then $$\displaystyle w_{2}=\frac{-2}{(2+1)\cdot3\cdot\frac{-1}{\sqrt{3}}\cdot\frac{1}{2}\cdot\left(5\cdot(\frac{-1}{\sqrt{3}})^{3}-3\cdot\frac{-1}{\sqrt{3}}\right)}$$ $$\displaystyle =\frac{-2}{(2+1)\cdot3\cdot\frac{-1}{\sqrt{3}}\cdot\frac{1}{2}\cdot\left(\frac{4\sqrt{3}}{9}\right)}$$ $$\displaystyle =1$$

= R 10.5 - Gauss Legendre Quadrature Weight Function =

Given

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

$$  \displaystyle w_i=\frac{2}{(1-x_i^2)[P'_n(x_i)]^2}$$ (10.5.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle w_j=\frac{-2}{(n+1)P'_n(x_j)P_{n+1}(x_j)}$$ (10.5.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Find
Discuss the relative merits of using exact vs using the numerical values Extend the table to n=6 verify the table using Eq(10.5.1) and Eq(10.5.2)

Solution
a. When we use exact value in Gauss Legendre Quadrature, we can reduce the order of error.

Therefore, we can get more precise integration value.

b. First Find the roots of Legendre Polynomial when n = 6


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

$$  \displaystyle P_{6} = \frac{1}{16}(231x^6 - 315x^4 + 105x^2 -5) $$     (10.5.3) where $$P'_{6}=\frac{21}{8}x(33x^4 - 30x^2 +5)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }



Substitute $$ x_i $$ into Eq(10.5.1) when n= 6 $$ x_i= \pm 0.239, w_i =\pm1.4327$$ $$ x_i= \pm 0.661, w_i =\pm1.1054$$ $$ x_i= \pm 0.932, w_i =\pm0.5282$$ c. Legendre Polynomials $$P_{1}=x$$ $$P'_{1}=1$$ $$P_{2}=\frac{1}{2}(3x^2 -1)$$ $$P'_{2}=3x$$ $$P_{3}=\frac{1}{2}(5x^3 -3x)$$ $$P'_{3}=\frac{3}{2}(5x^2 -1)$$ $$P_{4}=\frac{1}{8}(35x^4 -30x^2+3)$$ $$P'_{4}=\frac{5}{2}x(7x^2 -3)$$ $$P_{5}=\frac{1}{8}(63x^5 -70x^3 +15x)$$ $$P'_{5}=\frac{15}{8}(21x^4 -14x^2 +1)$$ $$P_{6} = \frac{1}{16}(231x^6 - 315x^4 + 105x^2 -5)$$ Build Mathlab Code Subsitute into Eq(10.5.1) and Eq(10.5.2) Egm6322.s12.sungsik 17:09, 22 February 2012 (UTC)

= R 10.6 - Weight function for Gauss-Legendre Quadrature =

Given
Simplified weight formula:
 * {| style="width:100%" border="0"

$$  \displaystyle w_j = \frac{-2}{(n+1)P_n'(x_j)P_{n+1}(x_j)} $$     (10.6.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Simplified error formula:
 * {| style="width:100%" border="0"

$$  \displaystyle E_n(f) = \frac{2^{2n+1}(n!)^4}{(2n+1)[(2n)!]^2}\frac{f^{(2n)}(\eta)}{(2n)!},\ \eta \in [-1,1] $$     (10.6.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Find
In the NIST DLMF Sec 3.5v, the weight function shown in 10.6.1 is given by the formula:


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

$$  \displaystyle w_j = \int_{-1}^1\frac{P_n(x)}{(x-x_j)P_n'(x_j)}w(x)dx $$     (10.6.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

with w(x) = 1. Show that 10.6.1 can be obtained from 10.6.3. Also verify the formula for the error in 10.6.2 against the corresponding formula in the DLMF.

Solution
The first step in this problem is considering the Christoffel-Darboux formula, given by Isaacson and Keller in Analysis of Numerical Methods:


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

$$  \displaystyle \frac{a_n}{a_{n+1}}[P_{n+1}(x)P_n(\xi) - P_{n+1}(\xi)P_n(x)] = (x-\xi)\sum_{k=0}^n P_k(x)P_k(\xi) $$     (10.6.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

We substitute $$x_j$$ for $$\xi$$ and multiply both sides by $$w(x)/(x-x_j)$$:


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

$$  \displaystyle \frac{a_nw(x)}{a_{n+1}(x-x_j)}[P_{n+1}(x)P_n(x_j) - P_{n+1}(x_j)P_n(x)] = w(x)\sum_{k=0}^n P_k(x)P_k(x_j) $$     (10.6.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

We note that, since $$x_j$$ are the roots of the polynomial $$P_n$$, the first term inside the brackets on the left hand side of Eq. 10.6.5 goes to zero. We then integrate both sides between a and b:


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

$$  \displaystyle \begin{align} \int_a^b\frac{a_nw(x)}{a_{n+1}(x-x_j)}[P_{n+1}(x_j)P_n(x)]dx &= \int_a^bw(x)\sum_{k=0}^n P_k(x)P_k(x_j)dx\\ -\frac{a_n}{a_{n+1}}P_{n+1}(x_j)\int_a^b \frac{P_n(x)}{x-x_j}w(x)dx &= \int_a^bw(x)\sum_{k=0}^n P_k(x)P_k(x_j)dx \end{align} $$     (10.6.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

In which we can move $$P_{n+1}(x_j)$$ can be moved outside the integral as $$x_j$$ is a constant. With some manipulation, the right hand side can somehow be written as


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

$$  \displaystyle \int_a^bw(x)\sum_{k=0}^n P_k(x)P_k(x_j)dx = \int_a^b w(x)[P_n(x)]^2 dx $$ (10.6.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

If $$P_n(x)$$ is a Legendre polynomial, then w(x)=1, a=-1,  and b=1. Using the orthogonality principle of Legendre polynomials:


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

$$  \displaystyle \begin{align} \int_a^b w(x)[P_n(x)]^2 dx &= \int_{-1}^1 (1)[P_n(x)]^2 dx\\ &= \frac{2}{2n+1} \end{align} $$     (10.6.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Substituting 10.6.7 and 10.6.8 into 10.6.6 yields:


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

$$  \displaystyle -\frac{a_n}{a_{n+1}}P_{n+1}(x_j)\int_a^b \frac{P_n(x)}{x-x_j}w(x)dx = \frac{2}{2n+1} $$     (10.6.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Rearranging:


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

$$  \displaystyle \int_a^b \frac{P_n(x)}{x-x_j}w(x)dx = \frac{2}{2n+1}\frac{-a_{n+1}}{a_nP_{n+1}(x_j)} $$     (10.6.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

From Weisstein, the coefficients of the $$x^n$$ term of the polynomial are shown to be


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

$$  \displaystyle \frac{a_{n+1}}{a_n} = \frac{2n+1}{n+1} $$     (10.6.11)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Substituting 10.6.11 into 10.6.10 yields


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

$$  \displaystyle \int_a^b \frac{P_n(x)}{x-x_j}w(x)dx = \frac{-2}{P_{n+1}(x_j)} $$     (10.6.12)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Finally, we recognize that the left hand side of 10.6.12 is equivalent to the integral term in 10.6.3 (in which the $$P_n'(x_j)$$ term can be moved outside the integral as it is not a function of x). Hence, 10.6.12 can be substituted into 10.6.3 to yield the desired formula:


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

$$  \displaystyle w_j = \frac{-2}{(n+1)P_n'(x_j)P_{n+1}(x_j)} $$     (10.6.13)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

It can also be noted by inspection that the error formula given in 10.6.2 is equivalent to that given by NIST DLMF Sec 3.5v. Matt Shields 17:57, 22 February 2012 (UTC)

=R10.7 Apply Gauss-Legendre Quadrature to Boundary of Heat Problem=

Given
We are given the following recurrence relation from 45-10. $$f(\mu) = T_O \sinh(1 - \mu^2)$$

Find
Compute the first 3 non-zero coefficients using Gauss-Legendre quadrature to within 5% error. From lecture notes [[media:pea2.f12.sec45.c.djvu|Mtg 45c]]

Solution
The overall solution has three large steps: (1) Use Gauss-Quadrature parameters for 10 roots and respective weights, (2) Apply Gauss-Quadrature summation to integral solution of nonzero coefficients, and (3) check degree of accuracy. The problem to find the first three coefficients with integral methods has been analyzed in 9.1 by our team, so that solution will be used as a cross-reference. In 9.1, the solution established the fact that the first three non-zero coefficients of $$T_0 sinh(1-x^2)$$ are below. <p style="text-align:center;">$$A_j = \frac{2j+1}{2} \int_{-1}^1 P_j(x)T_0 \sinh{(1 - x^2)}d(x)$$ In 9.1, the following non-zero coefficients were established for the given function. <p style="text-align:center;">$$A_0 = 0.7459 T_0$$ <p style="text-align:center;">$$A_2 = -0.7997 T_0$$ <p style="text-align:center;">$$A_4 = 0.06671 T_0$$ Next, the identities of the Gauss-Quadruture formulas must be defined from 45. A given integral, I(f), can be approximated by a summation and error term. The identities are given on 45-6 to 45-7. <p style="text-align:center;">$$I(f) = I_n(f) + E_n(f)$$ The summation is defined below. <p style="text-align:center;">$$I_n(f) = \sum_{j=1}^n w_jf(x_j)$$ The argument of the summation, $$x_j$$, is defined by the roots of the Legendre polynomials. <p style="text-align:center;">$$\{x_j, j=1,...,n \} = \text{roots of Legendre polynomial}$$ The weights of the summation of the Gauss-Quadruture as defined below. <p style="text-align:center;">$$w_j = \frac{-2}{(n+1)P_n'(x_j)P_{n+1}(x_j)}$$ The error term is defined by this complicated fraction from 45-7. <p style="text-align:center;">$$E_n(f) = \frac{2^{2n+1}(n!)^4}{(2n+1)[(2n)!]^2} \frac{f^{2n}(\eta)}{(2n)}, \eta \in [-1,1]$$ Next, the method of Gauss-Quadruture must be applied to the integral for $$A_j$$. The key is to apply the relationship below. <p style="text-align:center;">$$A_j = \frac{2j+1}{2} \int_{-1}^1 P_j(x)T_0 \sinh{(1 - x^2)}d(x) \approx I_n(f) = \sum_{j=1}^n w_jf(x_j)$$ In order to achieve greater than 95% accuracy, the appropriate range of j = 1 to j = n must be chosen. Here, we choose to do the summation from n = 1 to n = 10. The choice gives the following roots and weights from http://dlmf.nist.gov/3.5#v. <p style="text-align:center;">$$A_j = \frac{2j+1}{2} \int_{-1}^1 P_j(x)T_0 \sinh{(1 - x^2)}d(x) \approx I_n(f) = \sum_{j=1}^{10} w_jf(x_j)$$ The roots and weights must be applied to each Legendre polynomial for the respective non-zero coefficients. <p style="text-align:center;">$$P_0 = 1$$ <p style="text-align:center;">$$P_2 = \frac{1}{2} (3x^2 - 1)$$ <p style="text-align:center;">$$P_4 = \frac{35}{8}x^4 -\frac{15}{4}x^2 + \frac{3}{8}$$ <p style="text-align:center;">$$A_0 = \frac{1}{2}\int_{-1}^1P_0(x)F(x)dx = \sum_{j=1}^{10} w_jP_0 = \sum_{j=1}^{10} w_j(1)$$ <p style="text-align:center;">$$A_2 = \frac{5}{2}\int_{-1}^1P_2(x)F(x)dx =\sum_{j=1}^{10} w_jP_1 = \sum_{j=1}^{10} w_j \frac{1}{2} (3x^2 - 1)$$ <p style="text-align:center;">$$A_4 = \frac{9}{2}\int_{-1}^1P_4(x)F(x)dx =\sum_{j=1}^{10} w_jP_2 = \sum_{j=1}^{10} w_j \frac{35}{8}x^4 - \frac{15}{4}x^2 + \frac{3}{8}$$ The next step is to do the summations above with a spreadsheet on MS Excel. For $$A_0$$ we have the following table transcribed from the spreadsheet.

The key to solve the problem is sum all terms in the "all" column to get the coefficient. <p style="text-align:center;">$$A_0$$ = sum of numbers in "all" column * $$T_0$$ = 0.745999*$$T_0$$ This value above matches the value calculated in solution 9.1 by 0.7459/0.745999*100, which is almost 100%. This meets the criteria for an approximation with error < 5%. In addition, for $$A_2$$ we have the following table transcribed from the spreadsheet.

Again, the key to solve the problem is sum all terms in the "all" column to get the coefficient. <p style="text-align:center;">$$A_2$$ = sum of numbers in "all" column * $$T_0$$ = -0.7997*$$T_0$$ This value above matches the value calculated in solution 9.1 by 100%, so the error is negligible with a 100% match.

Finally, for $$A_4$$ we have the following table transcribed from the spreadsheet.

Once again we sum all terms in the "all" column to get the coefficient. <p style="text-align:center;">$$A_4$$ = sum of numbers in "all" column * $$T_0$$ = 0.066715*$$T_0$$ This value above matches the value calculated in solution 9.1 by 0.066715/0.06671*100, which is almost 100%. The close match makes errors negligible and fulfills the criteria of an error < 5%. In summary, we have successfully calculated the coefficients by using the Gauss-Quadrature formulations.

=R 10.8 -Lagrange Interpolation =

Given
The following Lagrange interpolation: $$\displaystyle p(x)\thickapprox p^{h}(x):=\sum_{j=1}^{n}p(x_{j})\ell_{j}(x)\in\mathcal{P}_{n-1} $$ <p style="text-align:right">(10.8.1)

where Lanrage basis function is $$\displaystyle \ell_{j}(x):=\frac{\displaystyle \prod_{k=1,k\neq j}^{n}(x-x_{k})}{\displaystyle \prod_{k=1,k\neq j}^{n}(x_{j}-x_{k})}\in\mathcal{P}_{n-1}$$. <p style="text-align:right">(10.8.2) Define $$\displaystyle d(x):=p(x)-p^{h}(x)\in\mathcal{P}_{n-1}$$. $$\displaystyle $$

Find
1.Verify $$\displaystyle \ell_{j}(x_{i})=\delta_{ji}$$. 2.Show that: $$\displaystyle d(x_{i})=0$$, for $$\displaystyle i=1,\ldots,n$$ and thus $$\displaystyle d(x)=0,\forall x\Rightarrow p(x)\equiv p^{h}(x)$$

Solution
1, From the equation 10.8.2, when $$\displaystyle i\neq j$$, we have $$\displaystyle {\displaystyle \ell_{j}(x_{i}):=\frac}=\displaystyle \prod_{k\neq j}\frac{x_{i}-x_{k}}{x_{j}-x_{k}}=\frac{(x_{i}-x_{0})}{(x_{j}-x_{0})}\cdots\frac{\overbrace{(x_{i}-x_{i})}^{=0}}{(x_{j}-x_{i})}\cdots\frac{(x_{i}-x_{k})}{(x_{j}-x_{k})}=0$$ an when $$\displaystyle i=j$$ $$\displaystyle \ell_{i}(x_{i})=\ell_{j}(x_{j}):=\prod_{k\neq j}\frac{x_{j}-x_{k}}{x_{j}-x_{k}}=1$$ Therefore $$\displaystyle \ell_{j}(x_{i})=\delta_{ji}$$ here the Kronecker delta is
 * $$\delta_{ij} = \left\{\begin{matrix}

1, & \mbox{if } i=j  \\ 0, & \mbox{if } i \ne j  \end{matrix}\right.$$ 2, We know that $$\displaystyle d(x):=p(x)-p^{h}(x)$$ Therefore $$\displaystyle d(x_{i}):=p(x_{i})-p^{h}(x_{i})=p(x_{i})-\sum_{j=1}^{n}p(x_{j})\ell_{j}(x_{i})$$ From above solution, we know that $$\displaystyle \ell_{j}(x_{i})=\delta_{ji}$$,thus $$\displaystyle d(x_{i})=p(x_{i})-\sum_{j=1}^{n}\underbrace{p(x_{j})\delta_{ji}}_{=0,\, if\, i\neq j}=p(x_{i})-p(x_{i})=0$$ and thus $$\displaystyle d(x)=0,\forall x\Rightarrow p(x)\equiv p^{h}(x)$$ $$\displaystyle $$

=Contributing Members=

Egm6322.s12.team2.steele.m2 19:26, 22 February 2012 (UTC) Egm6322.s12.team2.Xia 10:55, 21 February 2012 (UTC) Egm6322.s12.sungsik 17:11, 22 February 2012 (UTC)

= References for Report 10 = King, A.C., J. Billingham and S.R. Otto. "Differential Equations: Linear, Nonlinear, Ordinary, Partial." New York, NY: Cambridge University Press, 2003. http://dlmf.nist.gov/3.5#v Vu-Quoc, L. Class Lecture: Principles of Engineering Analysis. University of Florida, Gainesville, FL, (Meeting 44b) [[media:Pea2.s12.sec44.b.djvu|Mtg 44b]] 7 Feb 2012 to 9 Feb 2012. Vu-Quoc, L. Class Lecture: Principles of Engineering Analysis. University of Florida, Gainesville, FL, (Meeting 45c) [[media:Pea2.s12.sec45.c.djvu|Mtg 45c]] 16 Feb 2012.