In mathematics, a functional calculus is a theory allowing one to apply mathematical functions to mathematical operators. It is now a branch (more accurately, several related areas) of the field of functional analysis, connected with spectral theory. (Historically, the term was also used synonymously with calculus of variations; this usage is obsolete, except for functional derivative. Sometimes it is used in relation to types of functional equations, or in logic for systems of predicate calculus.)

If ${\displaystyle f}$ is a function, say a numerical function of a real number, and ${\displaystyle M}$ is an operator, there is no particular reason why the expression ${\displaystyle f(M)}$ should make sense. If it does, then we are no longer using ${\displaystyle f}$ on its original function domain. In the tradition of operational calculus, algebraic expressions in operators are handled irrespective of their meaning. This passes nearly unnoticed if we talk about 'squaring a matrix', though, which is the case of ${\displaystyle f(x)=x^{2))$ and ${\displaystyle M}$ an ${\displaystyle n\times n}$ matrix. The idea of a functional calculus is to create a principled approach to this kind of overloading of the notation.

The most immediate case is to apply polynomial functions to a square matrix, extending what has just been discussed. In the finite-dimensional case, the polynomial functional calculus yields quite a bit of information about the operator. For example, consider the family of polynomials which annihilates an operator ${\displaystyle T}$. This family is an ideal in the ring of polynomials. Furthermore, it is a nontrivial ideal: let ${\displaystyle n}$ be the finite dimension of the algebra of matrices, then ${\displaystyle \{I,T,T^{2},\ldots ,T^{n}\))$ is linearly dependent. So ${\displaystyle \sum _{i=0}^{n}\alpha _{i}T^{i}=0}$ for some scalars ${\displaystyle \alpha _{i))$, not all equal to 0. This implies that the polynomial ${\displaystyle \sum _{i=0}^{n}\alpha _{i}x^{i))$ lies in the ideal. Since the ring of polynomials is a principal ideal domain, this ideal is generated by some polynomial ${\displaystyle m}$. Multiplying by a unit if necessary, we can choose ${\displaystyle m}$ to be monic. When this is done, the polynomial ${\displaystyle m}$ is precisely the minimal polynomial of ${\displaystyle T}$. This polynomial gives deep information about ${\displaystyle T}$. For instance, a scalar ${\displaystyle \alpha }$ is an eigenvalue of ${\displaystyle T}$ if and only if ${\displaystyle \alpha }$ is a root of ${\displaystyle m}$. Also, sometimes ${\displaystyle m}$ can be used to calculate the exponential of ${\displaystyle T}$ efficiently.

The polynomial calculus is not as informative in the infinite-dimensional case. Consider the unilateral shift with the polynomials calculus; the ideal defined above is now trivial. Thus one is interested in functional calculi more general than polynomials. The subject is closely linked to spectral theory, since for a diagonal matrix or multiplication operator, it is rather clear what the definitions should be.