Piecewise Functions - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Math Apps : Functions and Relations : Basic Functions and Relations : MathApps/PiecewiseFunction

Piecewise Functions

Main Concept

A function whose formula is different on different parts of its domain is called a piecewise function. Such a function is commonly (but not necessarily) written using a case structure:


The conditions should be mutually exclusive. That is, at any given value of x at most one of the conditions can be true. The value of the function is then the value of the subformula corresponding to the true condition.



fx&equals;x2   x<0x2x0


pn=nif n is prime1if n is composite


A spline was originally a long flexible rod used to draw smooth curves for shipbuilding and woodworking. The rod would be bent and clamped along a series of fixed pegs to give it a particular shape. Eventually this technique was noticed by mathematicians, who gave a more formal definition to a spline. A mathematical spline is a piecewise function which uses polynomials of the same degree to connect a set of points (the "pegs" of old) to create a smooth curve. Splines can be a more effective way of interpolating a curve from a set of fixed points than a polynomial because their extrema tend to have smaller magnitudesthey don't "wobble" very much.


In the plot windows below, create graphs points by clicking or dragging in either plot window. The same points are shown in both graphs. The graph on the left will interpolate a polynomial function in the lowest degree possible, whereas the graph on the right will interpolate a cubic spline (all of the polynomials in the piecewise function will be of degree three).


What do you notice is different about the two? What's the same?


More MathApps


Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam