%% This document created by Scientific Notebook (R) Version 3.0


\documentclass[12pt,thmsa]{article}
\usepackage{amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{makeidx}
\usepackage{sw20jart}

%TCIDATA{TCIstyle=article/art4.lat,jart,sw20jart}

%TCIDATA{<META NAME="ViewSettings" CONTENT="31">}
%TCIDATA{<META NAME="GraphicsSave" CONTENT="32">}
%TCIDATA{<META NAME="Title" CONTENT="Defining Variables and Functions">}
%TCIDATA{Created=Mon Aug 19 14:52:24 1996}
%TCIDATA{LastRevised=Thu Feb 13 17:11:57 1997}
%TCIDATA{Language=American English}
%TCIDATA{CSTFile=MathHelp.cst}
%TCIDATA{<LINK REL="author" HREF="DM0-1.tex">}
%TCIDATA{<LINK REL="begin" HREF="DM3-1.TEX">}
%TCIDATA{<LINK REL="contents" HREF="DM0-0.tex">}
%TCIDATA{<LINK REL="copyright" HREF="DM0-2.tex">}
%TCIDATA{<LINK REL="end" HREF="DM3-6.tex">}
%TCIDATA{<LINK REL="index" HREF="DMIndex.tex">}
%TCIDATA{<LINK REL="next" HREF="DM3-3.tex">}
%TCIDATA{<LINK REL="parent" HREF="DM3.tex">}
%TCIDATA{<LINK REL="previous" HREF="DM3-1.tex">}
%TCIDATA{<LINK REL="top" HREF="DM0-0.tex">}

\input{tcilatex}
\begin{document}


\section{Defining \label{Define}Variables and Functions 
\index{Define@Define!new definition@new definition}}

The \textsf{Define} command is a powerful tool in \textsl{Scientific Notebook%
}, enabling you to define a symbol to be a mathematical object and to define
a function using an expression or a collection of expressions. When you
choose \textsf{Define}, the submenu that comes up includes \textsf{New
Definition, Undefine, Show Definitions, Clear Definitions, Save Definitions,}%
\ \textsf{Restore Definitions}, and \textsf{Define Maple Name.} The first
four operations are explained in this section for the types of expressions
and functions that occur in precalculus. Examples of these operations
pertinent to topics such as calculus, vector analysis, and matrix algebra
are presented later, in context.

The two items\textsf{\ Save Definitions} and \textsf{Restore Definitions}
provide a way to save definitions with a document and to restore them when
reloading the document. The item \textsf{Define Maple Name} provides a way
to use Maple functions not included on the \textsl{Scientific Notebook}
menus. Click on 
\hyperref{Techniques for }{}{}{DM5.tex}\allowbreak \hyperref{Working With }{%
}{}{DM5.tex}\allowbreak \hyperref{Functions in \allowbreak }{}{}{DM5.tex}%
\hyperref{Scientific Notebook}{}{}{DM5.tex} for greater detail on these
items and other aspects of function definitions.

\strut

\subsection{\ \label{Define, variable}Assigning Values to Variables}

You can assign a value to a variable\label{Variable, define} 
\index{Define@Define!variable@variable}using \textsf{Define}.

\begin{quote}
$\blacktriangleright $ To assign the value $5$ to $z$
\end{quote}

\begin{enumerate}
\item[1.]  Write $z=5$ in mathematics mode.

\item[2.]  Leaving the insertion point in the equation,

\begin{itemize}
\item  click 
\FRAME{itbpF}{0.3001in}{0.3001in}{0.0701in}{}{}{newdef.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.3001in;height 0.3001in;depth
0.0701in;original-width 19.5625pt;original-height 18.8125pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'NEWDEF.WMF';file-properties "XNPEU";}} on the \textsf{Compute} toolbar

- or - \medskip 

\item  from the \textsf{Define} submenu, choose \textsf{New Definition}.
\end{itemize}
\end{enumerate}

\index{New definition@New definition}\label{New definition }Thereafter,
until you close the document or undefine the variable, the system recognizes 
$z$ as $5$, evaluating the expression $3+z$ as $\,8$. (Definitions can be
saved with the document when you exit \textsl{Scientific Notebook} as
explained in 
\hyperref{Saving and Restoring Definitions}{}{}{DM5-3.tex#Saving definitions}%
.)

Variables normally have single-character names. The value assigned can,
however, be any mathematical expression. For example, you could define a
variable to be any of the following.

\begin{itemize}
\item  Number: $a=245$

\item  Polynomial: $p=x^{3}+3x^{2}-5x+1$

\item  Quotient of polynomials: $b=\dfrac{x^{2}-1}{x^{2}+1}\vspace{6pt}$

\item  Matrix: $z=\left[ 
\begin{array}{cc}
a & b \\ 
c & d
\end{array}
\right] $
\end{itemize}

The symbol $p$ defined here represents the expression $x^{3}+3x^{2}-5x+1$.
It is not a function, and in particular, $p(2)$ is not the expression
evaluated at $x=2$. In fact, $p(2)=2p=\allowbreak 2x^{3}+6x^{2}-10x+2$.

\strut

\subsection{\ Functions \label{Define, function}\label{Function, define}of
One Variable}

You can use the same procedure to define 
\index{Define@Define!function@function} a function 
\index{Function@Function!define@define}.

\begin{quote}
$\blacktriangleright $ To define the function $f$ whose value at $x$ is $%
ax^{2}+bx+c$
\end{quote}

\begin{enumerate}
\item[1.]  Write $f(x)=ax^{2}+bx+c.$

\item[2.]  Place the insertion point in the equation.

\item[3.]  Click the \textsf{New Definition} button on the \textsf{Compute}
toolbar, or from the \textsf{Define} submenu, choose \textsf{New Definition}.
\end{enumerate}

\index{New definition@New definition}Now the symbol $f$ represents the
defined function and behaves like a function. Making the definition $%
f(y)=ay^{2}+by+c$\textsf{\ }defines the same function. The symbol used for
the function argument in making the definition does not matter. To see what
happens, define a function $f$ using the equation $f(x)=ax^{2}+bx+c$, and
apply \textsf{Evaluate} to $f(t)$ to get $f(t)=at^{2}+bt+c$.

\strut

\begin{quotation}
\textsl{Note}\emph{\quad }Making the definition $f(y)=ay^{2}+by+c$\textsf{\ }%
defines the \emph{same} function as the definition $f(x)=ax^{2}+bx+c$. \emph{%
The symbol used for the function argument in making the definition does not
matter}. This point illustrates the subtle but essential difference between
expressions and functions. In particular, the two expressions $y=x^{2}+%
\sqrt{x}$ and $y=t^{2}+\sqrt{t}$ are different (because $y$ gets replaced by
an expression in $x$ under the first definition and $y$ gets replaced by an
expression in $t$ under the second definition). However, the functions $%
f(x)=x^{2}+\sqrt{x}$ and $f(t)=t^{2}+\sqrt{t}$ are identical.
\end{quotation}

\strut

If $g$ and $h$ are previously defined functions, then the following
equations are examples of legitimate definitions: 
\begin{eqnarray*}
f(x) &=&2g(x) \\
f(x) &=&g(x)+h(x) \\
f(x) &=&g(x)h(x) \\
f(x) &=&g(h(x)) \\
&&\bigskip
\end{eqnarray*}
Make a definition for $g$ and $h$, and then apply \textsf{Evaluate} to $f(t)$
for each definition of $f$. Each time you redefine $f$, the new definition
replaces the old one. Also, once you have defined both $g(x)$ and $%
f(x)=2g(x) $, then changing the definition of $g(x)$ redefines $f(x)$.

\strut

\begin{quotation}
\textsl{Note}\emph{\quad }The algebra of functions includes objects such as $%
f\pm g$, $f\circ g$, $fg$, and $f^{-1}$. For the value of $f+g$ at $x$,
write $f(x)+g(x)$; for the value of the composition of two defined functions 
$f$ and $g$, write $f(g(x))$ or $\left( f\circ g\right) \left( x\right) $;
and for the value of the product of two defined functions, write $f(x)g(x)$.
You can obtain the inverse for some functions $f(x)$ by applying \textsf{%
Solve + Exact} to the equation $f(y)=x$ and specifying $y$ as the \textsf{%
Variable to Solve for}.
\end{quotation}

\strut

\begin{example}
Define $f(x)=x^{2}+3x+5$ and $g(x)=x^{3}-1$. Then, \textsf{Evaluate}
produces 
\begin{eqnarray*}
f(3) &=&\,23 \\
g(3) &=&\,26 \\
f(g(3)) &=&\,759 \\
g(f(3)) &=&\,12166 \\
f(4+5i) &=&8+55i \\
f\left( f\left( f\left( 4+5i\right) \right) \right) &=&7495808-6124745i
\end{eqnarray*}

\strut
\end{example}

\begin{example}
\label{Inverse}You can sometimes find the inverse of a 
\index{Inverse@Inverse!function@function}function $y=f(x)$, if it exists, by
interchanging $x$ and $y$ and solving for $y$.

\begin{itemize}
\item  To find the inverse of $f(x)=5x-3$:

\begin{itemize}
\item  Evaluate $f(y)$ to get $f(y)=5y-3.$

\item  Solve the equation $x=5y-3$ for $y$ using \textsf{Solve + Exact}.
\end{itemize}
\end{itemize}

This computation yields the solution $y=%
\frac{1}{5}x+\frac{3}{5}$. Thus 
\[
f^{-1}(x)=\frac{1}{5}x+\frac{3}{5} 
\]
To check this result, define $f(x)=5x-3$ and $g(x)=\frac{1}{5}x+\frac{3}{5}$%
. (The symbol $f^{-1}$ will not work as a function name.) Evaluating the
expressions $f(g(x))$ and $g(f(x))$ gives $f(g(x))=\,x$ and $g(f(x))=\,x$,
demonstrating that the function $g$ is the inverse of the function $f$.

\strut
\end{example}

\begin{example}
\label{Table of values}With Maple, you can find several values at once by
applying a function to an $n\times 1$ matrix of $x$ values.

\begin{enumerate}
\item  From the \textsf{Insert} menu, choose \textsf{Matrix}, or click 
\FRAME{itbpF}{0.3001in}{0.3001in}{0.0701in}{}{}{matrix.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.3001in;height 0.3001in;depth
0.0701in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'Matrix.wmf';file-properties "XNPEU";}}.

\item  Set the number of rows at $6$ and the number of columns at $1$.

\item  To put parentheses around the matrix, select it and click \FRAME{itbpF%
}{0.2793in}{0.2992in}{0.0692in}{}{}{parens.wmf}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"PICT";valid_file "F";width 0.2793in;height 0.2992in;depth
0.0692in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1.0179";cropright "0.9866";cropbottom "0";filename
'Parens.wmf';file-properties "XNPEU";}} or \FRAME{itbpF}{0.3001in}{0.3001in}{%
0.0701in}{}{}{sqbrack.wmf}{\special{language "Scientific Word";type
"GRAPHIC";maintain-aspect-ratio TRUE;display "PICT";valid_file "F";width
0.3001in;height 0.3001in;depth 0.0701in;original-width
20.3125pt;original-height 18.8125pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'Sqbrack.wmf';file-properties "XNPEU";}}.

\item  Enter five $x$ values in the matrix: $\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) $.

\item  Define $f(x)=x^{2}+3x+5$ and $g(x)=x^{3}-1$
\end{enumerate}

Now you can apply $f$, $g$, $gf$, and $fg$ to the matrix with \textsf{%
Evaluate} to get tables of values.\vspace{6pt} 
\begin{eqnarray*}
f\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) &=&\,\left( 
\begin{array}{c}
x^{2}+3x+5 \\ 
5 \\ 
9 \\ 
15 \\ 
23 \\ 
33
\end{array}
\right) \\
&& \\
g\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) &=&\left( 
\begin{array}{c}
x^{3}-1 \\ 
-1 \\ 
0 \\ 
7 \\ 
26 \\ 
63
\end{array}
\right) \\
&&
\end{eqnarray*}
Note that you can write $fg(\cdot )$ for the composition $f(g(\cdot ))$,
since $g(X)$ is already a matrix with brackets around it. You will also
notice that you must apply \textsf{Evaluate} twice to get the value of $%
fg(X) $ or $gf(X)$.\vspace{6pt} 
\begin{eqnarray*}
fg\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) &=&f\left( 
\begin{array}{c}
x^{3}-1 \\ 
-1 \\ 
0 \\ 
7 \\ 
26 \\ 
63
\end{array}
\right) =\left( 
\begin{array}{c}
\left( x^{3}-1\right) ^{2}+3x^{3}+2 \\ 
3 \\ 
5 \\ 
75 \\ 
759 \\ 
4163
\end{array}
\right) \\
&& \\
gf\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) &=&g\left( 
\begin{array}{c}
x^{2}+3x+5 \\ 
5 \\ 
9 \\ 
15 \\ 
23 \\ 
33
\end{array}
\right) =\left( 
\begin{array}{c}
\left( x^{2}+3x+5\right) ^{3}-1 \\ 
124 \\ 
728 \\ 
3374 \\ 
12166 \\ 
35936
\end{array}
\right) \vspace{6pt}
\end{eqnarray*}
To put the $x$ and $y$ values in a two-column matrix, place copies of the
initial and final matrices next to each another, put the insertion point in
one of the matrices, and from the \textsf{Matrices} submenu, choose \textsf{%
Concatenate}.\vspace{6pt} 
\[
\left( 
\begin{array}{c}
x \\ 
0 \\ 
1 \\ 
2 \\ 
3 \\ 
4
\end{array}
\right) \left( 
\begin{array}{c}
\left( x^{3}-1\right) ^{2}+3x^{3}+2 \\ 
3 \\ 
5 \\ 
75 \\ 
759 \\ 
4163
\end{array}
\right) ,\text{ concatenate: }\left( 
\begin{array}{cc}
x & \left( x^{3}-1\right) ^{2}+3x^{3}+2 \\ 
0 & 3 \\ 
1 & 5 \\ 
2 & 75 \\ 
3 & 759 \\ 
4 & 4163
\end{array}
\right) \vspace{6pt} 
\]
\end{example}

\strut

\begin{quotation}
\emph{Tip\quad }To make a table that will print with lines, create a table
with \textsf{Insert + Table}\quad (or click \FRAME{itbpF}{27.5pt}{24.8125pt}{%
7pt}{}{}{table.wmf}{\special{language "Scientific Word";type
"GRAPHIC";maintain-aspect-ratio TRUE;display "PICT";valid-file "F";width
27.5pt;height 24.8125pt;depth 7pt;original-width 20.3125pt;original-height
18.8125pt;cropleft "0";croptop "1";cropright "1";cropbottom "0";filename
'table.wmf';file-properties "XNPEU";}}) and copy the information into the
table by selecting, clicking and dragging each piece of data. Choose \textsf{%
Edit + Properties} and add lines according to instructions in the tabbed 
\textsf{Table Properties} dialog. This is only for purposes of editing---a
table does not behave mathematically as a matrix.
\end{quotation}

\strut

\subsection{\ Functions of Several Variables \label{Function, define (2)}}

\begin{quote}
$\blacktriangleright $ To define a function of several variables
\end{quote}

\begin{enumerate}
\item[1.]  Write an equation such as $f(x,y,z)=ax+y^{2}+2z$ or $%
g(x,y)=2x+\sin 3xy$.

\item[2.]  Leave the insertion point in the equation.

\item[3.]  Click the \textsf{New Definition} button on the Compute toolbar,
or from 
\index{Function@Function!define@define}the \textsf{Define} submenu, choose 
\textsf{New\ Definition}.
\end{enumerate}

As in the case of functions of one variable, \textsl{Scientific Notebook}
always operates on expressions obtained by evaluating the function at a
point.

\strut

\subsection{\ Piecewise-Defined Functions \label{Piecewise-defined function}}

You can define functions 
\index{Piecewise-defined function@Piecewise-defined function} of one
variable that are 
\index{Function@Function!piecewise definition@piecewise definition}described 
\label{Function, piecewise definition}by different expressions on different
parts of their domain. These functions are referred to as \emph{%
piecewise-defined functions}, 
\index{Case function@Case function}\label{Case function}\emph{case functions}
or 
\index{Multicase function@Multicase function}\label{Multicase function} 
\emph{multicase functions}. Most of the operations introduced in calculus
are now supported for piecewise-defined functions. You can evaluate, plot,
differentiate, and integrate piecewise-defined functions in \textsl{%
Scientific Notebook}.

\begin{quote}
$\blacktriangleright $ To define a piecewise-defined function
\end{quote}

\begin{enumerate}
\item[1.]  Type an expression of the form $f(x)=$.

\item[2.]  From the brackets list 
\FRAME{itbpF}{0.2992in}{0.2992in}{0.0692in}{}{}{fences.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.2992in;height 0.2992in;depth
0.0692in;original-width 24.0625pt;original-height 22.5625pt;cropleft
"-0.038101";croptop "1.056001";cropright "0.979799";cropbottom
"0.038101";filename 'FENCES.WMF';file-properties "XNPEU";}}, choose a curly
brace \FRAME{itbpF}{0.1989in}{0.2992in}{0.0692in}{}{}{Figure }{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.1989in;height 0.2992in;depth
0.0692in;original-width 15.0625pt;original-height 24.8125pt;cropleft
"-0.062997";croptop "1.0014";cropright "0.996403";cropbottom "0";filename
'lbrace.wmf';file-properties "XNPEU";}} for the left bracket and the dashed
vertical line (or null bracket) \FRAME{itbpF}{0.1989in}{0.2992in}{0.0692in}{%
}{}{Figure }{\special{language "Scientific Word";type
"GRAPHIC";maintain-aspect-ratio TRUE;display "PICT";valid_file "F";width
0.1989in;height 0.2992in;depth 0.0692in;original-width
15.8125pt;original-height 24.8125pt;cropleft "-0.062997";croptop
"1.0394";cropright "0.987003";cropbottom "0";filename
'DASHLINE.wmf';file-properties "XNPEU";}} for the right bracket.

\item[3.]  Click the \textsf{Matrix} button on the \textsf{Math} toolbar, or
from the \textsf{Insert} menu, choose \textsf{Matrix}.

\item[4.]  Set the number of rows equal to the number of ``pieces.''

\item[5.]  Set the number of columns to $3$.

\item[6.]  Choose \textsf{OK}.

\item[7.]  Type function values in the first column.

\item[8.]  Type ``if'' in the second column (in text or mathematics mode).

\item[9.]  Type the range condition in the third column, beginning with
smallest values of the variable.
\end{enumerate}

\strut

\begin{quotation}
\label{Null delimiter}\emph{Note the strict conditions concerning the
definition of piecewise-defined functions}. Such functions must be specified
by a three-column matrix with at least two rows. The \emph{function values}
must be in the first column, and the \emph{range conditions} must be in the
third column. Also, the matrix must be enclosed by a left brace and a
``null'' right delimiter, as in the following examples $f$ and $g$. (The 
\index{Null delimiter@Null delimiter}null right delimiter appears as a red
dashed line on the screen when \textsl{Matrix Lines} is checked on the 
\textsl{View} menu, and does not appear when the document is printed or when 
\textsl{Matrix Lines} is not checked.)
\end{quotation}

\strut

\begin{example}
The function $f$ has three ``cases'' or range conditions on the independent
variable, and the function $g$ has five. Note that the intervals for the
range conditions are arranged in order with the smallest values of $x$ in
the first row and the largest values in the bottom row.

\begin{itemize}
\item  $f(x)=\left\{ 
\begin{array}{ccl}
x+2 & 
\text{if} & x<0 \\ 
2 & \text{if} & 0\leq x\leq 1 \\ 
2/x & \text{if} & 1<x
\end{array}
\right. $

\item  $g(t)=\left\{ 
\begin{array}{ccl}
t & \text{if} & t<0 \\ 
0 & \text{if} & 0\leq t<1 \\ 
1 & \text{if} & 1\leq t<2 \\ 
2 & \text{if} & 2\leq t<3 \\ 
6-t & \text{if} & 3\leq t
\end{array}
\right. $
\end{itemize}
\end{example}

With the insertion point in expressions such as the preceding ones (or with
the entire equation selected with the mouse), click the \textsf{New
Definition} button on the \textsf{Compute} toolbar, or go to the \textsf{%
Define} submenu and choose \textsf{New Definition}. Choose \textsf{Evaluate}
to get results such as 
\[
f(-1)=\,1\quad f(\frac{1}{2})=\,2\quad f(2)=\,1\quad g(3)=3 
\]
The following plots are the graphs of $f$ and $g$ for $-5\leq t\leq 5$.

\FRAME{dtbpFU}{2.0609in}{1.382in}{0pt}{\Qcb{$f(x)$ or $f$}}{}{piecews1.wmf}{%
\special{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 2.0609in;height 1.382in;depth
0pt;original-width 216.8125pt;original-height 144.5625pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'piecews1.wmf';file-properties "XNPEU";}}

For the function $y=g(x)$ 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 \hyperref{Plotting Defined
Functions}{}{}{DM6-4.tex#Plot piecewise-defined function} for guidelines to
plotting piecewise-defined functions.

\begin{center}
\FRAME{itbpFU}{2.2675in}{1.5186in}{0in}{\Qcb{$g(x)$}}{}{piecews4.wmf}{%
\special{language "Scientific Word";type "GRAPHIC";display "PICT";valid-file
"F";width 2.2675in;height 1.5186in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'Piecews4.wmf';file-properties "XNPEU";}} \FRAME{%
itbpFU}{2.0609in}{1.382in}{0in}{\Qcb{$g$}}{}{piecews2.wmf}{\special{language
"Scientific Word";type "GRAPHIC";maintain-aspect-ratio TRUE;display
"PICT";valid-file "F";width 2.0609in;height 1.382in;depth 0in;original-width
216.8125pt;original-height 144.5625pt;cropleft "0";croptop "1";cropright
"1";cropbottom "0";filename 'Piecews2.wmf';file-properties "XNPEU";}}
\end{center}

\strut

\subsection{\ Defining Generic Functions and Generic Constants \label%
{Generic functions}}

You can use \textsf{Define + New Definition} to 
\index{Generic functions@Generic functions} declare an expression of the
form $f(x)$ to be a function without specifying any of the function values
or behavior. Thus you can use the function name as input when defining other
functions or performing various operations on the function.

\strut

\begin{example}
In this example, $f(x)$ is a generic function. We define a particular
function $h(x)$ to illustrate the behavior of $f(x)$.

\begin{itemize}
\item  Place the insertion point in $f(x)$ and choose \textsf{Define + New
Definition.}

\item  Place the insertion point in $h(x)=%
\frac{x-1}{x+1}$ and choose \textsf{Define + New Definition.}

\item  Evaluate $h(f(x))$ to get $h(f(x))=\frac{f\left( x\right) -1}{f\left(
x\right) +1}.$

\item  Evaluate $f(h(x))$ to get $f(h(x))=f\left( \frac{x-1}{x+1}\right) .$
\end{itemize}
\end{example}

\strut

\label{Generic constant}You can use \textsf{Define + New Definition} to 
\index{Generic functions@Generic functions}declare a character to be a
(generic) constant.

\begin{quote}
$\blacktriangleright $ \textsf{Define + New Definition}
\end{quote}

\begin{quotation}
$a$
\end{quotation}

\begin{quote}
$\blacktriangleright $ \textsf{Calculus + Implicit Differentiation}
\end{quote}

\begin{quotation}
$ax+y=0$ (\textsf{Differentiation Variable}: $x$) Derivative: $a+y^{\prime
}=0\medskip $

$bx+y=0$ (\textsf{Differentiation Variable}: $x$) Derivative: $b^{\prime
}x+b+y^{\prime }=0$
\end{quotation}

\strut

Note that $a^{\prime }=0$ while $b^{\prime }$ is not automatically assumed
to be $0$.

\strut

\subsection{\ Showing Definitions}

After making definitions of functions or expressions, you need to know
techniques for keeping track of them, saving them, and deleting them. \label%
{Show definitions}

\begin{quote}
$\blacktriangleright $ To view the list of currently defined variables and
functions
\end{quote}

\begin{itemize}
\item  Click 
\FRAME{itbpF}{0.3035in}{0.3035in}{0.0701in}{}{}{showdef.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid_file "F";width 0.3035in;height 0.3035in;depth
0.0701in;original-width 17.8125pt;original-height 16.9375pt;cropleft
"0";croptop "1";cropright "1";cropbottom "0";filename
'SHOWDEF.WMF';file-properties "XNPEU";}}, or from 
\index{Show definitions@Show definitions}the \textsf{Define} submenu, choose 
\textsf{Show Definitions}.
\end{itemize}

A window comes up showing the active definitions. In general, the defined
variables and functions are listed in the order in which the definitions
were made.

\strut

\begin{example}
Define $a=b$, $p=ax$, and $f(x)=ax$. Choose \textsf{Show Definitions} from
the \textsf{Define} submenu to see the list 
\[
\begin{array}{l}
a=b \\ 
p=ax \\ 
f(x)=ax
\end{array}
\]
of defined functions and expressions. Evaluation of $p$ and $f(x)$ produces $%
p=\,bx$ and $f(x)=\,bx$. Redefining $c$ with the equation $a=c$ and again
evaluating $p$ and $f(x)$ produces $p=\,cx$ and $f(x)=\,cx$.

\strut
\end{example}

\subsection{\ Removing Definitions \label{Clear definitions}\label{Undefine}}

\begin{quote}
$\blacktriangleright $ To remove a definition from a document 
\index{Define@Define!remove a definition@remove a definition} 
\index{Undefine@Undefine}
\end{quote}

\begin{enumerate}
\item[1.]  Place the insertion point in the equation you wish to undefine,
or select the name of the function or expression.

\item[2.]  From the \textsf{Define} submenu, choose \textsf{Undefine}.
\end{enumerate}

From the \textsf{Define} submenu, you can choose \textsf{Show definitions}
to see that the definition has been removed from the list of defined
functions and expressions.

\begin{quote}
$\blacktriangleright $ To remove all definitions in a document
\end{quote}

\begin{itemize}
\item  From the \textsf{Define} submenu, choose \textsf{Clear Definitions}. 
\index{Define@Define!clear definitions@clear definitions}\label%
{Define, clear definitions} 
\index{Clear definitions@Clear definitions}
\end{itemize}

If you have worked the preceding examples, you have made several definitions
and you should remove them before continuing. Definitions that you do not
remove remain active as long as a document is open. As a default,
definitions are saved and then restored when you reopen a document. You can
change this setting so that exiting a document in \textsl{Scientific Notebook%
} will remove your definitions. See 
\hyperref{Saving Definitions}{}{}{DM5-3.tex#Saving definitions} for more
discussion of \textsf{Save Definitions}, \textsf{Restore Definitions}, and 
\textsf{Clear Definitions}.

\strut

\subsection{\ Errors Resulting from (Overlooked) Definitions \label%
{Clearing definitions}}

It is easy to forget that a symbol has been defined to be some expression.
If you use that symbol later, you can get surprising results. For example,
if you define $a=x^{2}$, forget about it, and later compute $f(a)$ for some
function $f$ that you have just defined, you are in for a surprise. In
complicated computations the error may not be apparent.

\strut

\begin{quotation}
\emph{Tip\quad }Check the \textsf{Show Definitions} list from time to time.
If your mathematics is behaving strangely, this list is a place to look for
a possible explanation.
\end{quotation}

\strut

\subsection{\ Related topics}

\begin{itemize}
\item  \hyperref{Valid Names for Functions and Expressions}{}{}{%
DM5-1.tex#Function name}

\item  \hyperref{Saving and Restoring Definitions}{}{}{DM5-3.tex#Saving
definitions}

\item  \hyperref{Plotting Defined Functions}{}{}{DM6-4.tex#Plot function}

\item  \hyperref{Plotting Expressions}{}{}{DM6-4.tex#Plot expression}

\item  \hyperref{Exercises and Solutions}{}{}{DM3-6.tex#Exercises}
\end{itemize}

\rule{0.67in}{0.01in}

\hyperref{\FRAME{itbpF}{38.875pt}{24.5pt}{6pt}{}{}{index.wmf}{\special%
{language "Scientific Word";type "GRAPHIC";maintain-aspect-ratio
TRUE;display "PICT";valid-file "F";width 38.875pt;height 24.5pt;depth
6pt;original-width 36.125pt;original-height 22.5625pt;cropleft "0";croptop
"1";cropright "1";cropbottom "0";filename 'index.wmf';file-properties
"XNPEU";}}}{}{}{DMIndex.tex#Math Index}\quad {\small Index entries: 
\hyperref{Define}{}{}{DMIndex.tex#Define}, \hyperref{Table of values}{}{}{%
DMIndex.tex#Table of values}}

\end{document}
