a piecewise function is a function that is defined by different formulas or functions for each given interval. In mathematics, a piecewise-defined function (also called a piecewise function or a hybrid function) is a function which is defined by multiple sub-functions, each sub-function applying to a certain interval of the main function's domain (a sub-domain).