Hadamard and Poussin

I have to approx how many prime number there are between 2 to 50 000 by using  int(1/ln(t),t=2..50000);

I need to use (to approximate):

a) rectangle method

b) trapezoid method

c) simpsons method

However, I can not use the fonction like simpson(1/ln(t),t=2..50000); to solve them, I need to go with the definition and I have no idea how.

Can any1 help me?

Scott03's picture

ApproximateInt

If you wanted to approximate the integral to check your answer, the function in Maple is Student[Calculus1][ApproximateInt](...).  This function will have the options for the methods you had mentioned.  But it appears from your question that you are being asked to create a function for each yourself.  This page gives those methods nicely and should be quite easy to convert to Maple.

 

One quick attempt at the Rectangle method (which is the left Riemann Sum) would be the following:

myRect := proc (f, n, lower, upper)
local width, newF;
newF := unapply(f, x);
width := (upper-lower)/n;
sum(newF(lower+i*width)*width, i = 0 .. n-1)
end proc;

 

Scott

No, sorry if my question is not well posed

int(1/ln(t),t=2..50000)     is the function. 

I can not use such things as simpson(1/ln(t),t=2..50000) or trapezoid etc...

I need to find how many prime number there are between 2 and 50 000 by using the function above and the definition of the methods I've written in my other post.

IMPORTANT** for a,b and c (question of my first post), n = 100 000

I'll also check the page you've posted, thank you.

edit : This site does not really help me since I dont know where I take xm1 xm and xm2.

Well

To clear things out, I only need to know how to write the Rectangle, the trapezoid and simpson's method using it's definition on maple. I can not use commands such as simpson(), trapezoid().

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}