User:Egm6341.s10.team3.heejun

= (4) Prove IMVT=

Problem Statement
(i) $$ \int_{a}^{b}w(x)\cdot f(x)dx = f(\xi )\int_{a}^{b}w(x)dx $$  for   $$ w(x)\geq 0 $$  (ii) Another version of IMVT $$w(x)<0$$ for all $$ x\in [a,b] $$

 Ref: Lecture Notes [[media:Egm6341.s10.mtg5.pdf|p.5-1]] 

Solution
 Ref: Lecture Notes [[media:Egm6341.s10.mtg2.pdf|p.2-3]]  (i)

$$ m\cdot w(x)\leq f(x)\cdot w(x)\leq M\cdot w(x)$$

 where,

m:=min f(x)

M:=max f(x)

 a) Integrating,

$$ m\cdot \int_{a}^{b}w(x)dx\leq \int_{a}^{b}w(x)\cdot f(x)dx\leq M\cdot \int_{a}^{b}w(x)dx$$

 b) Dividing by $$ \frac{1}{\int_{a}^{b}w(x)dx} $$ $$ m\leq \underbrace{\frac{1}{\int_{a}^{b}w(x)dx}\int_{a}^{b}w(x)\cdot f(x)dx}_{Z} \leq M $$

$$ Z=\frac{1}{\int_{a}^{b}w(x)dx}\int_{a}^{b}w(x)\cdot f(x) dx$$

 c) By Interm. Value Them,

There exists $$ \xi \in [a,b] at   f(\xi)=Z $$

 $$ \therefore f(\xi)=\frac{1}{\int_{a}^{b}w(x)dx}\int_{a}^{b}w(x)\cdot f(x)dx $$ 

(ii)

$$ m\cdot \left | w(x) \right |\leq f(x)\cdot \left | w(x) \right |\leq M\cdot \left | w(x) \right | $$

 where,

m:=min f(x)

M:=max f(x)

<br\> a) Integrating, $$ m\cdot \int_{a}^{b}\left | w(x) \right |dx\leq \int_{a}^{b}\left | w(x) \right |\cdot f(x)dx\leq M\cdot \int_{a}^{b}\left | w(x) \right |dx $$

<br\> b) Dividing by $$ \frac{1}{\int_{a}^{b}\left | w(x) \right |dx} $$ $$ m\leq \underbrace{\frac{1}{\int_{a}^{b}\left | w(x) \right |dx}\int_{a}^{b}\left | w(x) \right |\cdot f(x)dx}_{Z} \leq M $$

$$ Z=\frac{1}{\int_{a}^{b}\left | w(x) \right |dx}\int_{a}^{b}\left | w(x) \right |\cdot f(x)dx $$

<br\> c) By Interm. Value Them,

There exists $$ \xi \in [a,b] at   f(\xi)=Z $$

<br\> d) $$ w(x) $$ is strictly negative, so

$$ f(\xi)=\frac{1}{\cancelto{}{(-1)}\cdot\int_{a}^{b}w(x)dx}\cdot\cancelto{}{(-1)}\cdot\int_{a}^{b}w(x)\cdot f(x)dx $$ <br\> $$ \therefore f(\xi)=\frac{1}{\int_{a}^{b}w(x)dx}\cdot\int_{a}^{b}w(x)\cdot f(x)dx $$ <br\>

= (8) Taylor, Trap and Simpson Rule=

Problem Statement
$$ I=\int_{0}^{1}\frac{e^{x}-1}{x}dx $$

(i) Taylor series exp. fn<br\> (ii) Comp. Trap. rule <br\> (iii) Comp. Simpson rule <br\> <br\> Ref: Lecture Notes [[media:Egm6341.s10.mtg6.pdf|p.6-5]] <br\>

Solution
(i)<br\> a) n=2,

$$ I_{2}=\left ( \frac{1}{(1!\cdot 1)}+\frac{1}{(2!\cdot 2)} \right )=1.25 $$

a-1) Error for n=2,

$$ \frac{1}{(2+1)!\cdot (2+1)}\leq I-I_{2}\leq \frac{e}{(2+1)!\cdot(2+1))}=0.055556\leq I-I_{2}\leq0.151016 $$

<br\> <br\> b) n=4,

$$ I_{4}=\left ( \frac{1}{(1!\cdot 1)}+\frac{1}{(2!\cdot 2)}+\frac{1}{(3!\cdot 3)}+\frac{1}{(4!\cdot 4)} \right )=1.3159722222223\approx 1.31597 $$

b-1) Error for n=4,

$$\frac{1}{(4+1)!\cdot (4+1)}\leq I-I_{2}\leq \frac{e}{(4+1)!\cdot(4+1))}=0.001667\leq I-I_{2}\leq0.00453$$

<br\> <br\> c) n=8,

$$ I_{4}=\left ( \frac{1}{(1!\cdot 1)}+\frac{1}{(2!\cdot 2)}+\frac{1}{(3!\cdot 3)}+\frac{1}{(4!\cdot 4)}+\frac{1}{(5!\cdot 5)}+\frac{1}{(6!\cdot 6)}+\frac{1}{(7!\cdot 7)}+\frac{1}{(8!\cdot 8)} \right )=1.3179018152401 \approx 1.3179 $$

c-1) Error for n=8,

$$ \frac{1}{(8+1)!\cdot (8+1)}\leq I-I_{2}\leq \frac{e}{(8+1)!\cdot(8+1))}=3.06192\times 10^{-7}\leq I-I_{2}\leq8.32317\times 10^{-7} $$

<br\>

(ii)<br\> This one can be calculated by '''the Comp. Trap. rule or the Corrected Trap. rule but it is hard to define the first term, X0'''.

Thus, some math-codes are required. <br\>

=Find the true value of I= MATLAB Code

<br\>

a) the Comp. Trap. rule

$$ \int_{a}^{b}f(x)dx=\frac{b-a}{2n}*[f(x_{0})+2f(x_{1})+2f(x_{2})+.........+2f(x_{n-1})+f(x_{n})] $$

b) the Corrected Trap. rule

$$ \int_{a}^{b}f(x)dx=\frac{b-a}{2n}*[f(x_{0})+2f(x_{1})+2f(x_{2})+.........+2f(x_{n-1})+f(x_{n})]-\frac{h^2}{12}*[f^{'}(b)-f^{'}(a)] $$

Where

<li> $$ h=\frac{(b-a)}{n} $$

<br\> <br\>

c) Results of Comp. Trap. rule

Where

<li>En = The true value of I (=1.317902152) - In

<br\> Finally, the value of n=128 is closer to the true value with about 10-6 order.

<br\> d) Example of MATLAB Code (n=2)

<br\>

(iii)<br\> This one can be calculated by '''the Comp. Simpson rule''' but it is also hard to define the first term, X0.

Thus, some math-codes are required.

<br\> <br\>

a) the Comp. Simpson rule

$$ \int_{a}^{b}f(x)dx=\frac{b-a}{3n}*[f(x_{0})+4f(x_{1})+2f(x_{2})+.........+2f(x_{n-2})+4f(x_{n-1})+f(x_{n})] $$

<br\> <br\>

b) Results of Comp. Simpson rule

Where

<li> En = The true value of I (=1.317902152) - In

<br\> Finally, the value of n=4 is closer to the true value with about 10-6 order.

<br\> c) MATLAB Source Code <br\>

<br\> d) Example of MATLAB Code (Run, n=2) <br\>

--Heejun Chung 17:43, 27 January 2010 (UTC)