Question: How do I find the limit of a function using a while loop?

Investigate the limit of: (1-cos(x))/x as x goes to 0.

 

More specifically, define: f(x)=(1-cos(x))/x

and demonstrate that the limit as x approaches 0 f(x)=0 as follows:

 

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

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

 

Having difficulty with this, any help would be much appreciated!

Please Wait...