User:Egm6341.s11.team5/HW6

= Problem 6.1 - Proof of Trapezoidal error = From [[media:Nm1.s11.mtg31.djvu|Mtg 31-1,2]]

Given

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

$$  \displaystyle \boldsymbol{E=\left[P_2(t)g^{(1)}(t)+P_4(t)g^{(3)}(t) \right]_{-1}^{+1}- \int_{-1}^{+1}P_5(t)g^{(5)}(t)dt} $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * }
 * }


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

$$  \displaystyle P_4(t)=c_1(\frac{t^4}{4!})+c_3(\frac{t^2}{2!})+c_5$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |

$$

P_5(t)=c_1(\frac{t^5}{5!})+c_3(\frac{t^3}{3!})+c_5(t) $$

$$

c_1=-1, \qquad c_3 = \frac{1}{6}, \qquad c_5 = - \frac{7}{360} $$
 * }
 * }

Find
 Do steps 4ab to find (P6, P7) and E. 

Solution
''' Step 4a. Using int. by parts '''


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

E = [P_2 g^{(1)} + P_4 g^{(3)}]_{-1}^{+1} +[P_6 g^{(5)}]_{-1}^{+1} - \int_{-1}^{+1} P_6(t)g^{(6)}(t) dt $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * $$\displaystyle (1-1)
 * }


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

P_6(t) = \int P_5(t) dt = c_1 \cdot \frac{t^6}{6!} + c_3 \cdot \frac{t^4}{4!} + c_5 \cdot \frac{t^2}{2!} + c_7 $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * $$\displaystyle (1-2)
 * }


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


 * }
 * }

''' Step 4b. Using int. by parts '''


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

E = [P_2 g^{(1)} + P_4 g^{(3)} + P_6 g^{(5)}]_{-1}^{+1} +[P_7 g^{(6)}]_{-1}^{+1} - \int_{-1}^{+1} P_7(t)g^{(7)}(t) dt $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * $$\displaystyle (1-3)
 * }


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

P_7(t) = \int P_6(t) dt = c_1 \cdot \frac{t^7}{7!} + c_3 \cdot \frac{t^5}{5!} + c_5 \cdot \frac{t^3}{3!} + c_7 \cdot t + c_8 $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * $$\displaystyle (1-4)
 * }


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


 * }
 * }

 Similar to [[media:Nm1.s11.mtg30.djvu|(1) p. 30-7]] 

Consider $$\displaystyle P_7(t), \qquad P_7(0) = P_7(\pm 1) = 0 $$


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

P_7(0) = c_1 \cdot \frac{0}{7!} + c_3 \cdot \frac{0}{5!} + c_5 \cdot \frac{0}{3!} + c_7 \cdot (0) + c_8 = 0 $$
 * $$ \displaystyle
 * $$ \displaystyle

$$ \displaystyle \therefore c_8 = 0 $$ $$
 * $$\displaystyle (1-5)
 * }


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

P_7(\pm 1) = c_1 \cdot \frac{1}{7!} + c_3 \cdot \frac{1}{5!} + c_5 \cdot \frac{1}{3!} + c_7 \cdot (1) = 0 $$
 * $$ \displaystyle
 * $$ \displaystyle

$$ \displaystyle \therefore c_7 = \frac{31}{15120} \qquad \rightarrow$$ (WA result) $$
 * $$\displaystyle (1-6)
 * }

 Therefore 
 * {| style="width:60%" border="0"

$$  \displaystyle P_6(t)=c_1 \cdot \frac{t^6}{6!} + c_3 \cdot \frac{t^4}{4!} + c_5 \cdot \frac{t^2}{2!} + c_7 $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle

P_7(t)=c_1 \cdot \frac{t^7}{7!} + c_3 \cdot \frac{t^5}{5!} + c_5 \cdot \frac{t^3}{3!} + c_7 \cdot t $$

$$

c_1 = -1, \ c_3 = \frac{1}{6}, \ c_5 = - \frac{7}{360}, \ c_7 = \frac{31}{15120} $$
 * 
 * }


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

$$  \displaystyle \boldsymbol{E=\left[P_2(t)g^{(1)}(t)+P_4(t)g^{(3)}(t) + P_6(t)g^{(5)}(t) \right]_{-1}^{+1}- \int_{-1}^{+1}P_7(t)g^{(7)}(t)dt} $$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * }
 * }

Given

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

$$ $$
 * $$\displaystyle x(t) := \frac{x_k+x_{k+1}}{2} + t \cdot \frac{h}{2}, \qquad t \in [-1,+1], \ h = x_{k+1} - x_k
 * $$\displaystyle x(t) := \frac{x_k+x_{k+1}}{2} + t \cdot \frac{h}{2}, \qquad t \in [-1,+1], \ h = x_{k+1} - x_k
 * $$\displaystyle (1-7)
 * }
 * }


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


 * }.
 * }.
 * }.

Find

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


 * $$\displaystyle t_k(x) $$
 * }
 * }
 * }
 * }


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


 * }.
 * }.
 * }.

Solution

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

$$
 * $$\displaystyle (1-7) \rightarrow \ x(t_k) = \frac{x_k+x_{k+1}}{2} + t_k \cdot \frac{h}{2}$$
 * $$\displaystyle (1-8)
 * $$\displaystyle (1-8)
 * }
 * }


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

$$
 * $$\displaystyle t_k = \frac{2}{h} \left( x(t_k) - \frac{x_k+x_{k+1}}{2} \right) $$
 * $$\displaystyle (1-9)
 * $$\displaystyle (1-9)
 * }
 * }

.


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

$$\displaystyle t_k(x) = \frac{2}{h} \left( x - \frac{x_k+x_{k+1}}{2} \right) $$
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |


 * style= |


 * }
 * }


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


 * }
 * }
 * }

 Proof (1) 


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

$$
 * $$\displaystyle x(t_k=-1) = x_k  \Longleftrightarrow \ t_k(x=x_k) = -1 $$
 * $$\displaystyle (1-10)
 * $$\displaystyle (1-10)
 * }
 * }


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

$$
 * $$\displaystyle t_k(x_k) = \frac{2}{h} \left( x_k - \frac{x_k + x_{k+1}}{2} \right) = \frac{2}{h} \left( \underbrace{\frac{x_{k+1} - x_k}{2}}_{= \frac{h}{2}} \right) \cdot (-1) = -1 $$
 * $$\displaystyle (1-11)
 * $$\displaystyle (1-11)
 * }
 * }


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


 * }
 * }
 * }

 Proof (2) 


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

$$
 * $$\displaystyle x(t_k=0) = \frac{x_k + x_{k+1}}{2}  \Longleftrightarrow \ t_k(x=\frac{x_k + x_{k+1}}{2}) = 0 $$
 * <p style="text-align:right;">$$\displaystyle (1-12)
 * <p style="text-align:right;">$$\displaystyle (1-12)
 * }
 * }


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

$$
 * $$\displaystyle t_k(\frac{x_k + x_{k+1}}{2}) = \frac{2}{h} \left( \frac{x_k + x_{k+1}}{2} - \frac{x_k + x_{k+1}}{2} \right) = 0  $$
 * <p style="text-align:right;">$$\displaystyle (1-13)
 * <p style="text-align:right;">$$\displaystyle (1-13)
 * }
 * }


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


 * }
 * }
 * }

 Proof (3) 


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

$$
 * $$\displaystyle x(t_k=+1) = x_{k+1} \Longleftrightarrow \ t_k(x=x_{k+1}) = +1 $$
 * <p style="text-align:right;">$$\displaystyle (1-14)
 * <p style="text-align:right;">$$\displaystyle (1-14)
 * }
 * }


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

$$.
 * $$\displaystyle t_k(x_{k+1}) = \frac{2}{h} \left( x_{k+1} - \frac{x_k + x_{k+1}}{2} \right) = \frac{2}{h} \left( \underbrace{ \frac{ x_{k+1} - x_k }{2}}_{= \frac{h}{2}} \right) = +1 $$
 * <p style="text-align:right;">$$\displaystyle (1-15)
 * <p style="text-align:right;">$$\displaystyle (1-15)
 * }
 * }

Given

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

d_{r} = \bar{d_{2r}} = \frac{P_{2r}(1)}{2^{2r}} $$ $$ . <br\>
 * $$\displaystyle
 * $$\displaystyle
 * <p style="text-align:right;">$$\displaystyle (1-16)
 * }
 * }

Find
$$\displaystyle d_1, \ d_2, \ d_3 $$

Solution
 We already knew that 

$$\displaystyle

P_2(t)=c_1 \cdot \frac{t^2}{2!} + c_3 $$

$$\displaystyle

P_4(t)=c_1 \cdot \frac{t^4}{4!} + c_3 \cdot \frac{t^2}{2!} + c_5 $$

$$  \displaystyle P_6(t)=c_1 \cdot \frac{t^6}{6!} + c_3 \cdot \frac{t^4}{4!} + c_5 \cdot \frac{t^2}{2!} + c_7 $$

$$

c_1 = -1, \ c_3 = \frac{1}{6}, \ c_5 = - \frac{7}{360}, \ c_7 = \frac{31}{15120} $$


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

$$\displaystyle d_{1} = \bar{d_{2}} = \frac{P_{2}(1)}{2^2}=\frac{1}{4} \cdot \left( \frac{-1}{2!} + \frac{1}{6} \right) = -\frac{1}{12}$$ (WA result)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }


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

$$\displaystyle d_{2} = \bar{d_{4}} = \frac{P_{4}(1)}{2^4}=\frac{1}{16} \cdot \left( \frac{-1}{4!} + \frac{1}{6} \cdot \frac{1}{2!} + \left( - \frac{7}{360} \right) \right)=\frac{1}{720} $$ (WA result)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }


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

$$\displaystyle d_{3} = \bar{d_{6}} = \frac{P_{6}(1)}{2^6}=\frac{1}{64} \cdot \left( \frac{-1}{6!} + \frac{1}{6} \cdot \frac{1}{4!} + \left( - \frac{7}{360} \cdot \frac{1}{2!} \right) + \frac{31}{15120} \right) = -\frac{1}{30240} $$ (WA result)
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style="width:10%; padding:10px; border:2px solid #8888aa" |
 * style = |
 * }
 * }


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


 * style = |
 * }
 * }

Author and proof-reader
[Author] Oh

[Proof-reader]

= Problem 6.2 - Derive equations (1) and (2) from p31-1 = From [[media:Nm1.s11.mtg31.djvu|Mtg 31-3]]

Given
The following equations: $$E=\int_{-1}^{+1} p_{1}(t)g^{(1)}(t)dt = \left[ p_{2}(t)g^{(1)}(t)\right]_{-1}^{+1}- \int_{-1}^{+1} p_{2}(t)g^{(2)}(t)dt$$

Find
Derive: $$E_{n}^{T}=\sum_{r=1}^{l}h^{2r}\bar{d_{2r}}\left[ f^{(2r-1)}(b)-f^{(2r-1)}(a)\right]-\left(\frac{h}{2} \right)^{2l}\sum_{k=0}^{n-1}\int_{x_{k}}^{x_{k+1}}p_{2l}(t_{k}(x))f^{(2l)}(x)dx $$ And: $$\bar{d_{2r}}=\frac{p_{2r}(1)}{2^{2r}}$$

Solution
Starting with the integral: $$E=\int_{-1}^{+1}p_{1}(t)g^{1}(t)dt = \left[p_{2}(t)g^{(1)}(t)+p_{4}(t)g^{(3)}(t)+...+p_{2l}(t)g^{(2l-1)}(t)\right]_{-1}^{+1}- \int_{-1}^{+1}p_{2l}(t)g^{(2l)}(t)dt$$ When evaluating, the even polynomials can be simplified as: $$p_{2}(-1)=p_{2}(+1)$$, $$p_{4}(-1)=p_{4}(+1)$$, ..., $$p_{2l}(-1)=p_{2l}(+1)$$. Therefore, $$E=\sum_{r=1}^{l}p_{2r}(+1)\left[ g^{(2r-1)}(+1)-g^{(2r-1)}(-1) \right] - \int_{-1}^{+1}p_{2l}(t)g^{(2l)}(t)dt$$ Changing the variable: $$g^{(2r-1)}(+1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(b)$$ $$g^{(2r-1)}(-1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(a)$$ Putting it back into the equation, we have: $$E=\sum_{r=1}^{l}p_{2r}(+1)\left(\frac{h}{2}\right)\left(\frac{h}{2}\right)^{2r-1}\left[ f^{(2r-1)}(b)-f^{(2r-1)}(a) \right] - \sum_{k=1}^{n-1}\int_{-1}^{+1}p_{2l}(t)g^{(2l)}(t)dt$$ $$E=\sum_{r=1}^{l}p_{2r}(+1)\left(\frac{h}{2}\right)^{2r}\left[ f^{(2r-1)}(b)-f^{(2r-1)}(a) \right] - \sum_{k=1}^{n-1}\int_{-1}^{+1}p_{2l}(t_{k}(x))f^{(2l)}(x)dx$$ Letting
 * {| style="width:60%" border="0"

$$\bar{d_{2r}}=\frac{p_{2r}(+1)}{2^{2r}}$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * }
 * }

We then get:


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

$$E=\sum_{r=1}^{l}\bar{d_{2r}}h^{2r}\left[ f^{(2r-1)}(b)-f^{(2r-1)}(a) \right] - \sum_{k=1}^{n-1}\int_{-1}^{+1}p_{2l}(t_{k}(x))f^{(2l)}(x)dx$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * }
 * }

Author and proof-reader
[Author]cavalcanti

[Proof-reader]

=''' Problem 6.3 - Verify Bernauli number & compare it with end point of HORTE. '''= From [[media:Nm1.s11.mtg31.djvu|Mtg 31-3]]

Given
Bernoulli numbers: $$\displaystyle \frac{x}{{{e}^{x}}-1}=\sum\limits_{r=0}^{\infty }{\underbrace{\frac{(2r)!}}_{-{{{\bar{d}}}_{2r}}}{{x}^{2r}}} $$

Find
1)Verify $${{\bar{d}}_{2}},{{\bar{d}}_{4}},{{\bar{d}}_{6}}$$ 2)Find $${{\bar{d}}_{8}},{{\bar{d}}_{10}}$$ using above given expression, compare it to $${{\bar{d}}_{2r}}=\frac{{{P}_{2r}}(1)}$$, where $${{P}_{2r}}(1)$$ is the polynomial of HOTRE evaluated at $$x=1$$.

Solution
Using Taylor Series to expand $$\frac{1}{{{e}^{x}}-1}$$ at $${{x}_{0}}=0$$. We have $$\displaystyle\frac{1}{{{e}^{x}}-1}=\frac{1}{x}-\frac{1}{2}+\frac{x}{12}-\frac{720}+\frac{30240}-\frac{1209600}+\frac{4700160}-\frac{691{{x}^{11}}}{130767436800}+\cdots $$ Verified with[WA] Thus,

$$\displaystyle \frac{x}{{{e}^{x}}-1}=1-\frac{x}{2}+\frac{12}-\frac{720}+\frac{30240}-\frac{1209600}+\frac{4700160}-\frac{691{{x}^{12}}}{130767436800}+\cdots ={{B}_{0}}+{{B}_{1}}x+\frac{2!}{{x}^{2}}+\frac{4!}{{x}^{4}}+\frac{6!}{{x}^{6}}+\frac{8!}{{x}^{8}}+\frac{10!}{{x}^{10}}+\frac{12!}{{x}^{12}}+\cdots $$ Comparing it to the above equation, we get the following : $$\displaystyle {{B}_{2}}=\frac{1}{6} $$ $$\displaystyle {{B}_{4}}=-\frac{1}{30} $$ $$\displaystyle{{B}_{6}}=\frac{1}{42} $$ $$\displaystyle {{B}_{8}}=-\frac{1}{30}$$ $$\displaystyle {{B}_{10}}=\frac{5}{66}$$

Thus, $$\displaystyle {{{\bar{d}}}_{2}}=-\frac{1}{12}$$ $$\displaystyle {{{\bar{d}}}_{4}}=\frac{1}{720}$$ $$\displaystyle {{{\bar{d}}}_{6}}=-\frac{1}{30240}$$ $$\displaystyle {{{\bar{d}}}_{8}}=\frac{1}{1209600} $$ $$\displaystyle{{{\bar{d}}}_{10}}=-\frac{1}{\text{47900160}} $$

We alreeady know the following from higher order trapezoidal rule error theorm: $$\displaystyle {{P}_{2}}=-\frac{2!}+\frac{1}{6}$$ $$\displaystyle {{P}_{4}}=-\frac{4!}+\frac{1}{6}\frac{2!}-\frac{7}{360}$$ $$\displaystyle {{P}_{6}}=-\frac{6!}+\frac{1}{6}\frac{4!}-\frac{7}{360}\frac{2!}+\frac{31}{15120}$$ $$\displaystyle {{P}_{8}}=-\frac{8!}+\frac{1}{6}\frac{6!}-\frac{7}{360}\frac{4!}+\frac{31}{15120}\frac{2!}-\frac{5}{23811} $$ $$\displaystyle {{P}_{10}}=-\frac{10!}+\frac{1}{6}\frac{8!}-\frac{7}{360}\frac{6!}+\frac{31}{15120}\frac{4!}-\frac{5}{23811}\frac{2!}+\frac{11}{171629} $$

Therefore, $$\displaystyle {{{\bar{d}}}_{2}}=\frac{{{P}_{2}}(1)}=\frac{-\frac{1}{2!}+\frac{1}{6}}{4}=-\frac{1}{12}$$ $$\displaystyle {{{\bar{d}}}_{4}}=\frac{{{P}_{4}}(1)}=\frac{-\frac{1}{4!}+\frac{1}{6}\frac{1}{2!}-\frac{7}{360}}{16}=\frac{1}{720}$$ $$\displaystyle {{{\bar{d}}}_{6}}=\frac{{{P}_{6}}(1)}=\frac{-\frac{1}{6!}+\frac{1}{6}\frac{1}{4!}-\frac{7}{360}\frac{1}{2!}+\frac{31}{15120}}{64}=-\frac{1}{30240}$$ $$\displaystyle {{{\bar{d}}}_{8}}=\frac{{{P}_{8}}(1)}=\frac{-\frac{1}{8!}+\frac{1}{6}\frac{1}{6!}-\frac{7}{360}\frac{1}{4!}+\frac{31}{15120}\frac{1}{2!}-\frac{5}{23811}}{256}=\frac{1}{1209600} $$ $$\displaystyle {{{\bar{d}}}_{10}}=\frac{{{P}_{10}}(1)}=\frac{-\frac{1}{10!}+\frac{1}{6}\frac{1}{8!}-\frac{7}{360}\frac{1}{6!}+\frac{31}{15120}\frac{1}{4!}-\frac{5}{23811}\frac{1}{2!}+\frac{11}{171629}}{1024}=-\frac{1}{\text{47900160}} $$

Author and proof-reader
[Author] | Raghunathan

[Proof-reader]

= Problem 6.4 - Proof of High Order Trapezoidal Rule Error by cancelling terms with odd order of derivative of g = From [[media:Nm1.s11.mtg31.djvu|Mtg 31-4]]

Given
From the lecture notes [[media:Nm1.s11.mtg30.djvu|p.30-2]], the composite trapezoidal error is given as below.
 * {| style="width:100%" border="0"

$$\begin{align} E_n^T=\frac{h}{2}\sum_{k=0}^{n-1} \left[ \underbrace{\int_{-1}^{+1} \! g_k(t) \, \mathrm{d}t - \left\{ g_k(-1)+g_k(+1) \right\}}_{E} \right] \end{align}$$ (4-1)$$ $$\displaystyle E $$ can be written as below.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ E = \int_{-1}^{+1} \! p_1(t)g^{(1)}(t) \, \mathrm{d}t $$     (4-2)$$ where
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle p_1(t) = -t $$     (4-3)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Find
Derive the High Order Trapezoidal Rule Error by cancelling terms with odd order of derivative of $$\displaystyle g(t) $$

Solution
STEP 1: After integrating the equation (4-2) by part, the following is obtained.
 * {| style="width:100%" border="0"

$$ E = \underbrace{\left[ p_2(t)g^{(1)}(t) \right]_{-1}^{+1}}_{A1}-\int_{-1}^{+1} \! p_2(t)g^{(2)}(t) \, \mathrm{d}t $$     (4-4)$$ where
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ p_2(t) = \int \! p_1(t) \, \mathrm{d}t = -\frac{t^2}{2}+ \alpha \mbox{ } (\alpha \mbox{ is integration constant}) $$     (4-5)$$ In order to cancel terms with $$\displaystyle g^{(1)}(t)$$ i.e, make $$\displaystyle A1=0 $$, consider the following.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_2(-1)=p_2(1)=0 \end{align} $$     (4-6)$$ From the equation (4-5),
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_2(-1) & =-\frac{1}{2}+\alpha = 0 \\ &\rightarrow \alpha = \frac{1}{2} \end{align} $$     (4-7)$$  STEP 2: After applying the two times of integration by part to the equation (4-4), the following is obtained.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ E= -\left[ p_3(t)g^{(2)}(t) \right]_{-1}^{+1}+ \underbrace{\left[ p_4(t)g^{(3)}(t) \right]_{-1}^{+1}}_{A2}- \underbrace{\int_{-1}^{+1} \! p_4(t)g^{(4)}(t) \, \mathrm{d}t}_{B2} $$     (4-8)$$ where
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_3(t) &= \int \! p_2(t) \, \mathrm{d}t = -\frac{t^3}{3!}+ \frac{1}{2} t + \beta \\ p_4(t) &= \int \! p_3(t) \, \mathrm{d}t = -\frac{t^4}{4!}+ \frac{t^2}{4} +\beta t + \gamma \mbox{ } (\beta,\gamma \mbox{ are integration constants}) \end{align} $$     (4-9)$$ In order to make the term in the equation (4-8) $$\displaystyle A2=0 $$, consider the following.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_4(-1)=p_4(1)=0 \end{align} $$     (4-10)$$ From the equation (4-9),
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_4(-1) & =-\frac{1}{4!}+\frac{1}{4}-\beta+\gamma = 0 \\ p_4(1) & =-\frac{1}{4!}+\frac{1}{4}+\beta t+\gamma = 0 \\ \rightarrow \beta &= 0 \\ \gamma &= -\frac{5}{24} \end{align} $$     (4-11)$$ Summary,
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} p_2(t) &= -\frac{t^2}{2!}+\frac{1}{2} \\ p_3(t) &= -\frac{t^3}{3!}+\frac{t}{2} \\ p_4(t) & =-\frac{t^4}{4!}+\frac{t^2}{4} - \frac{5}{24} \end{align} $$     (4-11)$$  STEP 3: After integrating the term $$\displaystyle B2 $$ in the equation (4-8) by part, the following is true.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} E &= -\left[ p_3(t)g^{(2)}(t) \right]_{-1}^{+1}-\left[ p_5(t)g^{(4)}(t) \right]_{-1}^{+1} +\int_{-1}^{+1} \! p_5(t)g^{(5)}(t) \, \mathrm{d}t \\ &= -\left[ p_3(t)g^{(2)}(t) + p_5(t)g^{(4)}(t) \right]_{-1}^{+1} +\int_{-1}^{+1} \! p_5(t)g^{(5)}(t) \, \mathrm{d}t \end{align} $$     (4-12)$$ where
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * $$\displaystyle

p_5(t) = \int \! p_4(t) \, \mathrm{d}t $$ By continuing the similar steps above, the general expression of E can be computed as follows.
 * {| style="width:100%" border="0"

$$ \begin{align} E &= -\left[ p_3(t)g^{(2)}(t) + p_5(t)g^{(4)}(t) \right]_{-1}^{+1} +\int_{-1}^{+1} \! p_5(t)g^{(5)}(t) \, \mathrm{d}t \\ &= -\left[ p_3(t)g^{(2)}(t) + p_5(t)g^{(4)}(t)++ p_7(t)g^{(6)}(t) + \cdots + + p_{2l+1}(t)g^{(2l)}(t) \right]_{-1}^{+1} +\int_{-1}^{+1} \! p_{2l+1}(t)g^{(2l+1)}(t) \, \mathrm{d}t \\ &= \sum_{r=1}^{l} \left[ -p_{2r+1}(t)g^{2r}(t) \right]_{-1}^{+1} +\int_{-1}^{+1} \! p_{2l+1}(t)g^{(2l+1)}(t) \, \mathrm{d}t \\ &= \sum_{r=1}^{l} \left[ -p_{2r+1}(+1)g^{2r}(+1)+p_{2r+1}(-1)g^{2r}(-1) \right] +\int_{-1}^{+1} \! p_{2l+1}(t)g^{(2l+1)}(t) \, \mathrm{d}t \\ & p_{2r+1}(+1) = -p_{2r+1}(-1) \\ &= \sum_{r=1}^{l} p_{2r+1}(-1) \left[ g^{2r}(+1)+g^{2r}(-1) \right] +\int_{-1}^{+1} \! p_{2l+1}(t)g^{(2l+1)}(t) \, \mathrm{d}t \end{align} $$     (4-13)$$  STEP 4: From the equation (5) in the lecture notes [[media:Nm1.s11.mtg30.djvu|p.30-2]],
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} E_n^T &= \frac{h}{2} \sum_{k=0}^{n-1} \left[ \underbrace{\int_{-1}^{+1} \! g_k(t) \, \mathrm{d}t - \left\{ g_k(-1)+g_k(+1) \right\}}_{=E} \right] \\ &=\frac{h}{2}\sum_{r=1}^{l} \sum_{k=0}^{n-1} p_{2r+1}(-1) \left[ g_k^{2r}(+1)+g_k^{2r}(-1) \right] +\int_{-1}^{+1} \! p_{2l+1}(t)g_k^{(2l+1)}(t) \, \mathrm{d}t \end{align} $$     (4-14)$$ Also, from the lecture notes [[media:Nm1.s11.mtg30.djvu|p.30-3]],
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ g_k^{(i)}(t) = (\frac{h}{2})^i f^{(i)}(x(t)) \mbox{,  } x \in \left[ x_k, x_{k+1} \right] $$     (4-15)$$ Using the equation (4-15), the followings can be defined.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$ \begin{align} &g_k^{(2r)}(+1)=\left(\frac{h}{2}\right)^{2r}f^{(2r)}(x_{k+1}),\\ &g_k^{(2r)}(-1)=\left(\frac{h}{2}\right)^{2r}f^{(2r)}(x_{k}),\\ &g_k^{(2l+1)}(t)=\left(\frac{h}{2}\right)^{2l+1}f^{(2l+1)}(x_{t}) \end{align} $$     (4-16)$$ Substitute the equations (4-16) into the equation (4-14).
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }


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

$$ \begin{align} E_n^T &= \sum_{r=1}^{l} \sum_{k=0}^{n-1} \left( \frac{h}{2} \right)^{2r+1} p_{2r+1}(-1) \left[f^{(2r)}(x_{k+1})+f^{(2r)}(x_{k})\right] - \left(\frac{h}{2}\right)^{2l+2}\sum_{k=0}^{n-1} \int_{x_k}^{x_{k+1}} \! p_{2l+1}(t_k(x))f^{(2l+1)}(x) \, \mathrm{d}x \\ &= \sum_{r=1}^{l} \left( \frac{h}{2} \right)^{2r+1} p_{2r+1}(-1) \sum_{k=0}^{n-1}\left[f^{(2r)}(x_{k+1})+f^{(2r)}(x_{k})\right] - \left(\frac{h}{2}\right)^{2l+2}\sum_{k=0}^{n-1} \int_{x_k}^{x_{k+1}} \! p_{2l+1}(t_k(x))f^{(2l+1)}(x) \, \mathrm{d}x \end{align} $$     (4-17)$$ In the equation (4-17), it is seen that a summation of the high order derivatives at different points in the square brackets increases the complexity of the computation. The term in the first summation is not cancelled out and cannot be reduced to a simpler form. As a result, the equation (4-17) is computationally cumbersome since it requires the derivatives calculated at all points.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Author and proof-reader
[Author] Shin

[Proof-reader]

= Problem 6.5 - Determine the polynomials P8(t) and P9(t) = From [[media:Nm1.s11.mtg32.djvu|Mtg 32-2]]

Given

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

P_{2j} (t) = \sum_{j=0}^{i} c_{2j+1} \cdot \frac{t^{2(i-j)}}{[2(i-j)]!} $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (1-1)
 * }


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

P_{2j+1} (t) = \sum_{j=0}^{i} c_{2j+1} \frac{t^{2(i-j)+1}}{[2(i-j)+1]!} $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (1-2)
 * }


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

\sum_{j=0}^{i} \frac{c_{2j+1}}{[2(i-j)+1]!} = 0 $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (1-3)
 * }


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

P_1 (t) = -t, \qquad \rightarrow c_1 = -1 $$ $$.
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (1-4)
 * }

Find
$$\displaystyle (P_8, P_9) $$

Solution
 According to (1-1) and (1-2) 

$$  \displaystyle P_8(t)=c_1 \cdot \frac{t^8}{8!} + c_3 \cdot \frac{t^6}{6!} + c_5 \cdot \frac{t^4}{4!} + c_7 \cdot \frac{t^2}{2!} + c_9$$

$$\displaystyle

P_9(t)=c_1 \cdot \frac{t^9}{9!} + c_3 \cdot \frac{t^7}{7!} + c_5 \cdot \frac{t^5}{5!} + c_7 \cdot \frac{t^3}{3!} + c_9 \cdot t $$

 And we already knew that the values of 

$$\displaystyle c_1 = -1, \ c_3 = \frac{1}{6}, \ c_5 = - \frac{7}{360}, \ c_7 = \frac{31}{15120} $$

 in problem 6.1 Therefore all we have to find is only  $$\displaystyle c_9 $$

 Using (1-3) 

$$\displaystyle \frac{c_1}{9!} + \frac{c_3}{7!} + \frac{c_5}{5!} + \frac{c_7}{3!} + c_9 = 0 $$

$$\displaystyle \therefore c_9 = - \frac{127}{604800} $$

(WA result)


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

$$  \displaystyle P_8(t)=c_1 \cdot \frac{t^8}{8!} + c_3 \cdot \frac{t^6}{6!} + c_5 \cdot \frac{t^4}{4!} + c_7 \cdot \frac{t^2}{2!} + c_9$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |

$$\displaystyle

P_9(t)=c_1 \cdot \frac{t^9}{9!} + c_3 \cdot \frac{t^7}{7!} + c_5 \cdot \frac{t^5}{5!} + c_7 \cdot \frac{t^3}{3!} + c_9 \cdot t $$

$$\displaystyle c_1 = -1, \ c_3 = \frac{1}{6}, \ c_5 = - \frac{7}{360}, \ c_7 = \frac{31}{15120}, \ c_9 = - \frac{127}{604800} $$
 * }
 * }

Author and proof-reader
[Author] Oh

[Proof-reader]

= Problem 6.6 - Kessler's Code = From [[media:Nm1.s11.mtg32.djvu|Mtg 32-3]]

Given
Kessler's code:

Find
Use $$(p_{2i}, p_{2i+1}), i=1, 2,3$$ to understand Kessler's code line by line, starting with the best of S10.

Solution
We will be using $$(p_{2},p_{3}),(p_{4},p_{5}),$$ and $$(p_{6},p_{7})$$. Also, the code is explained by adding comments line by line:

Author and proof-reader
[Author] cavalcanti

= Problem 6.7 - Computing the Circumference of an ellipse and bifolium = From [[media:Nm1.s11.mtg33.djvu|Mtg 33-1]]

''' This problem was solved using the matlab code from team 4 spring 2010, HW5 and  HW4, as a guide. The circumference of the bifolium was calculated ourselves '''

Given
An Ellipse as given by:


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

$$\begin{align} r(\theta ) &= \frac\\ e&={\left( {1 - \frac} \right)^{1/2}}\\ a&=10\\ b&=3 \end{align}$$ (7-1)$$ For the ellipse
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }


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

$$\begin{align} C &= \int_0^{2\pi } {dl} = 4aE(e)\\ where\\ E(e) &= {\int_0^{\frac{\pi }{2}} {\left[ {1 - {e^2}\sin (\theta )} \right]} ^{\frac{\pi }{2}}}d\theta \end{align}$$ (7-2)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

A bifolium is given by:
 * {| style="width:100%" border="0"

$$\begin{align} r(\theta ) = 2\sin (\theta ){\cos ^2}(\theta ) \end{align}$$ (7-3)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Also given is the equation for arc length given on [[media:Nm1.s11.mtg32.djvu|Mtg 32-4]],
 * {| style="width:100%" border="0"

$$\begin{align} \widehat{PQ} =\int_^ {{{\left[ {{r^2} + {{\left( {\frac{{dr}}{{d\theta }}} \right)}^2}} \right]}^{1/2}}d\theta } \end{align}$$ (7-4)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Find
1) Using the parameterization of an ellipse, given on [[media:Nm1.s11.mtg34.djvu|Mtg 34-5]], determine $$dl$$ for an ellipse and show that eq 7-2 is valid 2) Using $$C=\int_0^{2\pi } {dl}$$, find the circumference of the ellipse using Comp Trap Rule, Romberg, Clenshaw-Curtis quad (clencurt code), and Clenshaw-Curtis quad (Fast CC). 3) Using $$C=4aE(e)$$, to find the exact circumference of the ellipse. 4) Using equations 7-3 and 7-4, find the circumference of the bifolium using Comp Trap Rule, Romberg, Clenshaw-Curtis quad (clencurt code), and Clenshaw-Curtis quad (Fast CC).

For all of these use Wolfram Alpha as a reference for the exact solution and state the computation time.

7.1: Parameterization of an Ellipse
Starting from the parameters that $$x=acos(\theta)$$ and $$y=bsin(\theta)$$ we have the equation for the ellipse
 * {| style="width:100%" border="0"

$$\begin{align} 1 &= {\underbrace {\left( {\frac{y}{b}} \right)}_{{{\cos }^2}t}^2} + {\underbrace {\left( {\frac{x}{a}} \right)}_{{{\sin }^2}t}^2}\\ dx&=-asin(\theta)d\theta\\ dy&=bcos(\theta)d\theta \end{align}$$ (7-5)$$ Also
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dl = {\left[ {d{x^2} + d{y^2}} \right]^{\frac{1}{2}}} \end{align}$$ (7-6)$$ Substituting 8-5 into 8-6 we get
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dl = {\left[ {{a^2}{{\sin }^2}(\theta ) + {b^2}{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta \end{align}$$ (7-7)$$ Pulling out $$a^{2}$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dl = a{\left[ {{{\sin }^2}(\theta ) + \frac{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta \end{align}$$ (7-8)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dl &= a{\left[ {1 - {{\cos }^2}(\theta ) + \frac{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta\\ &=a{\left[ {1 - \underbrace {\left( {1 - \frac} \right)}_{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta\\ \Rightarrow dl &= a{\left[ {1 - {e^2}{{\cos }^2}(\theta )} \right]^{\frac{1}{2}}}d\theta \end{align}$$ (7-9)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Equation 7-9 gives us our $$dl$$ to calculate the circumference using method 1. Now we must show that the transform is valid.

Figure out transformation of variables

7.2: Circumference using $$C=\int_0^{2\pi } {dl}$$
To start we must find out what the eccentricity equals.


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

$$\begin{align} e &= {\left( {1 - \frac} \right)^{\frac{1}{2}}}\\ &={\left( {1 - \frac} \right)^{\frac{1}{2}}}\\ &={\left( {.91} \right)^{\frac{1}{2}}}\\ &=0.953939 \end{align}$$ (7-10)$$ From here the Matlab code below was used. It is based on code developed by Running this code produces the following solutions for the circumference and the time the calculations took. From the table we can see that the fast Clenshaw-Curtis quadrature was indeed very fast at solving for the circumference. The biggest issue with the Clenshaw-Curtis quadratures is that the user must select the number of steps before computation. As opposed to the other two methods, in which the user can specify the accuracy desired and the program will run for the desired number of steps. You could rework the code to allow for the Clenshaw-Curtis operators to act in this manner but you would end up sacrificing the speed that was the primary pro.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

7.3: Circumference using 4aE(e)
Because E(e) is a simple function
 * {| style="width:100%" border="0"

$$ E(e) = {\int_0^{\frac{\pi }{2}} {\left[ {1 - {e^2}\sin (\theta )} \right]} ^{\frac{1}{2}}}d\theta $$     (7-2)$$ the exact value can easily be computed either by hand or using matlab. Here it was calculated using matlab.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Giving us a solution of $$43.85910069568$$ in a time of $$0.005292s$$

7.4: Circumference of a Bifolium
From [WA] we find that the arc length of a bifolium is equal to 7.1555...a. Where
 * {| style="width:100%" border="0"

$$\begin{align} r = 4a{\cos ^2}(\theta )\sin (\theta ) \end{align}$$ (7-11)$$ Therefore in this problem $$a=\frac{1}{2}$$.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Using this information the circumference of the bifolium is calculated using similar matlab code as for the ellipse. The calculations returned values as follows

As we can see, for the bifolium the matlab code did not return the same degree of accuracy. In fact it is many orders of magnitude less than for the ellipse. As we might expect for this more difficult, periodic, curve the comp trap rule was both the most accurate and the quickest run. In order for the Clenshaw-Curtis quadrature to get reasonable accuracy they number of steps had to be greatly increased causing a large increase in time required to run.

Author and proof-reader
[Author]

= Problem 6.8 = From [[media:Nm1.s11.mtg33.djvu|Mtg 33-2]]

 We solved on our own 

Given

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

$$\begin{align} \widehat{PQ} =\int_^ {{{\left[ {{r^2} + {{\left( {\frac{{dr}}{{d\theta }}} \right)}^2}} \right]}^{1/2}}d\theta } \end{align}$$ (8-1)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Find
Given the triangle OAB in the above figure, use the law of cosines to derive equation 8-1

Solution
The law of cosines is given as
 * {| style="width:100%" border="0"

$$\begin{align} {c^2} = {a^2} + {b^2} - 2ab\cos (\gamma ) \end{align}$$ (8-2)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Using the above triangle and setting
 * {| style="width:100%" border="0"

$$\begin{align} \overline {AA'} &= rd\theta \\ \overline{A'B}&=dr \end{align}$$ (8-3)$$ The law of cosines then becomes
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} {\overline {AB} ^2} &= {\overline {AA'} ^2} + {\overline {A'B} ^2} - 2\overline {AA'} \overline {A'B} \cos (\gamma )\\ where \\ \rightarrow \gamma &=0 \end{align}$$ (8-4)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Thus the equation becomes
 * {| style="width:100%" border="0"

$$\begin{align} {\overline {AB} ^2} &= {\overline {AA'} ^2} + {\overline {A'B} ^2}\\ \end{align}$$ (8-5)$$ Substituting
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} {\overline {AB} ^2} = r{(\theta )^2}d{\theta ^2} + d{r^2} \end{align}$$ (8-6)$$ We can approximate $$dr$$ by
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dr &\cong r(\theta + d\theta ) - r(\theta )\\ &= \fracd\theta + h.o.t \end{align}$$ (8-7)$$ Neglecting the higher order terms and substituting
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} {\overline {AB} ^2} &= r{(\theta )^2}d{\theta ^2} + {\left( {\fracd\theta } \right)^2}\\ &=\left[ {r{{(\theta )}^2} + {{\left( {\frac} \right)}^2}} \right]d{\theta ^2} \end{align}$$ (8-8)$$ As we can see from the figure $$\overline{AB}=dl$$ so therefore
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} dl = {\left[ {r{{(\theta )}^2} + {{\left( {\frac} \right)}^2}} \right]^{\frac{1}{2}}}d\theta \end{align}$$ (8-9)$$ Taking the integral over the arc $$\widehat{PQ}$$ we come to eq 8-1 as expected.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }
 * {| style="width:100%" border="0"

$$\begin{align} \int\limits_^ {dl} &= \int\limits_^ {{{\left[ {r{{(\theta )}^2} + {{\left( {\frac{{dr(\theta )}}{{d\theta }}} \right)}^2}} \right]}^{\frac{1}{2}}}d\theta } \\ \widehat {PQ} &= \int\limits_^ {{{\left[ {r{{(\theta )}^2} + {{\left( {\frac{{dr(\theta )}}{{d\theta }}} \right)}^2}} \right]}^{\frac{1}{2}}}d\theta } \end{align}$$ (8-10)$$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">$$\displaystyle
 * }

Author and proof-reader
[Author]Egm6341.s11.team5.reiss 09:36, 5 April 2011 (UTC)Reiss

= Problem 6.9 Determine Shape Funcitons = From [[media:Nm1.s11.mtg32.djvu|Mtg 37-2]]

Given

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

Z(s)=c0+c1 s+c2 s^2+c3 s^3$$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-1)
 * }

Find
$$\mathbf{A},\mathbf{A^{-1}},\mathbf{N}$$  Where 


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

\mathbf{A}.c=z, c=\left( \begin{array}{c} c0 \\ c1 \\ c2 \\ c3 \end{array} \right), z=\left( \begin{array}{c} z_i \\ z'_i \\ z_{i+1} \\ z'_{i+1} \end{array} \right),Z(s)=\mathbf{N}.\left( \begin{array}{c} d1 \\ d2 \\ d3 \\ d4 \end{array} \right) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-2)
 * }

Solution
 At i, s=0 and at i+1, s=1 


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

Z'(s)=c1+2 c2 s+3 c3 s^2, z_i=Z(0),z_{i+1}=Z(1),z'_i=Z'(0),z'_{i+1}=Z'(1) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-3)
 * }


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

\left( \begin{array}{c} z_i \\ z'_i \\ z_{i+1} \\ z'_{i+1} \end{array} \right) = \left( \begin{array}{c} c0 \\ c1 \\ c0+c1+c2+c3 \\ c1+2 c2+3 c3 \end{array} \right) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-4)
 * }

 In coefficient form for c, 


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

\left( \begin{array}{c} z_i \\ z'_i \\ z_{i+1} \\ z'_{i+1} \end{array} \right) = \left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 3 \end{array} \right). \left( \begin{array}{c} c0 \\ c1 \\ c2\\ c3 \end{array} \right) $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-5)
 * }


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

\mathbf{A}=\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 3 \end{array} \right),
 * $$ \displaystyle
 * $$ \displaystyle

\mathbf{A^{-1}}=\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{array} \right) $$ $$
 * <p style="text-align:right;">$$\displaystyle (9-6)
 * }


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

\left( \begin{array}{c} z_i \\ z'_i \\ z_{i+1} \\ z'_{i+1} \end{array} \right)=\left( \begin{array}{c} d1 \\ d2 h \\ d3 \\ d4 h \end{array} \right)$$
 * $$ \displaystyle
 * $$ \displaystyle

$$c=\mathbf{A^{-1}}.z$$

$$c=\left( \begin{array}{c} d1 \\ d2 h \\ -3 d1-2 d2 h+3 d3-d4 h \\ 2 d1+d2 h-2 d3+d4 h \end{array} \right) $$ $$
 * <p style="text-align:right;">$$\displaystyle (9-7)
 * }

 Substuting the values for c into (9-1) 


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

Z(s)=s^3 (2 d1+d2 h-2 d3+d4 h)+s^2 (-3 d1-2 d2 h+3 d3-d4 h)+d1+d2 h s $$ $$
 * $$ \displaystyle
 * $$ \displaystyle
 * <p style="text-align:right;">$$\displaystyle (9-8)
 * }

 In coefficient form for d, 


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

Z(s)=\left( \begin{array}{c} 2 s^3-3 s^2+1 \\ h s^3-2 h s^2+h s \\ 3 s^2-2 s^3 \\ h s^3-h s^2 \end{array} \right)^{T} .\left( \begin{array}{c} d1 \\ d2 \\ d3 \\ d4 \end{array} \right)$$
 * $$ \displaystyle
 * $$ \displaystyle

$$\mathbf{N}=\left( \begin{array}{c} 2 s^3-3 s^2+1 \\ h s^3-2 h s^2+h s \\ 3 s^2-2 s^3 \\ h s^3-h s^2 \end{array} \right)$$

$$
 * <p style="text-align:right;">$$\displaystyle (9-8)
 * }

 The following is the plot of $$\mathbf{N}$$ with $$h=1$$: 

Author and proof-reader
[Author] J Davis 18:23, 1 April 2011 (UTC)

= References =

= Contributing members =