In mathematics, a rational function is any function that can be defined by a rational fraction, which is an algebraic fraction such that both the numerator and the denominator are polynomials. The coefficients of the polynomials need not be rational numbers; they may be taken in any field K K K. In this case, one speaks of a rational function and a rational fraction over K K K. The values of the variables may be taken in any field L L L containing K K K. Then the domain of the function is the set of the values of the variables for which the denominator is not zero, and the codomain is L L L.
The set of rational functions over a field K K K is a field, the field of fractions of the ring of the polynomial functions over K K K.