I am calculating a derivative of a function by using the slope method. I need to zoom into the graph to see what actually is happening but the data points are too low to give a smooth curve. So when I increase the number of iterations in my loop, the program gives the error of RuntimeWarning: divide by zero encountered in true_divide. The function is in RED and its derivative graph in Green looks like this:
As it can be seen here that the curve is not smooth i.e. it lacks data points. I am using a for loop to iterate my program and when I increase the range it gives the error. The calculations are done by using a numerical method and I go to the step value of 0.0001 only. After that the program doesn't provide correct value. What can be done here?