University of Florida/Egm6341/s10.team3.aks

(10) Prove Simple trapezoidal rule
Ref. Lecture notes p.8-2]

Problem Statement
Use (2) in Slide 8-2] to obtain Simple trapezoidal rule.

Solution
Given

$$I_1 =\Big[\int_a^b l_{\text{o}} (x)dx\Big] f(x_{\text{o}})$$ + $$\Big[\int_a^b l_1 (x)dx\Big] f(x_1)$$

where

$$l_{\text{o}}(x) = \frac{x - x_1} {(x_{\text{o}} - x_1)}$$,

$$l_1 (x) = \frac {x - x_{\text{o}}} {(x_1 - x_{\text{o}}}$$,

$$ x_{\text{o}} = a $$

$$ x_1 = b $$

Now $$  I_1 = \Big[\int_a^b \frac{x - x_1} {x_{\text{o}} - x_1} dx\Big] f(x_{\text{o}})$$ + $$\Big[\int_a^b \frac{x - x_{\text{o}}} {x_1 - x_{\text{o}}} dx\Big]  f(x_1)$$

= $$[\frac{x^2 /2 - bx} {a - b}]_a^b  f(a) + [\frac{x^2 /2 - ax} {b - a}]_a^b  f(b)$$

= $$[(\frac{(\frac{b^2}{2} - b^2)- (\frac{a^2} {2} - ab))} {(a - b)}] f(a) + [\frac{(\frac{b^2}{2} - ab)- (a^2 /2 - a^2)} {(b - a)}] f(b)$$

= $$[\frac{(b-a)^2}{2(b - a)}] f(a)+ [(\frac{(b-a)^2}{2(b - a)}] f(b)$$

= $$[\frac{(b-a)}{2}] (f(a) + f(b))$$

which is same as equation (1) Slide p.7-1

This completes the Proof of trapezoidal rule

(11) Expansion of Lagrange functions
Ref: Lecture notes p.8-3 [media:Egm6341.s10.mtg8.pdf|

Problem Statement
Expand(4) from Slide (8-3 [media:Egm6341.s10.mtg8.pdf]]) to obtain $$P_2 (x_j)= \sum_{i=0}^2 l_i(x_j) f(x_i) = f(x_j)$$

Solution
$$P_2 (x_j)= \sum_{i=0}^2 l_i(x_j) f(x_i)= l_{\text{o}}(x_j)f(x_{\text{o}})+ l_1(x_j)f(x_1)+ l_2 (x_j)f(x_2)$$

where  $$ j = 0 ,1 ,2 $$

but when $$ i=j $$ $$ l_i(x_j) = 1 $$

and when i$$ \ne  $$j $$ l_i(x_j) = 0 $$

then only surviving terms are given by

$$\displaystyle P_2 (x_j)= l_{\text{o}}(x_{\text{o}}) f(x_{\text{o}}) + l_1 (x_1)  f(x_1)+ l_2 (x_2)  f(x_2) = f(x_{\text{o}}) + f(x_1) + f(x_2)=f (x_j) $$

(3) Plot Functions Sin (x),-cos (x)and Sin(x)+cos(x)
Ref. Lecture notes p.3-3 [media:Egm6341.s10.mtg3.pdf|

Problem Statement
Plot f(x)= sin(x) and g(x) = - cos(x) in the interval of [0,pi]]

and also find $$||f(x)||\infin, ||g(x)||\infin and ||f(x)-g(x)||\infin$$

Solution
Plot f(x)= sin(x) in interval [0,pi]

Matlab code :

Plot :

f(x)=y= Sin(x)



Plot g(x)= - cos(x) in interval [0,pi]

Matlab code :

Plot :

g(x)= y = - cos(x)



Plot f(x)-g(x)= Sin(x)+cos(x)

Matlab code :



$$||f(x)||\infin = 1$$

$$||g(x)||\infin = 1$$

$$||f(x)-g(x)||\infin = \sqrt{2}$$

Abhishekksingh 16:25, 27 January 2010 (UTC)