Scientific Notebook allows you to define functions that are described by different expressions on different parts of their domain. You can evaluate, plot, differentiate, and integrate these functions.
Note that there are strict conditions concerning the piecewise definition of functions. They must be specified in a three-column matrix with at least two rows, with the functional values in the first column, ``if'' or ``if'' in the second column, and the range condition in the third column. Also, the matrix must be fenced with a left brace and no right delimiter, as in the following examples. It is advisable to enter the range conditions in order of increasing range.
To form the matrix
Functions should be entered as in the following examples. (When entering such functions, check Helper Lines on the View submenu, to see important details.)
To define a piecewise-defined function
You can then choose Evaluate to get results such as f (- 1) = 1,
f () = 2, f (2) = 1, h(- 1) = 1 and
Note To operate on piecewise-defined functions, such as to evaluate, plot, differentiate, or integrate such a function, you can make the definition and then work with the function name f or the expression f (x). You can also place the insertion point in the defining matrix to carry out such operations.
To plot a piecewise-defined function
For piecewise-defined functions that are not continuous, the choices of the expression f (x) or only the function name f, can have different results. For the function y = g(x) defined above, which is not continuous, you can plot with or without vertical connecting lines by using either the expression g(x) or the function name g to generate the plot.
See Plotting Defined FunctionsDM6-4.tex#Plot piecewise-defined function for guidelines to plotting piecewise-defined functions.