Question: Investigating the limit by using a while loop??

Investigate the limit of (1-cos(x))/x as x->0.  

More specifically, define f(x)=(1-cos(x))/x  and demonstrate that the limit of f(x) going to 0 is equal to 0 as follows:

Write a function that takes epsilon as input, and calculate an integer N as the output so that |f(1/N)|<epsilon, using a while loop.

Specifically, compute f(1);f(1/2);f(1/3);;;;until |f(1/N)<epsilon and return N.

 

I'm not sure how to even start this, any help would be appreciated.

Please Wait...