User:EGM6341.S11.team5.cavalcanti/HW2

= Problem 1 - Taylor Series = From (meeting 6 page 3)

Given
The Taylor series expansion: $$f(x)=f(x_{0})+ \frac{(x+x_{0})^1}{1!}f^{1}(x_{o})+\int_{x_{0}}^{x}(x-t)f^{(2)}(t)dt$$

Find
1. Do integration by parts on the last term to reveal 3 more terms in the Taylor series and the remainder. 2. Use IMVT to express the remainder in terms of $$f^{5}(\xi)$$ for $$ \xi \in[x_{0},x]$$. 3. Assuming equations (3) and (4) on page 3-3 are correct, do integration by parts once more on $$R_{n+1}$$ to verify that (3) and (4)remain correct. 4. Use IMVT on 4 from meeting 3 page 3 to show (5) in page 3-3.

Solution
''' We solved this problem on our own. '''

1. Finding next 3 terms
Starting with the Taylor Series, $$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\int_{x_{0}}^{x}(x-t)f^{(2)}(t)dt$$ we will evaluate the integral using integration by parts. Let $$u'=(x-t)dt$$ and $$v=f^{(2)}$$. Then, $$u=\frac{-1}{2}(x-t)^{2}$$ and $$v'=f^{(3)}(t)dt$$. Integrating by parts we obtain: $$\left[ uv \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}uv'$$ $$=\frac{-1}{2}\left[ (x-t)^{2}f^{(2)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{2}(x-t)^{2}f^{(3)}(t)dt$$ Evaluating we then get the third term in the series: $$\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+\frac{1}{2}\int_{x_{0}}^{x}(x-t)^{2}f^{(3)}(t)dt$$ Once again, integrating by parts: $$\int_{x_{0}}^{x}(x-t)^{2}f^{(3)}(t)dt$$ Let $$u'=(x-t)^{2}dt$$ and $$v=f^{(3)}(t)$$. Then, $$u=\frac{-1}{3}(x-t)^{3}$$ and $$v'=f^{(4)}(t)dt$$. Integrating by parts: $$\left[ \frac{-1}{3}(x-t)^{3}f^{(3)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{3}(x-t)^{3}f^{(4)}(t)dt$$ Evaluating: $$\frac{(x-x_{0})^{3}}{3}f^{(3)}(x_{0})+\frac{1}{3}\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Plugging back into the series: $$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+ \frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+\frac{1}{3!}\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Lastly, integration by parts once more on the term: $$\int_{x_{0}}^{x}(x-t)^{3}f^{(4)}(t)dt$$ Let $$u'=(x-t)^3dt$$ and $$v=f^{(4)}(t)$$. Then, $$ u=\frac{-1}{4}(x-t)^{4}$$ and $$v'=f^{(5)}(t)dt$$. Integrating by parts: $$\left[ \frac{-1}{4}(x-t)^{4}f^{(4)}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{-1}{4}(x-t)^{4}f^{(5)}(t)dt$$ Evaluating: $$ \frac{1}{4}(x-x_{0})^{4}f^{(4)}(x_{0})+\frac{1}{4}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$ Plugging back in:
 * {| style="width:100%" border="0" align="left"

$$f(x)=f(x_{0})+\frac{(x-x_{0})}{1!}f^{(1)}(x_{0})+\frac{(x-x_{0})^{2}}{2!}f^{(2)}(x_{0})+ \frac{(x-x_{0})^{3}}{3!}f^{(3)}(x_{0})+ \frac{(x-x_{0})^{4}}{4!}f^{(4)}(x_{0})+\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Remainder
Starting with the remainder: $$\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt$$ Using IMVT $$\int_{a}^{b}w(x)f(x)dx=f(\xi)\int_{a}^{b}w(x)dx$$, where $$\xi \in [a,b]$$. $$\frac{1}{4!}\int_{x_{0}}^{x}(x-t)^{4}f^{(5)}(t)dt = \frac{1}{4!(5)}f^{(5)}(\xi)\left[ (x-t)^{5} \right]_{x_{0}}^{x}$$
 * {| style="width:100%" border="0" align="left"

$$ \therefore R_{5}=\frac{1}{5!}f^{5}(\xi)(x-x_{0})^{5}$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

3. $$R_{n+2}$$
Equation 4 from pg. 3-3 is as follows: $$ R_{n+1}(x)=\frac{1}{n!}\int_{x_{0}}^{x}(x-t)^{n}f^{n+1}(t)dt$$ Doing integration by parts: Let $$u'=(x-t)^{n}dt$$ and $$v=f^{n+1}(t)$$ Then, $$ u=\frac{-1}{n+1}(x-t)^{n+1}$$ and $$ v'=f^{n}(t)dt$$ $$ \left[ \frac{1}{n+1}(x-t)^{n+1}f^{n+1}(t) \right]_{x_{0}}^{x}-\int_{x_{0}}^{x}\frac{1}{n+1}(x-t)^{n+1}f^{n}(t)dt$$ Evaluating:
 * {| style="width:100%" border="0" align="left"

$$R_{n+2}=\frac{1}{(n+1)!}(x-x_{0})^{n+1}f^{n+1}(x_{0})+\frac{1}{(n+1)!}\int_{x_{0}}^{x}(x-t)^{n+1}f^{n}(t)dt$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

4. IMVT
Starting with equation 3 on page 3-3: $$R_{n+1}(x)=\frac{1}{n!}\int_{x_{0}}^{x}(x-t)^{n}f^{n+1}(t)dt$$ Apply IMVT: $$\frac{f^{n+1}(\xi)}{n!}\int_{x_{0}}^{x}(x-t)^{n}dt$$ Integrate: $$\frac{f^{n+1}(\xi)}{n!}\frac{1}{n+1}\left[ (x-t)^{n+1} \right]_{x_{0}}^{x}$$ Simplifying:
 * {| style="width:100%" border="0" align="left"

$$R_{n+1}=\frac{(x-x_{0})^{n+1}}{(n+1)!}f^{(n+1)}(\xi)$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
 cavalcanti

[Proof-reader]

= Problem 5 - Verify NIST Handbook = From (meeting 7 page 5)

Given
The following table from wikipedia:

Legendre Polynomials Table

Find
Verify the table against the NIST Handbook.

NIST Handbook

Solution
''' We solved this problem on our own. '''

Using octave, the values of the Wikipedia table were calculated to 5 decimal places: Comparing with the NIST table, we have:


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

Only the weights for $$n=5$$ are shown on the NIST website. The Wikipedia values are correct.
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

Author and proof-reader
 cavalcanti

[Proof-reader]

= Problem 7 - Orthogonality of $$P_{n}$$ = from meeting page 9-1

Given
The Legendre polynomials $$P_{n}$$ (meeting 8).

Find
Verify that $$\left \{ P_{i}(x), i=0,1,2,...\right \}$$ is orthogonal function for $$ n=0,1,...,5$$. 1. Show that $$\Gamma$$ is diagonal. 2. Find the determinant of $$\Gamma$$.

Solution
 We solved this problem on our own, using values from Wolfram Alpha 

As per meeting 8, the Legendre polynomials are as follows: $$\mathbf{P}_{0}(x)=1$$ $$\mathbf{P}_{1}(x)=x$$ $$\mathbf{P}_{2}(x)=\frac{1}{2}(3x^2-1)$$ $$\mathbf{P}_{3}(x)=\frac{1}{2}(5x^3-3x)$$ $$\mathbf{P}_{4}(x)=\frac{35}{8}(x^4-\frac{15}{4}x^2+\frac{3}{8})$$ $$\mathbf{P}_{5}(x)=\frac{1}{8}(63x^5-70x^3+15x)$$ To solve this, the Gram matrix should be constructed as follows: $$\mathbf{\Gamma} = \begin{vmatrix}\mathbf{\Gamma}_{ij} \end{vmatrix} = \begin{vmatrix} <\mathbf{P}_{i},\mathbf{P}_{j}> \end{vmatrix} $$, where i = rows and j = columns.

1. Proof that $$\mathbf{\Gamma}$$ is diagonal matrix
Expanding the Gram matrix, we get: $$ \begin{vmatrix} <\mathbf{P}_{0},\mathbf{P}_{0}> & <\mathbf{P}_{0},\mathbf{P}_{1}> & <\mathbf{P}_{0},\mathbf{P}_{2}> & <\mathbf{P}_{0},\mathbf{P}_{3}> & <\mathbf{P}_{0},\mathbf{P}_{4}> & <\mathbf{P}_{0},\mathbf{P}_{5}>\\ <\mathbf{P}_{1},\mathbf{P}_{0}> & <\mathbf{P}_{1},\mathbf{P}_{1}> & <\mathbf{P}_{1},\mathbf{P}_{2}> & <\mathbf{P}_{1},\mathbf{P}_{3}> & <\mathbf{P}_{1},\mathbf{P}_{4}> & <\mathbf{P}_{1},\mathbf{P}_{5}>\\ <\mathbf{P}_{2},\mathbf{P}_{0}> & <\mathbf{P}_{2},\mathbf{P}_{1}> & <\mathbf{P}_{2},\mathbf{P}_{2}> & <\mathbf{P}_{2},\mathbf{P}_{3}> & <\mathbf{P}_{2},\mathbf{P}_{4}> & <\mathbf{P}_{2},\mathbf{P}_{5}>\\ <\mathbf{P}_{3},\mathbf{P}_{0}> & <\mathbf{P}_{3},\mathbf{P}_{1}> & <\mathbf{P}_{3},\mathbf{P}_{2}> & <\mathbf{P}_{3},\mathbf{P}_{3}> & <\mathbf{P}_{3},\mathbf{P}_{4}> & <\mathbf{P}_{3},\mathbf{P}_{5}>\\ <\mathbf{P}_{4},\mathbf{P}_{0}> & <\mathbf{P}_{4},\mathbf{P}_{1}> & <\mathbf{P}_{4},\mathbf{P}_{2}> & <\mathbf{P}_{4},\mathbf{P}_{3}> & <\mathbf{P}_{4},\mathbf{P}_{4}> & <\mathbf{P}_{4},\mathbf{P}_{5}>\\ <\mathbf{P}_{5},\mathbf{P}_{0}> & <\mathbf{P}_{5},\mathbf{P}_{1}> & <\mathbf{P}_{5},\mathbf{P}_{2}> & <\mathbf{P}_{5},\mathbf{P}_{3}> & <\mathbf{P}_{5},\mathbf{P}_{4}> & <\mathbf{P}_{5},\mathbf{P}_{5}> \end{vmatrix} $$ To evaluate the dot product of two functions, we use: $$\int_{-1}^{1}\mathbf{P}_{i}(x)\mathbf{P}_{j}(x)dx=\delta _{i,j}$$. Evaluating the elements: $$ <\mathbf{P}_{0},\mathbf{P}_{0}> = \int_{-1}^{1}1(1)dx=2$$

$$<\mathbf{P}_{0},\mathbf{P}_{1}>= \int_{-1}^{1}1xdx=1-1=0$$

$$<\mathbf{P}_{0}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{2}(3x^2-1)=(1^{3}-1)-((-1)^{3}-(-1))=0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{3}> = \int_{-1}^{1}\frac{1}{2}(5x^3-3x)dx=\left ( \frac{5}{4}-\frac{3}{2}\right )-\left ( \frac{5}{4}-\frac{3}{2} \right ) =0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{4}> = \int_{-1}^{1}\frac{35}{8}(x^4-\frac{15}{4}x^2+\frac{3}{8})dx= \left( \frac{-1}{5}+\frac{5}{4}-\frac{3}{8} \right) - \left( \frac{-1}{5}+\frac{5}{4}-\frac{3}{8} \right)=0$$

$$ <\mathbf{P}_{0},\mathbf{P}_{5}> = \int_{-1}^{1}\frac{1}{8}(63x^5-70x^3+15x)dx= \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right) - \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right)=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{0}>=\int_{-1}^{1}xdx= 1-1=0$$

$$ <\mathbf{P}_{1},\mathbf{P}_{1}> = \int_{-1}^{1}x(x)dx=\frac{1}{3}\left [ x^3 \right ]_{-1}^{1}=\frac{2}{3}$$

$$<\mathbf{P}_{1}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{2}3x^{3}-xdx=\frac{1}{2}\left[ \frac{3}{4}x^{4}-\frac{1}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{2}\left(5x^{4}-4x^{2}\right)dx=\left[x^{5}-x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{38}{5}\left(x^{5}-\frac{15}{4}x^{3}+\frac{3}{8}x\right)dx=\left[ \frac{1}{6}x^{6}-\frac{15}{16}x^{4}+\frac{3}{16}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{1}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{8}(64x^{6}-70x^{4}+15x^{2})dx=\left[ \frac{64}{7}x^{7}-14x^{5}+5x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{0}>=\int_{-1}^{1}\frac{1}{2}(3x^{2}-1)dx=\left[ x^{3}-x\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{2}(3x^{3}-x)dx=\left[ \frac{3}{4}x^{4}-\frac{1}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2},\mathbf{P}_{2}> = \int_{-1}^{1}\left ( \frac{1}{2}\left ( 3x^2-1 \right ) \right )\left ( \frac{1}{2}\left ( 3x^2-1 \right ) \right )dx = \frac{1}{4}\int_{-1}^{1} 9x^4-6x^2+1dx = \frac{1}{4}\left [ \frac{9}{5}x^5-2x^3+x \right ]_{-1}^{1}=\frac{2}{5}$$

$$<\mathbf{P}_{2}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{4}\left( 15x^{5}-14x^{3}+3x \right)dx=\left[\frac{15}{6}x^{6}-\frac{14}{4}x^{4}+\frac{3}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{35}{16}\left( 3x^6-\frac{49}{4}x^4-\frac{21}{8}x^2-\frac{3}{8}\right)dx=\left[ \frac{3}{7}x^7-\frac{49}{20}x^5-\frac{7}{8}x^3-\frac{3}{8}x \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{2}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{16}\left( 189x^7 - 273x^5 +115x^3 -15x \right)dx= \left[ \frac{189}{8}x^8 - \frac{273}{6}x^6 + \frac{115}{4}x^4 -\frac{15}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{0}>=\int_{-1}^{1}\frac{1}{2}(5x^3 -3x)dx=\left[ \frac{5}{4}x^4 - \frac{3}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{2}(5x^4 - 3x^2)dx=\left[ x^5 - x^3 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{4}\left( 15x^{5}-14x^{3}+3x \right)dx=\left[\frac{15}{6}x^{6}-\frac{14}{4}x^{4}+\frac{3}{2}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{3},\mathbf{P}_{3}>=\int_{-1}^{1}\left ( \frac{1}{2}\left ( 5x^3-3x \right ) \right )\left ( \frac{1}{2}\left ( 5x^3-3x \right ) \right )dx= \frac{1}{4}\int_{-1}^{1}25x^6-30x^4+9x^2dx = \frac{-3}{2}$$ (| WA)

$$<\mathbf{P}_{3}, \mathbf{P}_{4}>=\int_{-1}^{1}\frac{35}{16}\left( 5x^7 - \frac{87}{4}x^5 + \frac{105}{8}x^3 - \frac{9}{8} \right)= \left[ \frac{5}{8}x^8 - \frac{87}{24}x^6 + \frac{105}{32}x^4 - \frac{9}{16}x^2 \right]_{-1}^{1} = 0$$

$$<\mathbf{P}_{3}, \mathbf{P}_{5}>=\int_{-1}^{1}\frac{1}{16}\left( 315x^8 -539x^6 - 135x^4 -45x \right)= 0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{1}>=\int_{-1}^{1}\int_{-1}^{1}\frac{38}{5}\left(x^{5}-\frac{15}{4}x^{3}+\frac{3}{8}x\right)dx=\left[ \frac{1}{6}x^{6}-\frac{15}{16}x^{4}+\frac{3}{16}x^{2}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{35}{16}\left( 3x^6-\frac{49}{4}x^4-\frac{21}{8}x^2-\frac{3}{8}\right)dx=\left[ \frac{3}{7}x^7-\frac{49}{20}x^5-\frac{7}{8}x^3-\frac{3}{8}x \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{4}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{35}{16}\left( 5x^7 - \frac{87}{4}x^5 + \frac{105}{8}x^3 - \frac{9}{8} \right)= \left[ \frac{5}{8}x^8 - \frac{87}{24}x^6 + \frac{105}{32}x^4 - \frac{9}{16}x^2 \right]_{-1}^{1} = 0$$

$$<\mathbf{P}_{4},\mathbf{P}_{4}> = \int_{-1}^{1}\left ( \frac{35}{8}\left ( x^4-\frac{15}{4}x^2+\frac{3}{8} \right ) \right )\left ( \frac{35}{8}\left ( x^4-\frac{15}{4}x^2+\frac{3}{8} \right ) \right )dx \approx 46.1407$$ (| WA)

$$<\mathbf{P}_{4},\mathbf{P}_{5}> = \int_{-1}^{1}\frac{35}{64}\left( x^4 - \frac{15}{4}x^2 + \frac{3}{8} \right)\left( 63x^5 - 70x^3 + 15x \right)dx = 0$$

$$<\mathbf{P}_{5},\mathbf{P}_{0}>= \int_{-1}^{1}\frac{1}{8}(63x^5-70x^3+15x)dx= \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right) - \left( \frac{63}{6}-\frac{70}{4}+\frac{15}{2} \right)=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{1}>=\int_{-1}^{1}\frac{1}{8}(64x^{6}-70x^{4}+15x^{2})dx=\left[ \frac{64}{7}x^{7}-14x^{5}+5x^{3}\right]_{-1}^{1}=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{2}>=\int_{-1}^{1}\frac{1}{16}\left( 189x^7 - 273x^5 +115x^3 -15x \right)dx= \left[ \frac{189}{8}x^8 - \frac{273}{6}x^6 + \frac{115}{4}x^4 -\frac{15}{2}x^2 \right]_{-1}^{1}=0$$

$$<\mathbf{P}_{5}, \mathbf{P}_{3}>=\int_{-1}^{1}\frac{1}{16}\left( 315x^8 -539x^6 - 135x^4 -45x \right)= 0$$

$$<\mathbf{P}_{5},\mathbf{P}_{4}> = \int_{-1}^{1}\frac{35}{64}\left( x^4 - \frac{15}{4}x^2 + \frac{3}{8} \right)\left( 63x^5 - 70x^3 + 15x \right)dx = 0$$

$$ <\mathbf{P}_{5},\mathbf{P}_{5}>=\int_{-1}^{1}\left ( \frac{1}{8}\left ( 65x^5-70x^3+15x \right ) \right )\left ( \frac{1}{8}\left ( 65x^5-70x^3+15x \right ) \right ) dx = 0.1818$$ (| WA) Our simplified matrix is:
 * {| style="width:100%" border="0" align="left"

$$ \begin{vmatrix} 2 & 0 & 0 & 0 & 0 & 0\\ 0 & 0.66 & 0 & 0 & 0 & 0\\ 0 & 0 & 0.4 & 0 & 0 & 0\\ 0 & 0 & 0 & -1.5 & 0 & 0\\ 0 & 0 & 0 & 0 & 46.14 & 0\\ 0 & 0 & 0 & 0 & 0 & 0.18 \end{vmatrix} $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Determinant of $$\Gamma$$
The determinant was calculated using the following Octave program: octave-3.2.4.exe.1> g=[2 0 0 0 0 0; 0 0.66 0 0 0 0; 0 0 0.4 0 0 0; 0 0 0 -1.5 0 0; 0 0 0 0 46.14 0; 0 0 0 0 0 0.18]; octave-3.2.4.exe.2> det(g) octave-3.2.4.exe.3> ans = -6.577
 * {| style="width:100%" border="0" align="left"

$$det(\boldsymbol{\Gamma})= -6.5777$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

= Problem 13 - Simple to Composite Rules = from meeting page 10-5

Given
1. The equations for the simple and composite Trapezoidal Rule. 2. The equations for the simple and composite Simpson's Rule.

Find
1. Show that the composite Trapezoidal rule can be obtained from the simple Trapezoidal Rule. 2. Show that the composite Simpson's rule can be obtained from the simple Simpson's Rule.

Solution
''' We solved this problem on our own. '''

1. Trapezoidal Rule.
The equation for the simple Trapezoidal rule, as stated in pg. 7-4, is: $$ I_{1}=\frac{b-a}{2}[f(a)+f(b)]$$, where our interval is $$[a,b]$$ and $$n = 1$$. Instead of having one panel, divide the interval in n panels. The new h is: $$ h=\frac{b-a}{n}$$ The composite rule can be found as follows: $$I_{n}=\sum_{i=1}^{n} \frac{h}{2}[f(x_{i-1} )+f(x_{i} )]$$ Expanding: $$I_{n}=\frac{h}{2}[f(x_{0} )+f(x_{1} )+f(x_{1} )+f(x_{2} )+f(x_{2} )+f(x_{3} )+...+f(x_{n-1} )+f(x_{n-1} )+f(x_{n} )]$$ Simplifying: $$ I_{n}=\frac{h}{2}[f(x_{0} )+2f(x_{1} )+2f(x_{2} )+2f(x_{3} )+...+2f(x_{n-1} )+f(x_{n} )]$$


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

$$I_{n}=h[\frac{f(x_{0} )}{2}+f(x_{1} )+f(x_{2} )+f(x_{3} )+...+f(x_{n-1} )+\frac{f(x_{n} )}{2}] $$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }

2. Simpson's Rule.
The equation for the simple Simpson's rules, as state in pg. 7-4 is: $$I_{2}=\frac{h}{3}[f_{0}+4f_{1}+f_{2}]$$, where our interval is $$[a,b]$$ and $$n=2$$. The composite rule can be found as follows: $$I_{n}=\frac{h}{3}[f(x_{0})+2\sum_{j=1}^{\frac{n}{2}-1} f(x_{2j}) + 4\sum_{j=1}^{\frac{n}{2}}f(x_{2j-1})+f(x_{n})]$$ Expanding:
 * {| style="width:100%" border="0" align="left"

$$ I_{n}=\frac{h}{3} [f(x_{0})+4f(x_{1})+2f(x_{2})+4f(x_{3}) +2f(x_{4})+...+4f(x_{n-1})+f(x_{n})]$$
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * style="width:30%; padding:10px; border:2px solid #8888aa" align="center" |
 * }
 * }
 * }