# The Calculus of Functional Differences and Integrals

## Abstract

Functions can often be defined by recursive equations such as these: f(x) = b(x); if p(x) f [h(x)] = g x [f(x)]; otherwise: The second equation says that if the input to f &quot;varies&quot; by h, then its output &quot;varies&quot; by g x . We call this a functional difference equation; it is analogous to a numerical difference equation, such as: f(h + x) = g x + f(x); which says that the output of f varies by g x when its input is varied by h. Since in our theory we vary the input by an arbitrary function, rather than a numerical displacement, we can take differences of functions defined on nonnumeric domains, such as lists, trees and sets. The ultimate goal of this research is to improve our ability to reason about functional programs. Specifically, the theory of functional differences provides a means of going from local descriptions of behavior (difference equations) to global descriptions (the solution to the difference equation), and vice versa. In this paper we define several different kinds of fu..