You need to be careful with derivatives. For example the derivative of sqrt(x) will blow up at 0 The derivative of x^y wrt x will cause trouble at 0. Even when a good limit exists the function definition may not be smart enough to resolve a 0 * inifinity limit.