Home: Elements: Objects: Functions and Function Plots: Functions
Sketchpad allows you to create functions and families of functions, to evaluate functions and use them in calculations, to edit functions, to plot functions using either rectangular or polar coordinates, to combine and compose functions in various ways, and to differentiate functions.
To create a new function, for example, f (x) = sin(x), use New Function. This command opens Sketchpad’s function calculator to allow you to define how the function is calculated.
To create a new function and plot it immediately, use the Plot New Function command.
See
also
New Function
Plot New Function
Calculator
Showing and Hiding Labels
Parameters are particularly useful for investigating families of functions because they can easily be changed or animated.
While you’re using the function calculator to enter or edit a function, you can create a new parameter or use an existing parameter or other measurement from your sketch. When the value of this parameter or measurement changes, the definition of the function changes. For example, if you create parameter a while you’re specifying the function f (x) = a · sin (x ), you can investigate the behavior and plots of this entire family of functions, including functions such as f (x) = –1 · sin(x) and f (x ) = 3 · sin (x ) by varying the parameter a. Similarly, you can use three parameters as you define the function f (x) = ax 2 + bx + c to investigate the effect on this family of functions of changing each parameter’s value.
With the Calculator open add a new parameter to the function definition by choosing New Parameter from the Calculator’s Values pop-up menu. Insert an existing parameter by clicking on it in the sketch.
See
also
New Function
Plot New Function
Edit Parameter Definition
New Parameter
Parameters
Calculator
Functions can be thought of as rules for turning input values into output values. For example, the function f (x ) = 2 · x + 3 can be thought of as the rule which says “To get an output value, take the input value, multiply it by 2, then add 3 to the result.” Evaluating a function means following the rule for a particular value. For example, f (5) = 2(5) + 3 = 13.
Once you’ve defined a function, you can use it in later calculations and in later function definitions. The Function pop-up menu in the Calculator includes every selected user-defined function in your sketch. To insert a user-defined function that isn’t in the list, click the function in the sketch. (If the Calculator is hiding the function, you may have to move the Calculator out of the way first.) You can choose any of these user-defined functions in the definition of the new calculation or function.
When using the Calculator, you can click any function visible in your sketch to insert it into the calculation—or new function—that you’re defining in the Calculator.
See
also
New Function
Calculate
To define a new function and plot it immediately on the marked coordinate system, choose Plot New Function. Define the function as described above. When you close the function calculator, the function is plotted in the form that was set in the function calculator’s Equation pop-up menu when you defined the function. The plot can take any of four possible forms.
You can use the x = f ( y ) form to plot the function with the axes reversed.
To plot one or more existing functions on the marked coordinate system, select every function you want to plot and choose Plot Function. Each function is plotted in the form that you set in the function calculator’s Equation pop-up menu at the time you defined that function.
See
also
Plot New Function
Function Plots
You can edit an existing function to change its definition or how it’s plotted. Editing a function is useful, for example, if you’ve plotted the graph of y = 2 · sin(x ), and you want to change the function to y = 3 · sin(x ) in order to see how the two graphs differ. Instead of changing the constant to 3, you can insert a new parameter, allowing you to investigate the plots of the family of functions y = a · sin(x ).
To edit a function, select that function and choose Edit Function from the Edit menu or from the Context menu.
Choose a new Equation form while editing a function to change how that function is plotted. For instance, to plot a function f as a polar function, change f’s Equation form from y = f (x) to r = f (q).
When you edit a function, you can redefine it in any way you want—introducing new parameters and existing parameters, measurements and calculations—provided you don’t create a circular definition. A circular definition is one that uses a calculation that depends on the function you’re editing. For instance, if you’ve defined a function f and used it to calculate f (3) in your sketch, you cannot later edit function f so that it uses the calculation of f (3) in its definition.
See
also
Edit Function
Calculator
Once you’ve defined a function f (x )—for example, f (x ) = x 2— you can define and plot other functions that are transformations of f (x ). Transformations of f(x) include such functions as g (x ) = 2 · f (x ), g (x ) = f (–x ), or even g (x ) = –3 · f (2x + 5) – 1.
To define a function that is a transformation of f (x), choose New Function from the Graph menu. Define the new function as you normally would, inserting the original function f wherever you want by choosing it from the user-defined section of the Calculator’s Function pop-up menu.
See
also
New Function
Composite functions are functions of functions. For instance, f ( g(3)) is the composition of functions f and g evaluated at 3 and can be thought of as follows: “First evaluate function g at 3. Then use this result as the input for function f. The result of evaluating f is the value of the expression f ( g(3)).”
To compose two functions f and g, you must first define each of the functions separately. Then you can evaluate the composite function (as in the example) or define a new function that is the composite of the two original functions.
To evaluate f (g(3)) as in the example, select functions f and g and choose the Calculate command. In the Calculator, choose f (x ) from the user-defined section of the Function pop-up menu, then choose g (x ) similarly. And finally, enter the argument (“3” in this example), close the parentheses, and click OK.
To create the composite function h (x ) = f ( g(x )), choose the New Function command to define function h (x ), and follow the same process, using x rather than 3 as the argument.
See
also
Calculate
New Function
To create the derivative of a function with respect to its independent variable, select the function, then choose Derivative from the Graph menu. The result is a derivative function that can be plotted or evaluated like any other function.
See
also
Derivative