User:Egm6341.s11.team2.franklin/hwk2

= 2.1 Generate Higher Order Terms of Taylor Series =

''' This problem was solved referring to Team 3, S10 homework. '''

From the lecture slide Mtg 6-2

Given
Taylor Series equation below


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

$$ $$
 * $$\displaystyle f(x) = f(x_0) + \frac{(x-x_0)}{1!}\ f^{(1)}(x_0) + \int_{x_0}^{x} (x-t) f^{(2)}(t)\ dt.
 * $$\displaystyle f(x) = f(x_0) + \frac{(x-x_0)}{1!}\ f^{(1)}(x_0) + \int_{x_0}^{x} (x-t) f^{(2)}(t)\ dt.
 * $$\displaystyle (1.1)
 * }
 * }

Find
(1) Repeat integration by parts on the Taylor Series to reveal the following items with remainder.


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

$$ $$
 * $$\displaystyle \frac{(x-x_0)^2}{2!}\ f^{(2)}(x_0) + \frac{(x-x_0)^3}{3!}\ f^{(3)}(x_0)
 * $$\displaystyle \frac{(x-x_0)^2}{2!}\ f^{(2)}(x_0) + \frac{(x-x_0)^3}{3!}\ f^{(3)}(x_0)
 * $$\displaystyle
 * }
 * }

(2) Assume Eqn 3 and Eqn 4 in [[media:nm1.s11.mtg3.djvu|Mtg3-3]] are true, do integration by parts one more time.

1 Integration by Parts
Integrate $$\int_{x_0}^{x} (x-t){f^{(2)}(t)} dt $$ by parts in Eq 1.


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

\int_{x_0}^{x} \underbrace{(x-t)}_{U^\prime} \underbrace{f^{(2)}(t)}_{V}\, dt & = \left [ UV \right ]_{x_0}^x -  \int_{t=x} UV^\prime\, dt \\ & = \left [ -\frac{(x-t)^2}{2}\ f^{(2)}(t) \right ]_{t=x_0}^{t=x} + \underbrace{\int_{x_0}^{x} \frac{(x-t)^2}{2}f^{(3)}(t)\, dt}_{W1} \\ & = \cancelto{o}{-\frac{(x-x)^2}{2}\ f^{(2)}(x)} + \frac{(x-x_0)^2}{2}\ f^{(2)}(x_0) + W1\\ & = \frac{(x-x_0)^2}{2!}\ f^{(2)}(x_0) + W1\\ \end{align} $$ $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * $$\displaystyle (1.2)
 * }
 * }

Use Eq 1.1, Eq 1.2, we have
 * {| style="width:100%" border="0" align="left"

$$ $$
 * $$\Rightarrow \ 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{1}{2!}\int_{x_0}^{x} {(x-t)^2}f^{(3)}(t)\ dt.
 * $$\Rightarrow \ 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{1}{2!}\int_{x_0}^{x} {(x-t)^2}f^{(3)}(t)\ dt.
 * $$\displaystyle (1.3)
 * }
 * }

Integrate $$\int_{x_0}^{x} {(x-t)^2}f^{(3)}(t)\,dt $$ by part one more time in Eq 1.3.
 * {| style="width:100%" border="0" align="left"

\int_{x_0}^{x} \underbrace{(x-t)^2}_{U^\prime} \underbrace{f^{(3)}(t)}_{V}\, dt & = \left [ UV \right ]_{x_0}^x -  \int_{t=x} UV^\prime\, dt \\ & = \left [ -\frac{(x-t)^3}{3}\ f^{(3)}(t) \right ]_{t=x_0}^{t=x} + \underbrace{\int_{x_0}^{x} \frac{(x-t)^3}{3}f^{(4)}(t)\, dt}_{W2} \\ & = \cancelto{o}{-\frac{(x-x)^3}{3}\ f^{(3)}(x)} + \frac{(x-x_0)^3}{3}\ f^{(3)}(x_0) + W2\\ & = \frac{(x-x_0)^3}{3}\ f^{(3)}(x_0) + W2\\ \end{align} $$ $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * $$\displaystyle (1.4)
 * }
 * }

Use Eq 1.3 and Eq 1.4, we have

2 Integration by Parts, Again
Int. $$\int_{x_0}^{x} {(x-t)^n}f^{(n+1)}(t)\,dt $$ by part one more time:


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

\int_{x_0}^{x} \underbrace{(x-t)^n}_{U^\prime} \underbrace{f^{(n+1)}(t)}_{V}\, dt & = \left [ UV \right ]_{x_0}^x -  \int_{t=x} UV^\prime\, dt \\ & = \left [ -\frac{(x-t)^{n+1}}{n+1}\ f^{(n+1)}(t) \right ]_{t=x_0}^{t=x} + \underbrace{\int_{x_0}^{x} \frac{(x-t)^{n+1}}{n+1}f^{(n+2)}(t)\, dt}_{W} \\ & = \cancelto{o}{-\frac{(x-x)^{n+1}}{n+1}\ f^{(n+1)}(x)} + \frac{(x-x_0)^{n+1}}{n+1}\ f^{(n+1)}(x_0) + W\\ & = \frac{(x-x_0)^{n+1}}{n+1}\ f^{(n+1)}(x_0) + W\\ \end{align} $$ $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * $$\displaystyle (1.6)
 * }
 * }

Use Eqn 1.6, Eqn 3 and Eqn 4 in [[media:nm1.s11.mtg3.djvu|Mtg3-3]], we have

=Problem 2.6=

Given
The equation for the Lagrange Polynomial is,


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

{P}_{n}(x) = \sum_{i=0}^{[n/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

and the equations for $$\displaystyle P_0\left(x\right) $$ through $$\displaystyle P_4\left(x\right). $$


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

\begin{align} &{P}_{0}(x) = 1\\ &{P}_{1}(x) = x\\ &{P}_{2}(x) = \frac {1}{2}(3x^{2}-1)\\ &{P}_{3}(x) = \frac {1}{2}(5x^{3}-3x)\\ &{P}_{4}(x) = \frac {35}{8}x^{4} - \frac {15}{4}x^{2} + \frac {3}{8}\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Find
Show that the equations for $$\displaystyle P_0\left(x\right) $$ through $$\displaystyle P_4\left(x\right) $$ can be written as $$\displaystyle P_n\left(x\right). $$

Solution
i) n=0
 * {| style="width:100%" border="0"

\begin{align} {P}_{0}(x) &= \sum_{i=0}^{[0/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!}\\ &= 1 \cdot \frac {1 \cdot 1} {1\cdot 1 \cdot 1 \cdot 1}\\ {P}_{0}(x)&= 1\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

ii) n=1
 * {| style="width:100%" border="0"

\begin{align} {P}_{1}(x) &= \sum_{i=0}^{[1/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!}\\ &=(-1)^{0} \cdot \frac {2! \cdot x^{1}} {2^{1}\cdot 0! \cdot 1! \cdot 1!} = 1 \cdot \frac {\cancel {2} \cdot x} {\cancel {2} \cdot 1 \cdot 1 \cdot 1} \\ {P}_{1}(x)&= x\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

iii) n=2
 * {| style="width:100%" border="0"

\begin{align} {P}_{2}(x) &= \sum_{i=0}^{[2/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!}\\ &=(-1)^{0} \cdot \frac {(4)! \cdot x^{2}} {2^{2}\cdot 0! \cdot (2)! \cdot (2)!} + (-1)^{1} \cdot \frac {(4-2)! \cdot x^{2-2}} {2^{2}\cdot 1! \cdot (2-1)! \cdot (2-2)!}\\ &= 1 \cdot \frac {4 \cdot 3 \cdot 3 \cdot x^{2}}{4 \cdot 1 \cdot 2 \cdot 2} + (-1) \cdot \frac {2 \cdot 1}{4 \cdot 1 \cdot 1 \cdot 1} = \frac {3}{2}x^{2}-\frac {1}{2})\\ {P}_{2}(x)&= \frac {1}{2}(3x^{2}-1)\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

iv) n=3
 * {| style="width:100%" border="0"

\begin{align} {P}_{3}(x) &= \sum_{[i=0]}^{[3/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!} \\ &=(-1)^{0} \cdot \frac {6! \cdot x^{3}} {2^{3}\cdot 0! \cdot 3! \cdot 3!} + (-1)^{1} \cdot \frac {4! \cdot x^{1}} {2^{3}\cdot 1! \cdot 2! \cdot 1!} \\ &= 1 \cdot \frac {6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot x^{3}} {8 \cdot 1 \cdot 3 \cdot 2 \cdot 3 \cdot 2} + (-1) \cdot \frac {4 \cdot 3 \cdot 2 \cdot x^{1}} {8\cdot 1 \cdot 2 \cdot 1} = \frac {5}{2}x^{3} - \frac {3}{2} x \\ {P}_{3}(x)&= \frac {1}{2}(5x^{3}-3x)\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

v) n=5
 * {| style="width:100%" border="0"

\begin{align} {P}_{4}(x) &= \sum_{[i]=0}^{[4/2]} (-1)^{i} \cdot \frac {(2n-2i)! \cdot x^{n-2i}} {2^{n}\cdot i! \cdot (n-i)! \cdot (n-2i)!}\\ &= (-1)^{0} \cdot \frac {8! \cdot x^4} {2^{4}\cdot 0! \cdot 4! \cdot 4!} + (-1)^{1} \cdot \frac {6! \cdot x^2} {2^{4}\cdot 1! \cdot 3! \cdot 2!} + (-1)^{2} \cdot \frac {4! \cdot x^0} {2^{4}\cdot 2! \cdot 2! \cdot 0!} \\ &= 1 \cdot \frac {8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot x^4} {16 \cdot 1 \cdot 4 \cdot 3 \cdot 2 \cdot 4 \cdot 3 \cdot 2} + (-1) \cdot \frac {6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot x^2} {16 \cdot 1 \cdot 3 \cdot 2 \cdot 2} + 1 \cdot \frac {4 \cdot 3 \cdot 2 \cdot 1} {16 \cdot 2 \cdot 2 \cdot 1} \\ {P}_{4}(x)&= \frac {35}{8}x^{4} - \frac {15}{4}x^{2} + \frac {3}{8}\\ \end{align} $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

=Problem 2.11: Proof of the Simple Simpson's Rule =

Given
The Lagrange Interpretation Equation,


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

P_2(x_j)=\sum_{k=0}^2 l_{i,2}(x_j)f(x_i). $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Find
Derive the Simple Simpson's rule from the above Lagrange Interpolation Equation of degree 2. The Simple Simpson's rule is as follows,


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

I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)] , $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

where


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

h=\dfrac{b-a}{2}. $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

Solution
By definition,
 * {| style="width:100%" border="0"

I_2 = \int_{a}^{b} P_2(x)\ dx $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">
 * }
 * }

Evaluating the above integral gives


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

I_2 & = \int_{a}^{b} P_2(x)\ dx \\ & = \int_{a}^{b} \sum_{i=0}^{2}l_i(x)f(x_i)\ dx \\ & = \int_{a}^{b} l_0(x)f(x_0) + l_1(x)f(x_1) + l_2(x)f(x_2)\ dx \\ & = f(x_0)\int_{a}^{b} l_0(x)\ dx + f(x_1)\int_{a}^{b} l_1(x)\ dx + f(x_2)\int_{a}^{b} l_2(x)\ dx , \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">(Eqs11.1-4)
 * }
 * }

where $$ \displaystyle x_0 = a, x_1 = \frac{a+b}{2}, $$ and $$\displaystyle x_2 = b .$$

Next, integrate $$\displaystyle l_0(x), l_1(x),$$ and $$\displaystyle l_2(x). $$

1)$$\displaystyle I_0 $$


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

\int_{a}^{b} l_0(x)\ dx & = \int_{a}^{b}\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}\ dx \\ & = \int_{a}^{b}\frac{(x-\frac{a+b}{2})(x-b)}{(a-\frac{a+b}{2})(a-b)}\ dx \\ & = \frac{2}{(b-a)^2}\left [ \frac{x^3}{3} - \frac{a+3b}{4}x^2 + \frac{b(a+b)}{2}x \right ]_{a}^b \\ & = \frac{2}{(b-a)^2} \left [ \frac{(b-a)(b^2 + ab + a^2)}{3} - \frac{a+3b}{4}(b-a)(b+a) + \frac{b(a+b)}{2}(b-a) \right ] \\ & = \frac{2}{(b-a)} \left [ \frac{(b^2 + ab + a^2)}{3} - \frac{a+3b}{4}(b+a) + \frac{b(a+b)}{2} \right ] \\ & = \frac{(b-a)^2}{6(b-a)} \\ & = \frac{b-a}{6}\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">(Eqs11.4-11)
 * }
 * }

2)$$\displaystyle I_1 $$


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

\int_{a}^{b} l_1(x)\ dx & = \int_{a}^{b}\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}\ dx \\ & = \int_{a}^{b}\frac{(x-a)(x-b)}{(\frac{a+b}{2}-a)(\frac{a+b}{2}-b)}\ dx \\ & = \frac{4}{(b-a)(a-b)}\left [ \frac{x^3}{3} - \frac{a+b}{2}x^2 + abx \right ]_{a}^b \\ & = \frac{4}{(b-a)(a-b)}\left [ \frac{(b-a)(b^2+ab+a^2)}{3} - \frac{(a+b)(a+b)(a-b)}{2} + ab(b-a) \right ]_{a}^b \\ & = \frac{4}{(a-b)}\left [ \frac{(b^2+ab+a^2)}{3} - \frac{(a+b)(a+b)}{2} + ab \right ]_{a}^b \\ & = \frac{2(b-a)^2}{3(b-a)} \\ & = \frac{2(b-a)}{3}\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">(Eqs11.11-18)
 * }
 * }

3)$$\displaystyle I_2 $$


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

\int_{a}^{b} l_2(x) \ dx & = \int_{a}^{b}\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}\ dx \\ & = \int_{a}^{b}\frac{(x-a)(x-\frac{a+b}{2})}{(b-a)(b-\frac{a+b}{2})}\ dx \\ & = \frac{2}{(b-a)^2}\left [ \frac{x^3}{3} - \frac{3a+b}{4}x^2 + \frac{a(a+b)}{2}x \right ]_{a}^b \\ & = \frac{2}{(b-a)^2} \left [ \frac{(b-a)(b^2 + ab + a^2)}{3} - \frac{3a+b}{4}(b-a)(b+a) + \frac{b(a+b)}{2}(b-a) \right ] \\ & = \frac{2}{(b-a)} \left [ \frac{(b^2 + ab + a^2)}{3} - \frac{3a+b}{4}(b+a) + \frac{b(a+b)}{2} \right ] \\ & = \frac{(b-a)^2}{6(b-a)} \\ & = \frac{b-a}{6}\\ \end{align} $$
 * $$ \displaystyle \begin{align}
 * $$ \displaystyle \begin{align}
 * <p style="text-align:right;">(Eqs11.18-26)
 * }
 * }

Substituting the values for the integrals of $$\displaystyle l_0(x), l_1(x),$$ and $$\displaystyle l_2(x). $$ into Eqn 11.4 gives


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

\begin{align} I_2 & = f(x_0)\frac{b-a}{6}+f(x_1)\frac{2(b-a)}{3}+f(x_2)\frac{b-a}{6} \\ & = \frac{b-a}{6}[f(x_0)+4f(x_1)+f(x_2)]\\ \Rightarrow I_2 & = \frac{h}{3}[f(x_0)+4f(x_1)+f(x_2)], \\ \end{align} $$
 * $$ \displaystyle
 * $$ \displaystyle
 * }

where


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

h = \frac{b-a}{2}. $$ $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle
 * }
 * }

= Problem 2.13: Simple to Composite Trapezoidal and Simpson's Rules =

Given
The simple Trapezoidal rule is


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

I_1=\dfrac{b-a}{2}[f(a)+f(b)]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.1)
 * }
 * }

The simple Simpson's rule is


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

I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.2)
 * }
 * }

Find
Show that the simple Trapezoidal and Simpson's rules can be transformed into their respective composite forms.

The composite Trapezoidal rule is as follows


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

I_n=h[\dfrac{1}{2}f_0+f_1+...+\dfrac{1}{2}f_{n-1}]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.3)
 * }
 * }

The composite Simpson's rule is as follows


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

I_n=\dfrac{h}{3}[f_0+4f_1+2f_2+4f_3+2f_4+...+2f_{n-2}+4f_{n-1}+f_n]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.4)
 * }
 * }

Trapezoidal Rule
The Trapezoidal rule, $$\displaystyle n=1 $$, $$\displaystyle h $$ is equal to width of the interval $$\displaystyle [a,b] $$ is


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

I_1=\dfrac{x_1-x_0}{2}[f(x_0)+f(x_1)]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.5)
 * }
 * }

Next, the Trapezoidal rule, $$\displaystyle n=2 $$ is


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

I_2=\dfrac{x_1-x_0}{2}[f(x_0)+f(x_1))+\dfrac{x_2-x_1}{2}(f(x_1)+f(x_2)]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.6)
 * }
 * }

Combine terms.


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

I_2=\dfrac{h}{2}[f(x_0)+2f(x_1)+f(x_2)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.7)
 * }
 * }

Next, the Trapezoidal rule, $$\displaystyle n=4 $$ is


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

I_4=\dfrac{x_1-x_0}{2}[f(x_0)+f(x_1))+\dfrac{x_2-x_1}{2}(f(x_1)+f(x_2))+\dfrac{x_3-x_2}{2}(f(x_2)+f(x_3))+\dfrac{x_4-x_3}{2}(f(x_3)+f(x_4)]. $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.8)
 * }
 * }

Combine terms.


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

I_4=\dfrac{h}{2}[f(x_0)+2f(x_1)+2f(x_2)+2f(x_3)+f(x_4)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.9)
 * }
 * }

Finally, the composite Trapezoidal rule is

Simpson's Rule
Similarly, Simpson's rule, $$\displaystyle n=2 $$, $$\displaystyle h $$ is equal to width of the interval $$\displaystyle [a,b] $$ is


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

I_2=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.11)
 * }
 * }

Next, Simpson's rule, $$\displaystyle n=4 $$ is


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

I_4=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2))+\dfrac{h}{3}(f(x_2)+4f(x_3)+f(x_4)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.12)
 * }
 * }

Combine terms.


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

I_4=\dfrac{h}{3}[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+f(x_4)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.13)
 * }
 * }

Next, Simpson's rule, $$\displaystyle n=6 $$ is


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

I_6=\dfrac{h}{3}[f(x_0)+4f(x_1)+f(x_2))+\dfrac{h}{3}(f(x_2)+4f(x_3)+f(x_4))+\dfrac{h}{3}(f(x_4)+4f(x_5)+f(x_6)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.14)
 * }
 * }

Combine terms.


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

I_6=\dfrac{h}{3}[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+4f(x_5)+f(x_6)] $$
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">(Eq 13.15)
 * }
 * }

Finally, the composite Simpson's rule is