# How to determine if a function is continuous?

I wish to write code for Riemann Stieltjes integrals in Mathematica.

A necessary condition for the theorem to hold is that the function must be continuous. The domain of the function is a closed real interval containing infinitely many points, so I can't check continuity at each and every point.

I wish to know if there are any built-in functions in Mathematica that determine if a function is continuous or not. Or if there is any function that returns point of singularities of function?

• Mathematica's support for non-smooth functions is not ideal. For example, D[g[x, y], x, y, x] returns Derivative[2, 1][g][x, y], even though these are not in general the same (though they are in the presence of certain smoothness requirements). mathematica.stackexchange.com/questions/32872/… is related. – Patrick Stevens Aug 19 '15 at 7:11
• What is "the theorem"? – murray Aug 19 '15 at 14:48
• Assuming function g has continuous derivative, Riemann Stieltjes integral of any function f with respect to g is same as Riemann integral of function f*g' (i.e. f times derivative of g). Thus I need to check continuity of derivative before I use the theorem. – Katherine Aug 19 '15 at 15:07
• Can you give a specific example of defining in Mathematica the sort of function $g$ you want to test? – murray Aug 28 '15 at 15:44
• We have been discussing the question before in the context of definite Integrate. Here continuity of the indefinite integral is required to be able to apply the fundamental theorem of calculus. But I don't remember the location of the discussion. I would take a pragmatic approach. To begin with let's assume the function is a given function of one variable in Mathematica. Simply plot it to see if it looks continuous or not in the chosen interval. Suppose you see a jump somewhere. You can then determine the parameters of the jump (location and extent) numerically to a high precision. – Dr. Wolfgang Hintze Aug 28 '15 at 19:06

I think this is impossible, i.e there's no way to know if an arbitrary function is continuous unless you are given some additional information about the function. Otherwise a function is just a black box. If you function is made up of only known functions, you could check for Piecewise` and check at the interface between definitions for instance, but this doesn't prove anything