Question: Create a function named gaussRule ( f , a , b , c , d ) . The function takes a bivariate function f ,

Create a function named gaussRule(f, a, b, c, d). The function takes a bivariate function f, represented as an anonymous function, and the numbers a, b, c,d, defining the rectangle [a,b][c,d]. The function should calculate the integral of function f over the given rectangle using the Gauss quadrature rule with three points, as presented in (3).
Write a function named nIntegral (f, ab, cd, k, h). This function, similar to the previous one, takes a two-variable function f represented as an anonymous function. Additionally, it takes two two-element vectors ab and cd, in which the intervals a,b and c,d are stored, respectively. Furthermore, it takes two natural numbers, k and h. The function should calculate the integral of the function f over the rectangle [a,b][c,d] using a composite Gaussian rule with three points. This means the function should divide the interval a,b into k subintervals and the interval c,d into h subintervals. Then, on each smaller rectangle, apply the rule (3), sum the results, and return an estimate for the integral abcdf(x,y)dxdy.
3
Let
f(x,y)=cos((c1+1)x)sin((c2+1)y),
where c1 in c2 are the last two digits of your enrolment number. Plot the graph of function f(x,y) on the rectangle [0,15][0,20]. Then numerically compute the integral
020015f(x,y)dxdy
using the built in function integral2. On how many subdivisions should we divide the interval a,b and on how many interval c,d so that the composite Gauss rule with three points gives a result that differs by less than 10-6 from the result obtained with the built-in function integral2?
 Create a function named gaussRule(f, a, b, c, d). The function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!