Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Numerical MethodsRSS Feeds

Guass-Legendre 2-point formula

Posted By: Axelle Schmidt     Category: C Programming     Views: 1815

Write a Guass-Legendre 2-point formula.

Guass-Legendre 2-point formula

The given form in the above equation is I = A0f(x1) + A1f(x2) ----------- (1)
  
where A0, A1 are the unknown co-efficient. Also x1 and x2 are not fixed at the end points.
Thus we have total four unknowns. to evaluate them we require a system of four equations. 
The four conditions can be obtained by taking f(x) = 1, x ,x2 and x3 respectively. And then solving the system. The four equations can be given as below: 
A0f(x1) + A1f(x2) =  ---------------------- (2) 
A0f(x1) + A1f(x2) =  ---------------------- (3) 
A0f(x1) + A1f(x2) =  ---------------------- (4) 
A0f(x1) + A1f(x2) =  ---------------------- (5) 

Placing the value of integration in above equations we get:
 
A0 + A1 = 2         ------------------ (6) 
A0x1 + A1x2 = 0 ------------------ (7) 
A0x12 + A1x22 = 2/3 ------------------ (8) 
A0 x13+ A1x23 = 0 ------------------ (9) 
 
Dividing  equation 9 by x1 we get A0 x12+ A1x23/x1 = 0 ------------------ (10) 
adding equation 10 and 8 we get: 
 
A0x12 + A1x22 = 2/3  
-A0x12 + A1x23/x1 = 0  
A1x22 - A1x23/x1 = 2/3 ---------------------------- (11) 
 
From equation 7 we have A0 = -A1 (x2/x1) replacing this in equation 11 we get: 

A1x22 - A0x22 = 2/3 ----------------------------(12) 
=> x22(A0 + A1) = 2/3 => 2x22 = 2/3 => x2 = 1/sqrt(3) 
 
Now dividing equation 8 by x1 we get A0x1 + A1x22/x1 = (2/3) x1 -------------------(13) 
subtracting equation 7 from 13 we get:
 
A0x1 + A1x22/x1 = (2/3) x1 
-A0x1 - A1x2 = 0 
A1(x22/x1) - A1x2 = (2/3) x1 --------------------- (14)
  
replacing replacing A1(x2/x1) in equation 11 we get: 

-A0x2 -A1x2 = (2/3)x1 => x2(A0 + A1) = -(2/3)x1=> x1 = -(1/sqrt(3))
  
Now placing value of x1 and x2 in equation 7 we get: -A0+ A1 = 0  => A0 = A1 
adding above equation to 6 we get 
 
A0 + A1 = 2 
-A0 + A1 = 0 
2A1 = 2                          =>  A1 = 1 and A0 = 1 

  
Share: 

 
 

Didn't find what you were looking for? Find more on Guass-Legendre 2-point formula Or get search suggestion and latest updates.

Axelle Schmidt
Axelle Schmidt author of Guass-Legendre 2-point formula is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!