I am planning to develop an application that can calculate the limit of an expression (function) given by the user.
I already have a functional expression evaluator, which will definitely come in handy. My idea is to calculate it like this: I give the parameter a few values that get closer and closer to the point, but doesn’t reach the point. At the end, I see if the difference between two consecutive results gets smaller or bigger closer or further from 0. If it gets smaller closer, this means that the limit is finite, infinite otherwise. After that, it’s easy to approximate a result.
Is there a better approach to this? Or should I go with this one?
The application will accept functions that contain these mathematical operators: +,-,*,/,%,^, functions (like floor, logarithms, trigonometry), and 3 condition functions (abs, min, max).
So, for example a function which has a specific value for integer values, and another value for non-integer values is not accepted.
mathematically you could use the Differential calculus. Like that you just have to implement the differential rules and you dont have to use brute force
but the comment you got with wolframalpha is great:
example: thats exactly what you need