User:Egm6341.s11.team2.franklin/hwk4

Problem 5: Show relationship in Simple Simpson's Error Theorem
''' This problem was solved without referring to S10 homework. '''

From the lecture slide Mtg 21-1

Problem Statement
Given

find relation between $$ \xi\ \ $$ and $$ \zeta_4\ \ $$.

Solution
Let

Transforming coordinates $$\displaystyle \left( t=\zeta_4, x=\xi\right) $$ gives:

With Eqn 5.1-7, the proof is as follows:

The fourth derivative of $$\displaystyle F \left(\zeta_4\right) $$ is

Substituting $$\displaystyle \frac{dx}{h} $$ for $$\displaystyle  dt $$ and $$\displaystyle  f\left(\xi\right) $$ for $$\displaystyle  F\left(\zeta_4\right) $$ in Eqn 5.8 gives:

Substitute Eqn 5.11 into Eqn 5.1 gives:

By transforming $$\displaystyle t=\zeta_4 $$ and $$\displaystyle x=\xi $$, Eqn 5.4 becomes

Problem 10: Comparisons of Comp. Trapezoidal and Comp. Simpson's Rules
''' This problem was solved without referring to S10 homework. '''

From the lecture slide Mtg 22-3

Problem Statement
a) Produce a table similar to table 5.1, page 255, Atkinson text book using the composite Trapezoidal rule (Atkinson is cos(x) instead of sin(x)).

b) Produce a table similar to table 5.3, page 258, Atkinson text book using the composite Simpson's rule (Atkinson is cos(x) instead of sin(x)).

Solution
 Part (a):  The given integral is: $$I=\int_{0}^{\pi} e^{x} \sin \left ( x \right )\cdot dx$$ where $$f\left ( x \right )=e^{x} \sin \left ( x \right )$$ is the integrand and $$\;x\in \left [ 0,\pi \right ]$$. We will use the composite trapezoidal rule to obtain the following tabulated results:

 MATLAB Code: 

 Part (b):  The given integral is: $$I=\int_{0}^{\pi} e^{x} \sin \left ( x \right )\cdot dx$$ where $$f\left ( x \right )=e^{x} \sin \left ( x \right )$$ is the integrand and $$\;x\in \left [ 0,\pi \right ]$$. We will use composite simpson's rule to generate the following tabulated results:

 MATLAB Code: