University of Florida/Egm6341/s10.team3.aks

From testwiki
Jump to navigation Jump to search

(10) Prove Simple trapezoidal rule

Ref. Lecture notes [[[media:Egm6341.s10.mtg8.pdf|p.8-2]]]

Problem Statement

Use (2) in Slide [[[media:Egm6341.s10.mtg8.pdf|8-2]]] to obtain Simple trapezoidal rule.

Solution

Given

I1=[ablo(x)dx]f(xo) + [abl1(x)dx]f(x1)

where

lo(x)=xx1(xox1),

l1(x)=xxo(x1xo,

xo=a


x1=b

Now I1=[abxx1xox1dx]f(xo) + [abxxox1xodx]f(x1)

= [x2/2bxab]abf(a)+[x2/2axba]abf(b)

= [((b22b2)(a22ab))(ab)]f(a)+[(b22ab)(a2/2a2)(ba)]f(b)

= [(ba)22(ba)]f(a)+[((ba)22(ba)]f(b)

= [(ba)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 P2(xj)=i=02li(xj)f(xi)=f(xj)


Solution

P2(xj)=i=02li(xj)f(xi)=lo(xj)f(xo)+l1(xj)f(x1)+l2(xj)f(x2)


where j=0,1,2

but when i=j li(xj)=1

and when ij li(xj)=0

then only surviving terms are given by

P2(xj)=lo(xo)f(xo)+l1(x1)f(x1)+l2(x2)f(x2)=f(xo)+f(x1)+f(x2)=f(xj)

(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)||,||g(x)||and||f(x)g(x)||

Solution

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

Matlab code :

 
x = 0:pi/100:pi;
y = sin(x);
plot(x,y)
xlabel('x = 0:pi');
ylabel('Sine of x');
title('Plot of the Sine Function');

Plot :

f(x)=y= Sin(x)

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

Matlab code :

x = 0:pi/100:pi;
y = -cos(x);
plot(x,y)
xlabel('x = 0:pi');
ylabel('cosine of x');
title('Plot of the cosine Function');

Plot :

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

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

Matlab code :

x = 0:pi/100:pi;
y = sin(x)+cos(x);
plot(x,y)
title('Plot of the Sine+Cosine Function');
ylabel('Sine+Cosine of x'); 
xlabel('x = 0:pi');

File:Sin+cos.jpg


||f(x)||=1

||g(x)||=1

||f(x)g(x)||=2

Abhishekksingh 16:25, 27 January 2010 (UTC)