Copyright: Copyright © 1988-2001 Texas Instruments Incorporated


Contents
Help Contents

Click on one of the following topics to get help on Derive:

Additional Resources

Acknowledgments

Technical Support

Derive 5 Revision Summary

Lists of Derive constants, operators, functions, and reserved names:

Constants

Operators

Functions

Reserved Names

Frequently Asked Questions and Answers

User Interface Questions

Simplification Questions

Plotting Questions

Printing Questions

System Requirement Questions

Network Installation Questions

Algebra Window Commands

File commands

Edit commands

Insert commands

Author commands

Simplify commands

Solve commands

Calculus commands

Declare commands

Options commands

Window commands

Help commands

Additional Algebra window topics

Entering Mathematical Expressions

Selecting Objects and Subexpressions

Ordering Variables in Expressions

Controlling Notation

Controlling Radix Base

Controlling Expression Format

Step-by-Step Equation Solving

Solving Equations and Inequalities Algebraically

Solving Equations Numerically

Solving Systems of Equations

Significance of Domain Declarations

Using and Saving State Variables

DERIVE Initialization File

2D-plot Window Commands

File commands

Edit commands

Insert commands

Set commands

Options commands

Window commands

Help commands

Additional 2D-plot window topics

Multiple Plots

Polar Plots

Parametric Plots

Data Matrix Plots

Implicit Plots

3D-plot Window Commands

File commands

Edit commands

Insert commands

Set commands

Options commands

Window commands

Help commands

Additional 3D-plot Window topics

Framing 3D Plots

Vectors and Matrices

Generating Vectors and Matrices

Vector Manipulation Functions

String Processing Functions

Vector Operations

Matrix Operations

Row Echelon Form

Eigenvalues

Vector and Matrix Algebra

Differential Vector Calculus

Integral Vector Calculus

Built-in Functions and Constants

Exponential Functions

Logarithmic Functions

Trigonometric Functions

Inverse Trigonometric Functions

Hyperbolic Functions

Inverse Hyperbolic Functions

Piecewise Continuous Functions

Complex Variable Functions

Probability Functions

Statistical Functions

Error and Zeta Functions

Financial Functions

Number Theory Functions

Expression Type Functions

Expression Decomposition Functions

Numerical Operators

Relational Operators

Set Operators and Functions

Boolean Constants and Operators

Boolean Functions

Truth Table Functions

Utility File Functions

ENGLISH.MTH - English Units Conversion

METRIC.MTH - Metric Units Conversion

PHYSICAL.MTH - Physical Constants

SOLVE.MTH - Nonlinear Systems and Complex Solutions

VECTOR.MTH - Additional Vector and Matrix Functions

NUMERIC.MTH - Numerical Differentiation and Integration

DIF_APPS.MTH - Applications of Differentiation

INT_APPS.MTH - Applications of Integration

ODE1.MTH - First-order Ordinary Differential Equations

ODE2.MTH - Second-order Ordinary Differential Equations

ODE_APPR.MTH - Approximate Solution of ODEs

RECUREQN.MTH - Recurrence Equations

APPROX.MTH - Pade Rational Approximation

EXP_INT.MTH - Exponential, Log, Sine, and Cosine Integrals

PROBABIL.MTH - Probability Functions

FRESNEL.MTH - Fresnel Integrals

BESSEL.MTH - Bessel and Airy Functions

HYPERGEO.MTH - Hypergeometric Functions

ELLIPTIC.MTH - Elliptic Integrals

ORTH_POL.MTH - Orthogonal Polynomials

ZETA.MTH - Generalized Riemann Zeta Function

GRAPHICS.MTH - Plotting Space Curves & Complex Expressions

NUMBER.MTH - Number Theory Functions

COMBINAT.MTH - Combinatorial Functions

MISC.MTH - Miscellaneous Utility Functions

User Contributed Math Packages

Programming in DERIVE

The ITERATES Function

The ITERATE Function

IF Expressions

Nested IF Expressions

Boolean Test Clauses

Recursive Functions

Mutual Recursion

Procedural Programming

Epilogue

For help on Help, Press F1


Algebra Window Commands

The following are the algebra window commands:

File commands

New

Open...

Close

Save

Save As...

Load > Math File...

Load > Data File...

Load > Demo File...

Load > Utility File...

Write commands...

Page Setup...

Print Preview

Print...

Exit

Edit commands

Object...

Annotation...

Links to OLE Objects...

Delete

Undelete

Select All

Cut

Copy

Paste

Mark and Copy...

Insert commands

2D-plot Object...

3D-plot Object...

Text Object...

OLE Object...

Author commands

Expression...

Vector...

Matrix...

Simplify commands

Basic

Expand...

Factor...

Approximate...

Variable Substitution...

Subexpression Substitution...

Solve commands

Expression...

System...

Calculus commands

Limit...

Differentiate...

Taylor Series...

Integrate...

Sum...

Product...

Vector...

Table...

Declare commands

Variable Value...

Variable Domain...

Function Definition...

Input Settings...

Output Settings...

Simplification Settings...

Reset All Settings

Options commands

Display > Alignment of New Objects...

Display > Font of All Expressions...

Display > Font of New Text Objects...

Display > Background Color...

Printing > Expression Layout...

Printing > Header and Footer...

Printing > Page Setup...

Printing > Printer Setup...

Startup command

•	Renumber Expressions

•	Hide Labels

•	Hide Plots

•	Hide Text

•	Hide OLE Objects

Window commands

Cascade

Tile Horizontally

Tile Vertically

Display Tabs

New 2D-plot Window

New 3D-plot Window

•	View Toolbars commands

Help commands

Contents

Index

Frequently Asked Questions

Additional Resources

Link to DERIVE Web Site...

About DERIVE...

Additional algebra window topics

Entering Mathematical Expressions

Selecting Objects and Subexpressions

Ordering Variables in Expressions

Controlling Notation

Controlling Radix Base

Controlling Expression Format

Step-by-Step Equation Solving

Solving Equations and Inequalities Algebraically

Solving Equations Numerically

Solving Systems of Equations

Significance of Domain Declarations

Using and Saving State Variables

DERIVE Initialization File

Other Help Contents


Algebra Window File commands

Use the algebra window File commands to open and close a worksheet, to load and save an MTH or other file, to print or preview the objects in the active worksheet, or to exit Derive.

New

Open...

Close

Save

Save As...

Load > Math File...

Load > Data File...

Load > Demo File...

Load > Utility File...

Write commands...

Page Setup...

Print Preview

Print...

A list of the DFW and MTH files for the most recently used worksheets is displayed before the File > Exit command.  Up to four files are listed and a number precedes each file.  Clicking on the file name or entering the number of the file makes it easy to reopen the corresponding worksheets.

Exit

Other Algebra Window Commands


File > New command

Use the File > New command, click on the [image] icon on the command toolbar, or press Ctrl+N to create a new worksheet and a new algebra window.  The new worksheet will not contain any objects (i.e. no mathematical expressions, plot images, text, or OLE objects), user-defined functions, or user- assigned variables.  The Derive state variables settings (e.g. the precision, notation, radix base, etc.) will be the same as when these settings were last saved.

The title bar at the top of the new window will display the word Algebra followed by the number of the algebra window.

Other Algebra Window File commands


File > Open command

Use the File > Open command, click on the [image] icon on the command toolbar, or press Ctrl+O to find and open an existing Derive worksheet in a new algebra window.  This command allows you to select a DFW or MTH file using the standard Windows Open file dialog box.  By default, only files with an extension name of dfw or mth are displayed.

If a DFW file is opened, all the worksheet objects (i.e. mathematical expressions, plot images, text, and OLE objects), definitions, assignments, declarations, and state variables existing at the time of the save will be restored.  If an MTH file is opened, only the mathematical expressions in the worksheet and their corresponding annotations existing at the time of the save will be restored.

The title bar at the top of the new window will display the word Algebra followed by the number of the algebra window and the name of the worksheet.

Other Algebra Window File commands


File > Close command

Use the File > Close command to close the active worksheet and its associated algebra and plot windows.

If any of the Derive state variable settings (e.g. the precision, notation, radix base, etc.) were changed during the session, you will be asked if you want to store these changed settings for use as the new default when a worksheet is created (see Using and Saving State Variables).

If the worksheet has changed since it was last saved, you will be prompted to save the changes as a DFW or MTH file before the worksheet is closed.

When an algebra window is closed, the window size, position, background color, etc. are automatically saved in the DERIVE initialization file  to be used when subsequent algebra windows are created.

Other Algebra Window File commands


File > Save command

Use the File > Save command, click on the [image] icon on the command toolbar, or press Ctrl+S to save the objects in the active worksheet as a file.

•	If the active worksheet is associated with a DFW file, all the objects in the worksheet (i.e. mathematical expressions, plot images, text, and OLE objects) are saved in the file.   Also, all the function definitions, variable assignments, domain declarations, and state variable settings are saved as well.  When the DFW file is opened at a later time using a File > Open command, all the worksheet objects, definitions, assignments, declarations, and state variables existing at the time of the save will be restored.

•	If the active worksheet is associated with an MTH file, only the mathematical expressions in the worksheet and their corresponding annotations are saved in the file.  The expressions and annotations in the MTH file can be reloaded at a later time using a File > Open command or a File > Load > Math File command.

•	If the active worksheet is not associated with a DFW or MTH file (i.e. no file name is displayed on the window’s title bar), the File > Save command asks you to enter the name of a DFW or MTH file using the same dialog box used by the File > Save As command.

Expressions and the Derive state variable settings are saved as ASCII text in MTH files.  These files can be examined and/or modified by any editor capable of editing standard text files.  Long expressions in MTH files are written on multiple lines using a tilde (~) as the continuation character.  The objects saved in DFW files cannot be edited using standard text editors.

Other Algebra Window File commands


File > Save As command

Use the File > Save As command to save the objects in the active worksheet to a file that you specify.  The command allows you to enter a file name and select the type of file to use for saving the objects.

•	If the DfW file type is selected, all the objects in the worksheet (i.e. mathematical expressions, plot images, text, and OLE objects) are saved in the file.   Also, all the function definitions, variable assignments, domain declarations, and state variable settings are saved as well.  When the DFW file is opened at a later time using a File > Open command, all the worksheet objects, definitions, assignments, declarations, and state variables existing at the time of the save will be restored.  If you do not specify an extension, dfw is used as the extension for DFW files.

•	If the MTH file type is selected, only the mathematical expressions in the worksheet and their corresponding annotations are saved in the file.  The expressions and annotations in the MTH file can be reloaded at a later time using a File > Open command or a File > Load > Math File command.  If you do not specify an extension, mth is used as the extension for MTH files.

If saving an MTH file, the File > Save As command provides the following options not available when saving a DFW file:

•	You can choose to save all the expressions in the active worksheet or just the selected (i.e. highlighted) expressions.

•	Along with the expressions, you can choose to save the Derive state variable settings (i.e. the precision, notation, radix base, etc.).  All of the state variables and their values will be written to the MTH file before any of the expressions are saved (see Using and Saving State Variables).

•	If an MTH file with the same name already exists, you can choose to rename the extension of the existing MTH file to be bak before saving the new MTH file.

Expressions and the Derive state variable settings are saved as ASCII text in MTH files.  These files can be examined and/or modified by any editor capable of editing standard text files.  Long expressions in MTH files are written on multiple lines using a tilde (~) as the continuation character.  The objects saved in DFW files cannot be edited using standard text editors.

Other Algebra Window File commands


File > Load > Math File command

Use the File > Load > Math File command to load the expressions and associated annotations and calculation times stored in an MTH file into the active algebra window.  This command allows you pick a Derive math file using the standard Windows Open file dialog box.  By default, only files with an extension name of mth are displayed.

Other Algebra Window File commands


File > Load > Data File command

Use the File > Load > Data File command to load into the active algebra window a numeric data file produced by instrumentation or other math programs.  This command allows you pick a data file using the standard Windows Open file dialog box.  By default, only files with an extension name of dat are displayed.

Each line of the data file must be a list of numbers separated by spaces and/or commas.  The numbers must be in standard integer, rational, or floating point notation with an optional E or D followed by an exponent (e.g. −2.325E−7).  Derive interprets each row of the data file as a row of a matrix, with blank lines used to separate matrices.

Other Algebra Window File commands


File > Load > Demo File command

Use the File > Load > Demo File command to simplify the expressions read from a demonstration file. This command allows you pick a Derive demonstration file using the standard Windows Open file dialog box.  By default, only files with an extension name of dmo are displayed.

After each expression is read and displayed in the active algebra window, the expression is simplified (see Simplify > Basic command) and that result is also displayed.  Derive then waits for you to click on the Next icon or to press the space bar or PgDn (page down) key before reading the next expression.  If you press the Stop icon or press the Esc (escape) key, the demonstration file is suspended and you are free to perform any Derive operation.  To resume the demonstration from the point at which it was suspended, issue another File > Load > Demo File command and select the same demonstration file.

The following demonstration files are distributed with Derive:

•	ARITH.DMO	Arithmetic demonstration file

•	ALGEBRA.DMO	Algebra demonstration file

•	TRIG.DMO	Trigonometry demonstration file

•	FUNCTION.DMO	Built-in function demonstration file

•	CALCULUS.DMO	Calculus demonstration file

•	MATRIX.DMO	Vector and matrix demonstration file

Additional demonstration files are included for some of the user-contributed math packages in the USERS directory.

Other Algebra Window File commands


File > Load > Utility File command

Use the File > Load > Utility File command or the LOAD function to load the function definitions and variable assignments in an MTH utility file into the active algebra window. The command allows you pick a utility file using the standard Windows Open file dialog box.  By default, only files with an extension name of mth are displayed.

Given the full path name of a MTH file as a string variable, the LOAD function loads the function definitions and variable assignments in the file.  For example,

LOAD("C:\DfW5\Math\Number.mth")

loads the utility file Number.mth from the \DfW5\Math directory on drive C.

Although available for use, the definitions and assignments in the utility file are not displayed in the algebra window, thereby saving space.  See Utility > File Functions for a detailed description of each utility file distributed with Derive.

Other Algebra Window File commands


File > Write commands

Use the File > Write > Basic, File > Write > C, File > Write > Fortran, and File > Write > Pascal commands to save all or some of the expressions in the active worksheet as a Basic, C, Fortran, or Pascal source file, respectively.  The expressions in the source file are suitable for including in programs written in these four computer programming languages.

After issuing one of these commands, a standard Windows dialog box allows you to enter a name and extension for the source file.  If you do not specify an extension, the extensions BAS, C, FOR, and PAS are used for Basic, C, Fortran, and Pascal source files, respectively.  The dialog box also provides the option to save all the expressions in the active worksheet, or just the selected (i.e. highlighted) ones.

Use the File > Write > Rich Text Format File command or press Ctrl+R to save all of the objects (except OLE objects) in the active worksheet as a Rich Text Format (RTF) file.  RTF files are suitable for loading into many word processing programs, and these programs can in turn convert them into HyperText Markup Language (HTML) document files suitable for use on Internet web sites.

After issuing this command, a standard Windows dialog box allows you to enter a name and extension for the RTF file.  If you do not specify an extension, the extension RTF is used for the file.

The settings specified by the Algebra Window Options commands determine the format of the RTF file as follows:

•	Paper size, orientation — as specified by the Options > Printing > Printer Setup command

•	Margins — as specified by the Options > Printing > Page Setup command

•	Font size, style — as specified by the Options > Printing > Expression Layout command

•	Font color — as specified by the Options > Display > Font of All Expressions command

•	Inclusion of annotations and computation times — as specified by the Options > Printing > Expression Layout command

Note that the files resulting from any of the File > Write commands can not be reloaded into Derive.  To save expressions for reloading into Derive, use the File > Save command.

Other Algebra Window File commands


File > Page Setup command

Use the File > Page Setup command to specify the left, right, top, and bottom margins of printed pages in inches.

Other Algebra Window File commands

Other Plot Window File commands


File > Print Preview command

Use the File > Print Preview command to preview on screen how pages will appear when printed.  If an algebra window is active, its worksheet is previewed.  If a plot window is active, its print image is previewed.  The standard Windows print preview window provides the capability for zooming in and out, and for browsing pages.

Other Algebra Window File commands

Other Plot Window File commands


File > Print command

If an algebra window is active, use the File > Print command, click on the [image] icon on the command toolbar, or press Ctrl+P to print the objects in the worksheet associated with the window.  If a plot window is active, use these same commands to print an image of the plot window.

If you issue the File > Print command or press Ctrl+P, a dialog box lets you specify the printer, the print range, number of copies, and printer properties including orientation of the printout (portrait or landscape).  However, if you click on the [image] icon, the printing begins immediately.

Other Algebra Window File commands

Other Plot Window File commands


File > Exit command

Use the File > Exit command to close all open worksheets and associated algebra and plot windows, and then terminate Derive.

If any of the Derive state variable settings (e.g. the precision, notation, radix base, etc.) were changed during the session, you will be asked if you want to store these changed settings for use as the new default when a worksheet is created (see Using and Saving State Variables).

If a worksheet has been changed since it was last saved, you will be prompted to save the changes as a DFW or MTH file before the worksheet is closed and Derive terminated.

Other Algebra Window File commands

Other Plot Window File commands


Algebra Window Edit commands

Use the algebra window Edit commands to edit and delete objects and annotations in the active worksheet; and to cut, copy, and paste objects and screen images.

Object...

Annotation...

Links to OLE Objects...

Delete

Undelete

Select All

Cut

Copy

Paste

Mark and Copy...

Other Algebra Window Commands


Edit > Object command

Use the Edit > Object command or press the Enter key to edit the currently selected object in the active worksheet.

•	If the selected object is a mathematical expression other than a vector or matrix, the expression is displayed on the expression entry line ready for editing.

•	If the selected object is a vector, each element of the vector is displayed on a separate line in a dialog box like that of the Author > Vector command.  You are also given the opportunity to change the number of elements of the vector.

•	If the selected object is a matrix, each element of the matrix is displayed on a separate line in a two dimensional format in a dialog box like that of the Author > Matrix command.  You are also given the opportunity to change the number of rows and columns of the matrix.

•	If the selected object is a plot object, the plot window for that object is activated allowing you to make changes to the plot window.  When you are finished, you have the option to update the plot object with a new plot image.

•	If the selected object is a text object, the blinking cursor is moved to the beginning of the text object ready for editing.  You can use the formatting toolbar to change the font style, size, justification, and color of the text.  Use the Window > View Toolbar > Formatting Toolbar command to turn on or off the toolbar.  When you have finished editing the text object, click outside the text object or press the Esc key.

•	If the selected object is an OLE object, the commands for the OLE object are activated.

Note that the Edit > Object command replaces the selected object with the newly edited object.

Other Algebra Window Edit commands


Algebra window Edit > Annotation command
Edit > Annotation command

Use the algebra window Edit > Annotation command to modify the annotation associated with the highlighted expression in the active worksheet.

When a new expression is added to the worksheet, it is given a default annotation summarizing how it was created.  An expression’s annotation is displayed in the status bar at the bottom of the Derive application screen when the expression is highlighted.  Also, the annotation is optionally displayed before the expression when the worksheet is printed or previewed.

Other Algebra Window Edit commands


Edit > Links to OLE Objects command

Use the Edit > Links to OLE Objects command to modify links to OLE objects.

Other Algebra Window Edit commands


Edit > Delete command

Use the Edit > Delete command, click on the [image] icon on the command toolbar, or press the Del key to delete the currently selected objects.  Note that an entire expression is deleted even if only a subexpression is highlighted.

Deleting objects that are no longer of interest makes it easier to view objects that are of interest and conserves memory space.  Note that the Edit > Undelete command can be used to recover the last deleted expressions.

Other Algebra Window Edit commands


Edit > Undelete command

Use the Edit > Undelete command or press Ctrl+Z to recover previously deleted objects.

If you delete one or more objects by mistake and wish to re-insert the objects in the same place, issue the Edit > Undelete command before moving the selection.  To move deleted objects to a new location, move the selection to the object after which you wish to re-insert the deleted objects, then issue the Edit > Undelete command.

Deleting and undeleting expressions can cause expression label numbers in a worksheet to get out of order if the automatic renumbering of expressions has been turned off by the Options > Renumber Expressions command.  Click on this same command to turn on the automatic renumbering of expressions thereby putting the expression label numbers in sequential order.

Other Algebra Window Edit commands


Edit > Select All command

Use the Edit > Select All command or press Ctrl+A to select all the objects in the active worksheet.  To delete all the objects in the active worksheet, issue this command before issuing the Edit > Delete command.

Other Algebra Window Edit commands


Edit > Cut command

Use the Edit > Cut command, click on the [image] icon on the command toolbar, right click and select the Cut command, or press Ctrl+X to copy the selected objects to the Windows clipboard and then delete the objects from the active worksheet. From the clipboard, the selection may be pasted into the same or a completely different worksheet using the Edit > Paste command.  To paste expressions into a word processor such as Microsoft Word the selection must contain only mathematical expressions.  After pasting, format the text using the DfW5 Printer truetype font.  To paste plot or text objects into another program, select and copy only one object at a time to the clipboard.

Additionally, the first expression or subexpression that is highlighted will be copied to the Windows clipboard in one dimensional ASCII format. Ctrl+V can be used to paste this expression or subexpression into any Derive dialog box where a mathematical expression is required (see Entering Mathematical Expressions).

Other Algebra Window Edit commands


Edit > Copy command

Use the Edit > Copy command, click on the [image] icon on the command toolbar, right click and select the Copy command, or press Ctrl+C to copy the selected object(s) to the Windows clipboard.  From the clipboard, the selection may be pasted into the same or a completely different worksheet using the Edit > Paste command.  To paste expressions into a word processor such as Microsoft Word the selection must contain only mathematical expressions.  After pasting, format the text using the DfW5 Printer truetype font.  To paste plot or text objects into another program, select and copy only one object at a time to the clipboard.

Additionally, the first expression or subexpression that is highlighted will be copied to the Windows clipboard in one dimensional ASCII format. Ctrl+V can be used to paste this expression or subexpression into any Derive dialog box where a mathematical expression is required (see Entering Mathematical Expressions).

Other Algebra Window Edit commands


Edit > Paste command

Use the Edit > Paste command, click on the [image] icon on the command toolbar, right click and select the Paste command, or press Ctrl+V to insert the Derive or OLE object(s) in the Windows clipboard into the worksheet before the currently selected object.

Other Algebra Window Edit commands


Edit > Mark and Copy command

Use the Edit > Mark and Copy command or press Ctrl+Shift+M to copy a rectangular region of the active window to the Windows clipboard in bitmap image format.  Once a Derive screen image is in the clipboard, you can paste the image into any Windows program that accepts graphics images, such as Microsoft Word or Microsoft Paint.

After issuing the Edit > Mark and Copy command the mouse pointer will change into a large cross.  Move the mouse cross to the desired upper left corner of the rectangular region, then hold down the left mouse button and move the mouse cross to the desired lower right corner of the rectangular region and release the mouse button.  The rectangular region will be copied to the clipboard.

If you want to copy the entire Windows screen to the clipboard in bitmap image format press the PrtSc (Print Screen) key.

If you want to copy just the Derive application screen to the Windows clipboard in bitmap image format press Alt+PrtSc.

Use the algebra window’s Edit > Copy command to copy the selected objects in the active worksheet to the Windows clipboard.

Use the plot window’s Edit > Copy Plot Window command to copy an image of a plot window to the Windows clipboard in bitmap image format.

Other Algebra Window Edit commands

Other Plot Window Edit commands


Algebra Window Insert commands

Use the algebra window Insert commands to insert new objects in the active worksheet.

2D-plot Object...

3D-plot Object...

Text Object...

OLE Object...

Other Algebra Window Commands


Insert > Expression command

Use the Insert > Expression command, click on the [image] icon on the command toolbar, or press the F2 key to insert a new mathematical expression in the active worksheet following the currently selected object.  The cursor is moved to the expression entry bar allowing you to type in and edit an expression (see Entering Mathematical Expressions).

Other Algebra Window Insert commands


Insert > Vector command

Use the Insert > Vector command or click on the [image] icon on the command toolbar to type in a vector of mathematical expressions and insert the vector in the active worksheet following the currently selected object.  After you enter the desired number of elements, you are presented with a dialog box that allows you to type in and edit the elements of the vector (see Entering Mathematical Expressions).

When satisfied with the vector, click on the OK button or press the Enter key to insert the vector in the active worksheet.  Click on the Simplify button or press Alt+S to simplify the vector before inserting it in the active worksheet.  Click on the Cancel button or press the Esc key to abort the command.

Other Algebra Window Insert commands


Insert > Matrix command

Use the Insert > Matrix command or click on the [image] icon on the command toolbar to type in a matrix of mathematical expressions and insert the matrix in the active worksheet following the currently selected object.  After you enter the desired number of rows and columns, you are presented with a dialog box that allows you to type in and edit the elements of the matrix (see Entering Mathematical Expressions).

When satisfied with the matrix, click on the OK button or press the Enter key to insert the matrix in the active worksheet.  Click on the Simplify button or press Alt+S to simplify the matrix before inserting it in the active worksheet.  Click on the Cancel button or press the Esc key to abort the command.

Other Algebra Window Insert commands


Insert > 2D-plot Object command

Use the Insert > 2D-plot command or press Ctrl+2 to insert a new 2D-plot object in the active worksheet following the currently selected objects and open up the corresponding new 2D-plot window (see the 2D-plot Window Commands).

Other Algebra Window Insert commands


Insert > 3D-plot Object command

Use the Insert > 3D-plot command or press Ctrl+3 to insert a new 3D-plot object in the active worksheet following the currently selected objects and open up the corresponding new 3D-plot window (see the 3D-plot Window Commands).

Other Algebra Window Insert commands


Insert > Text Object command

Use the Insert > Text command, click on the [image] icon on the command toolbar, or press the F5 key to insert a new text object in the active worksheet following the currently selected objects.  The new text object will be enclosed in a box indicating that it is selected.  Also, a blinking cursor will appear at the left end of the box indicating the point at which text can be entered.

You can use the formatting toolbar to change the font style, size, justification, and color of the text.  Use the Window > View Toolbar > Formatting Toolbar command to turn on or off the toolbar.  When you have finished editing the text object, click outside the text object or press the Esc key.

Other Algebra Window Insert commands


Insert > OLE Object command

Use the Insert > OLE Object command to insert a new OLE object in the active worksheet following the currently selected objects.

Other Algebra Window Insert commands


Author commands

Use the Author commands to add new mathematical expressions to the active worksheet.

Expression...

Vector...

Matrix...

Other Algebra Window Commands


Author > Expression command

Use the Author > Expression command, click on the [image] icon on the command toolbar, or press the F2 key to insert a new mathematical expression at the end of the active worksheet.  The cursor is moved to the expression entry bar allowing you to type in and edit an expression (see Entering Mathematical Expressions).

Other Author commands


Author > Vector command

A vector is a 1-dimensional array of mathematical expressions.  Use the Author > Vector command or click on the [image] icon on the command toolbar to add a new vector to the end of the active worksheet.  After you enter the desired dimension of the vector (i.e. the number of elements), you are presented with a dialog box that allows you to type in and edit the elements of the vector (see Entering Mathematical Expressions).

When satisfied with the vector, click on the OK button or press the Enter key to add the vector to the end of the active worksheet.  Click on the Simplify button or press Alt+S to simplify the vector before adding it to the active worksheet.  Click on the Cancel button or press the Esc key to abort the command.

Alternatively, a vector can be entered by typing in an expression of the form

[x1, x2, ..., xn]

where the xi are the elements of the vector.  The elements must be separated by commas, and the vector must be delimited using square brackets, [ ], rather than parentheses, ( ), or braces, { }.  For example, the 3-element vector

[2·x, -5, x^2]

displays as

          2
2·x, -5, x

To edit a vector, highlight it and issue the Edit > Object command or just press the Enter key.  This command gives you the opportunity to increase or decrease the number of elements of the vector.

You can highlight the elements of vectors by clicking on them or by pressing the appropriate arrow keys (see Selecting Objects and Subexpressions).  For example, if a vector is highlighted, press Shift+↓ (i.e. the down arrow key) to highlight the first element of the vector.  Then press Shift+→ (i.e. the right arrow key) to highlight successive elements.

Other Author commands


Author > Matrix command

A matrix is 2-dimensional array of mathematical expressions.  Use the Author > Matrix command or click on the [image] icon on the command toolbar to add a new matrix to the end of the active worksheet.  After you enter the desired number of rows and columns, you are presented with a dialog box that allows you to type in and edit the elements of the matrix (see Entering Mathematical Expressions).

When satisfied with the matrix, click on the OK button or press the Enter key to add the matrix to the end of the active worksheet.  Click on the Simplify button or press Alt+S to simplify the matrix before adding it to the active worksheet.  Click on the Cancel button or press the Esc key to abort the command.

Alternatively, a matrix can be entered by typing in an expression of the form

[x11, x12, ..., x1n; x21, x22, ..., x2n; ...; xm1, xm2, ..., xmn]

where the xij are the elements of the matrix.  The elements of a row must be separated by commas, the rows must be separated by semicolons, and the matrix must be delimited using square brackets, [ ], rather than parentheses, ( ), or braces, { }.  For example,

[a, b, c; d, e, f; g, h, i]

displays as the 3 by 3 matrix

 a  b  c

 d  e  f

 g  h  i

Internally matrices are stored as vectors of vectors, with each row vector having the same number of elements.  Thus, the above 3 by 3 matrix could also be entered as

[[a, b, c], [d, e, f], [g, h, i]]

Note that when a multi-row matrix is displayed, the elements of each row are separated by at least two spaces.  However when a single-row matrix is displayed, it is displayed as a vector of a vector in order to clearly distinguish it from the vector consisting of the same elements.  For example, the 1 by 3 matrix

[[2·x, -5, x^2]]

displays as

          2
2·x, -5, x

rather than as

           2
 2·x  -5  x

To edit a matrix, highlight it and issue the Edit > Object command or just press the Enter key.  This command gives you the opportunity to increase or decrease the number of rows and columns of the matrix.

You can highlight the elements of matrices by clicking on them or by pressing the appropriate arrow keys (see Selecting Objects and Subexpressions).  For example, if a matrix is highlighted, press Shift+↓ (i.e. the down arrow key) to highlight the first row of the matrix.  Then press Shift+→ (i.e. the right arrow key) to highlight successive rows.  Press Shift+↓ again to highlight the first element on the highlighted row.  Then press Shift+→ to highlight successive elements on that row.

Other Author commands


Simplify commands

Use the Simplify commands to simplify, expand, factor, approximate, or substitute in mathematical expressions.

Basic

Expand...

Factor...

Approximate...

Variable Substitution...

Subexpression Substitution...

Other Algebra Window Commands


Simplify > Basic command

Use the Simplify > Basic command, click on the [image] icon on the command toolbar, or press Ctrl+B to numerically and algebraically simplify mathematical expressions.

This command simplifies the currently highlighted expression or subexpression and displays the result in the algebra window.  The result is highlighted and has its own #n label number.  Its annotation, displayed at the left end of the status bar, includes the expression number of the expression that was simplified.

If you have no interest in seeing the unsimplified version of an expression, you can enter and simplify an expression in a single step using the Author > Expression command.  After entering an expression on the expression entry line, click on the Simplify button or press Alt+S instead of clicking on the OK button.  Then the new expression will be simplified and only the result displayed.

If you want to see both the input and the simplified result displayed on a single line, enter the expression on the expression entry line followed by an equal sign (=) and click on the OK button.  Derive will then display an equation whose left side is the unsimplified form of the expression and whose right side is its simplified form.

The Simplify > Basic command algebraically simplifies mathematical expressions.  The following are some of the simplifications this command performs:

•	It combines numeric subexpressions.  For example, 2·y·3 simplifies to 6·y.

•	It collects similar factors of a product.  For example, x²·y·x simplifies to x³·y.

•	It collects similar terms of a sum.  For example, 3·x+7+x simplifies to 4·x+7.

•	It employs identities involving 0.  For example, x+0 simplifies to x.

•	It employs identities involving 1.  For example, 1·x simplifies to x.

•	It distributes integer exponents over a product.  For example,

(3·x·y^3)^2

simplifies to

   2  6
9·x ·y

•	It cancels polynomial greatest common divisors.  For example,

(x^2 + 2·x·y + y^2)/(x^2 - y^2)

simplifies to

 x + y
———————
 x - y

•	It expands products and integer powers of polynomials to the extent that it may eliminate a variable or reduce the degree in a variable.  For example,

(x + 1)^2 - x^2

simplifies to 2·x+1.

•	It puts sums of expressions over a common denominator to the extent that it may eliminate a variable or reduce the degree in a variable.  For example,

2·x/(x^2 - 1) - 1/(x - 1)

simplifies to 1/(x+1).

Some of the classes of mathematical expressions that Derive can simplify are:

•	Univariate  polynomials composed of one variable, rational numbers, addition, subtraction, multiplication, and integer powers;

•	Multivariate polynomials similarly composed but having more than one variable;

•	Rational expressions composed of polynomials and ratios of polynomials;

•	Extended rational expressions composed of rational expressions and fractional powers of variables;

•	Algebraic expressions composed of rational expressions and fractional powers of rational and algebraic expressions; and

•	Elementary transcendental expressions composed of algebraic expressions and elementary functions (exponential, logarithmic, trigonometric, hyperbolic, and their inverses).

An expression in sufficiently simple form has no superfluous variables, roots, or functions, and no reducible polynomial degrees.  An expression not in sufficiently simple form may mislead you about the dependence and qualitative behavior of the expression.  For example, a result would be highly misleading if it appeared to be quadratic in a variable when it was actually linear.

The primary goal of the Simplify > Basic command is to transform expressions into a sufficiently simple form.  To accomplish this, it converts expressions to a normal form that automatically reduces most expressions to a sufficiently simple form.

Beyond the class of extended rational expressions, it is impractical and often impossible to guarantee a sufficiently simple form.  The Simplify > Basic command tries hard nonetheless, and often succeeds even for these more complicated expressions.

The secondary goal of the Simplify > Basic command is to transform expressions as little as necessary to achieve the primary goal.  In support of this, the normal form is as flexible as practical while still ensuring a sufficiently simple form for most expressions.  Thus the normal form often permits expressions to remain unexpanded, unfactored, or not put over a common denominator.

Despite its flexibility, the normal form can force transformations that do not yield a class simplification.  Therefore, Derive makes it easy to simplify just part of an expression.  Before issuing the Simplify > Basic command, highlight just the subexpression that you want simplified.  The result is a copy of the whole expression in which only the highlighted portion is simplified.

Often simplifying an entire expression results in an expression that does not annihilate a variable or reduce the degree.  Whereas, simplifying just the subexpression results in a simpler, more compact form of the expression.

The single quote mark in the annotation of an expression indicates that the expression was the result of simplifying a subexpression.

Depending on the expression, it can take a long time to do the expansions and canceling of common divisors, etc. necessary to simplify an expression.  After a few seconds, a Calculation Progress dialog box will appear indicating the following:

•	the expression being simplified;

•	the time spent thus far simplifying the expression; and

•	the percentage of memory being used to simplify the expression.  Note that this percentage is only updated periodically when Derive has to recycle memory for reuse.

Click on the dialog box's Abort button or press the Esc key to abort a Simplify > Basic command that is taking too long.  You can then try simplifying only portions of the expression.  For example, you can separately simplify complicated numerators and denominators.  The resulting expression may be incompletely simplified, but it is better than no simplification at all.

Simplification can also require a large amount of computer memory to store intermediate results.  If space is exhausted while simplifying an expression, the warning message Memory Full is displayed on the message line, an error beep is sounded, and no result is returned.

If the Simplify > Basic command generates a large expression that is not of interest, use the Edit > Delete command to save computer memory and screen space.

Other Simplify commands


Simplify > Expand command

The general objective when expanding an expression with respect to designated variables is to maximize the number of terms that are algebraically independent with respect to those variables.

Use the Simplify > Expand command, press Ctrl+E, or use the EXPAND function to expand a mathematical expression or subexpression with respect to some or all of its variables.  If a polynomial expression is expanded, the polynomial expansion is returned.  If a rational expression is expanded, the partial fraction expansion is returned.  Note that the Simplify > Expand command and the EXPAND function do not control exponential, logarithmic, and trigonometric expansion and collection.  For that, see Exponential Functions, Logarithmic Functions, and Trigonometric Functions respectively.

The Simplify > Expand command expands just the highlighted expression or subexpression.  If you highlight a subexpression, the result is a copy of the whole expression in which only the subexpression is expanded.

An expression that contains more than one variable can be expanded with respect to some or all of its variables.  The Simplify > Expand command displays a list of all the variables in the highlighted expression or subexpression, and allows you to select the desired expansion variables.  Click on the desired primary expansion variable, then click on the secondary expansion variable, etc.  These expansion variables temporarily override the ordering specified by the variable order list (see the Declare > Output Settings command).

The EXPAND function can be used on the expression entry line to expand an expression when it is simplified.  The call EXPAND(u,x,y,...) expands expression u(x,y,...) with respect to the variables x, y, ... .  If no variables are given, expansion is done with respect to all the variables in the expression.

Terms having the same degrees for all expansion variables are collected.  Non-expansion variables that occur in these collected terms are not expanded unnecessarily.  Comprehensibility tends to decline with the number of expansion variables.  For most problems you only need to expand with respect to a single variable.

Also use the Simplify > Expand command and the EXPAND function to find the partial fraction expansion of a rational expression or subexpression with respect to some or all of the variables in its denominator.

The EXPAND function can be used on the expression entry line to do partial fraction expansion.  The call EXPAND(u,amount,x,y,...) does partial fraction expansion on u(x,y,...) with respect to the variables x, y, ... .  If no variables are given, expansion is done with respect to all the variables in the expression.  The amount argument (Trivial, Squarefree, Rational, or raDical) specifies the amount of factoring done on the denominator of u.  Note that the amount argument must be capitalized exactly as shown.  The factoring amount defaults to Rational.

When a rational expression is expanded, the following sequence of transformations occurs:

•	If the rational expression is improper with respect to the primary expansion variable, it is transformed using polynomial division into an expanded polynomial quotient plus a proper rational expression.  (A rational expression is proper with respect to a variable if the total degree of the variable in the numerator of the expression is less than its total degree in the denominator);

•	The denominator of the proper expression is factored (see the Simplify > Factor command) with respect to the expansion variables.  The amount of factoring is that specified by the Simplify > Expand command or by the amount argument of the EXPAND function;

•	The proper expression is expanded into a sum of independent super-proper rational expression terms.  The denominator of each of these terms is one of the factors of the proper expression's denominator raised to a power not exceeding its power in the denominator.  (A rational expression is super-proper with respect to a variable if the total degree of the variable in the numerator of the expression is less than its degree in the base of the denominator); and

•	If the numerator of a super-proper rational term is a sum that contains expansion variables, the denominator of that super-proper rational term is distributed over those terms of the numerator that contain expansion variables.

Partial fraction expansion can be used to determine the quotient and remainder of two polynomials with respect to the primary expansion variable as follows:

•	The quotient polynomial is the sum of those terms of the partial fraction expansion that do not contain the primary variable in their denominators.  You can manually collect the quotient terms by editing the expression using the Edit > Object command.

•	The remainder polynomial is the difference between the numerator polynomial and the product of the quotient and denominator polynomials.  Thus if you also want the remainder polynomial, construct and simplify this difference.

The rational factoring required of the denominator can make partial fraction expansion quite slow if the denominator has sums of degree exceeding 2 in any of the expansion variables.  Consequently, expand only with respect to variables that you must (usually only a single variable).

If you want a ratio of an expanded numerator over an expanded denominator rather than partial fractions, then separately highlight and expand the numerator and denominator.  This kind of expansion is usually much quicker than partial fractions — at least for ratios with a sum in the denominator having expansion variables raised to high degrees.  However, the resulting expression is rarely informative or useful:  It ordinarily exhibits neither the zeros, poles, nor residues of the ratio, and it does not partition the ratio either into many factors or many terms.

Depending on the expression, the type of expansion, and the expansion variables, it may take a long time to expand an expression.  Click on the Calculation Progress dialog box's Abort button or press the Esc key to abort an Simplify > Expand command that is taking too long (for details, see the Simplify Basic command).  You can then try expanding only portions of the expression or expanding with respect to a different variable.  These actions may drastically reduce the computing time and improve the comprehensibility of a result.

Note that the Simplify > Expand command and the Simplify > Basic command both transform an expression into a sufficiently simple form.  However, the Simplify > Basic command is often much faster and usually yields an expression more similar to the original expression.

Other Simplify commands


Simplify > Factor command

Use the Simplify > Factor command, press Ctrl+F, or use the FACTOR function to factor a mathematical expression or subexpression with respect to some or all of its variables.

The Simplify > Factor command factors just the highlighted expression or subexpression.  If you highlight a subexpression, the result is a copy of the whole expression in which only the subexpression is factored.

If an expression is a number, the Simplify > Factor command factors the number into a product of prime numbers raised to integer powers (i.e. the prime decomposition).  For example, 1234567890 factors to

   2
2·3 ·5·3607·3803

Factoring a number may take a long time if it has two or more prime factors, each with more than ten decimal digits.  Click on the Calculation Progress dialog box's Abort button or press the Esc key to abort an Simplify > Factor command that is taking too long (for details, see the Simplify Basic command).

The general objective when factoring a polynomial with respect to designated variables is to maximize the number of independent factors in which the designated variables occur linearly and which have the simplest possible coefficients.  There is often a tradeoff between these two objectives.  For example, linear factors might be achievable only at the expense of complex coefficients.

A univariate polynomial expression is factored with respect to its variable.  Its numeric coefficients and exponents are not factored.  To factor them, highlight and factor them individually after factoring the entire expression with respect to the variable.

The Simplify > Factor command lets you select the amounts of factoring desired (Trivial, Squarefree, Rational, Radical, or Complex).  Successive options request increasing amounts of factorization at the expense of increased computation time.

The FACTOR function can be used on the expression entry line to factor an expression when it is simplified.  The call FACTOR(u,amount,x,y,...) factors expression u(x,y,...) with respect to the variables x, y, ... .  If no variables are given, factoring is done with respect to all the variables in the expression.  The amount argument (Trivial, Squarefree, Rational, raDical, or Complex) specifies the amount of factoring done on u.  Note that the amount argument must be capitalized exactly as shown.  The factoring amount defaults to Rational.

•	Trivial factoring places expressions over a common denominator.  Trivial factoring also factors out numbers and least powers of variables.

•	Squarefree factoring does trivial factoring and factors powers of sums or products of different powers of sums.

•	Rational factoring does square-free factoring and factors products of sums without introducing new fractional powers or complex numbers.

•	Radical factoring does rational factoring with the additional possibility of introducing fractional powers of numbers, such as √2.

•	Complex factoring does radical factoring with the additional possibility of introducing new complex numbers.

Fractional powers of complex numbers may introduce trigonometric and inverse trigonometric functions to achieve normal rectangular form.  In approximate or mixed mode, such subexpressions simplify to approximate real or complex numbers for numeric arguments.  In exact mode, they are left in symbolic form, which may be quite large.

Use radical factoring if you want real factors that are factored as far as possible.  Use complex factoring if you want factors that are linear factors in a variable.  Do not use radical or complex factoring if you want a concise expression without new fractional powers and/or complex numbers.

An expression that contains more than one variable can be factored with respect to some or all of its variables.  The Simplify > Factor command displays a list of all the variables in the highlighted expression or subexpression, and allows you to select the desired factorization variables.  Click on the desired primary factorization variable, then click on the secondary factorization variable, etc.  These factorization variables temporarily override the ordering specified by the variable order list  (see the Declare > Output Settings command).

Subexpressions that do not contain factorization variables are simplified without being unnecessarily transformed.  In other words, subexpressions involving only non-factoring variables are neither expanded nor factored unnecessarily.  Similar powers of factoring variables are collected and simplified.

New radicals introduced by radical or complex factoring may include non-factorization variables as well as numbers.

Depending on the expression, the type of factoring, and the factorization variables, it may take a long time to factor an expression.  Click on the Calculation Progress dialog box's Abort button or press the Esc key to abort an Simplify > Factor command that is taking too long (for details, see the Simplify Basic command).  You can then try factoring only portions of the expression or factoring with respect to a different variable.  These actions may drastically reduce the computing time and improve the comprehensibility of a result.

Note that the Simplify > Factor command (when not introducing fractional powers) and the Simplify > Basic command both transform an expression into a sufficiently simple form.  However, the Simplify > Basic command is often much faster and usually yields an expression more similar to the original expression.

Other Simplify commands


Simplify > Approximate command

Normally it is best and safest to run Derive using exact mode arithmetic.  In exact mode you may obtain expressions containing subexpressions that do not simplify to rational numbers.  Use the Simplify > Approximate command, click on the [image] icon on the command toolbar, press Ctrl+G, or use the APPROX function to approximate the irrationals in such expressions without having to change the precision back-and-forth using the Precision field of the Declare > Simplification Settings command.

Simplifying expressions using the Simplify > Approximate command is the same as simplifying expressions using the Simplify > Basic command except that the precision is temporarily set to approximate and the notation style is temporarily set to scientific.  The Simplify > Approximate command allows you to enter the desired number of digits of precision used during the calculation and displayed in the result.

The APPROX function can be used on the expression entry line to approximate expressions.  APPROX(u,n) approximates expression u using n digits of precision.  n defaults to the number of digits indicated by the Precision field of the Declare > Simplification Settings command.

Other Simplify commands


Simplify > Variable Substitution command

Use the Simplify > Variable Substitution command, click on the [image] icon on the command toolbar, or press Ctrl+W to substitute values for each of the variables in the currently highlighted expression or subexpression.  You are presented with a dialog box that lists the variables in the highlighted expression and a line for entering the values to be substituted for the variables.  After clicking on a variable, click on the Substitution line and enter the replacement value for the variable (see Entering Mathematical Expressions).  Alternatively, press Shift+↓ (i.e. the down arrow key) to highlight the next variable without having to use the mouse.

When satisfied with the replacement values, click on the OK button or press the Enter key to make the substitutions and add the result as the last expression in the active algebra window.  Click on the Simplify button or press Alt+S to simplify the result before adding it as the last expression in the active algebra window.  Click on the Cancel button or press the Esc key to abort the command.

You can also use the SUBST function to substitute values for variables or subexpressions of an expression, serially or in parallel.  Given an expression u, a variable or subexpression v, and a value w, SUBST(u, v, w) replaces all occurrences of v in u with w, simplifies, and then returns the result.  The expression can be followed by as many variables and values as desired, in which case the substitutions are made serially.  However, if the second argument of SUBST is a vector of variables and the third argument is a vector of values, the values are substituted for the variables in parallel.

Other Simplify commands


Simplify > Subexpression Substitution command

Use the Simplify > Subexpression Substitution command or press Ctrl+T to substitute a replacement value for one or all occurrences of the highlighted subexpression in an expression.  You are presented with a dialog box for entering the replacement subexpression (see Entering Mathematical Expressions).

The dialog box includes radio buttons for selecting between replacing just the One highlighted subexpression or replacing All occurrences of the subexpression in the expression.  Replacing just the One highlighted subexpression with a new value is a convenient way to edit large expressions.

When satisfied with the replacement subexpression, click on the OK button or press the Enter key to make the substitution(s) and add the result as the last expression in the active algebra window.  Click on the Simplify button or press Alt+S to simplify the result before adding it as the last expression in the active algebra window.  Click on the Cancel button or press the Esc key to abort the command.

You can also use the SUBST function to substitute values for subexpressions of an expression, serially or in parallel.   See the Simplify > Variable Substitution command for details.

Note that when substituting a value for a subexpression, only exact matches are replaced.  For example, substitution for x^2 does not also replace occurrences of x^4.  Therefore,

SUBST(a·x^4 + b·x^3 + c·x^2 + d·x + e, x^2, y)

simplifies to

   4      3
a·x  + b·x  + d·x + c·y + e

Other Simplify commands


Solve commands

Use the Solve commands to solve equations or relations algebraically or numerically.

Expression...

System...

Other Algebra Window Commands


Solve > Expression command

Use the Solve > Expression command, click on the [image] icon on the command toolbar, or press Ctrl+Shift+E to solve the highlighted equation, inequality, or system of equations algebraically or numerically.  This command displays a dialog box having the following fields:

Solutions Variables:  Click on the desired solution variables to select them.  To deselect a variable that was inadvertently selected, click on it again.

Solution Method:

•	Click the Algebraically button to use strictly algebraic solution methods.

•	Click the Numerically button to use strictly numeric solution methods.

•	Click the Either button to use algebraic methods and then numeric methods, if necessary.

Solution Domain:

•	Click the Complex button to return all solutions.

•	Click the Real button to return only solutions not having an imaginary component.

•	Click the Bounds button to a single solution restricted to a specified interval.  This option is only available if the Numerically solution method is selected.

Solution Bounds:

•	In the Upper field, enter an upper bound on the solution.

•	In the Lower field, enter a lower bound on the solution.

Click on the Solve button, press Alt+S, or press the Enter key to solve the highlighted expression for the selected variables.  Click on the OK button to generate an unsimplified call on the SOLVE or NSOLVE function.  Click on the Cancel button or press the Esc key to abort the command.

Related topics:

Solving Equations and Inequalities Algebraically

Solving Equations Numerically

Solving Systems of Equations

Other Solve commands


Solve > System command

Use the Solve > System command or press Ctrl+Shift+Y to enter and then algebraically solve a system of linear or nonlinear polynomial equations.  After you enter the number of equations to be solved, the command’s dialog box displays fields for you to enter each of the equations.  Finally click on the Solve button to solve the equations, or click on the OK button to generate an unsimplified call on the SOLVE function to solve the equations.

For more information see Solving Systems of Equations.

Other Solve commands


Declare commands

Use the Declare commands to declare variables, define functions, select transformations, set precision, etc.  These commands generate assignment statements in the algebra window.

Variable Value...

Variable Domain...

Function Definition...

Input Settings...

Output Settings...

Simplification Settings...

Reset All Settings

Other Algebra Window Commands


Declare > Variable Value command

Use the Declare > Variable Value command or press Ctrl+Alt+V to declare a variable and optionally assign it a value or clear an existing value.  Previous value assignments and domain declarations are over-ridden.  Use the File > Close command to clear all variable declarations and assignments, and close the active worksheet.

Declared variable names can be multi-character and of mixed case, no matter what the current Input Settings are (see the Declare > Input Settings command).  The Declare > Variable Value command can turn the name of a user-defined function back into a variable name.  However, it cannot turn the name of one of the Built-in Functions and Constants into a variable name.

The Declare > Variable Value command allows you to enter a variable name and the desired value.  If you leave the value line blank, the name becomes an unassigned variable.  If you enter an expression and click on OK the name becomes an assigned variable having the unsimplified expression as its value.

While entering the expression for the variable’s value, you can use all the normal line editing features provided by the Author > Expression command.  In particular, you can use the Greek and math symbol toolbars, and the F3 and F4 function keys to insert the highlighted expressions and subexpressions onto the expression entry line.

Instead of using the Declare > Variable Value command, you can use the Author > Expression command to declare a variable and optionally assign it a value or clear an existing value.  On the expression entry line, enter:  the variable name; the := assignment operator; and the variable's value, if it is to be an assigned variable.  For example, entering

AreaCircle := pi·r^2

assigns the variable AreaCircle the value π·r².

When an expression containing an assigned variable is simplified, all occurrences of the variable are replaced by its value.  For example, if AreaCircle is assigned as above,

2·AreaCircle + 2·pi·h·r

simplifies to

               2
2·π·h·r + 2·π·r

This expression gives the surface area of a cylinder of height h and radius r.  In turn, it can be assigned as the value of the variable AreaCylinder by the assignment

AreaCylinder := 2·AreaCircle + 2·pi·h·r

Entering

AreaCircle :=

clears any value previously assigned to AreaCircle and makes it an unassigned variable.

When an assignment is entered without simplifying it, the unsimplified right operand of the := operator is assigned to the left operand.  However, when an assignment is simplified, the right operand is first simplified and then the result assigned to the left operand.  (Note that in previous versions of Derive, the right operand was not simplified before being assigned to the left operand.)  For example, if you enter the assignment

Digit := RANDOM(10)

the variable Digit is assigned the value RANDOM(10).  Thereafter, Digit will return a new random digit each time it is simplified.  However, if you simplify the above assignment, RANDOM(10) is simplified and Digit is assigned the resulting digit.  Thereafter, Digit will return this same digit each time it is simplified.

No matter whether an assignment is simplified or not, the left operand of the := operator is not simplified.  Thus the left operand of the := operator must be the actual variable to be assigned a value.  Use the ASSIGN function if you need to simplify an expression to determine the variable to be assigned a value (see Procedural Programming).

#n where n is an expression label number can be used like a variable name on the expression entry line or when Derive commands prompt for an expression.  Also previous expressions and subexpressions can be referenced by highlighting.  For these reasons variable assignments are often unnecessary when using Derive.

On the other hand, variable assignments are convenient to reference an expression after it scrolls off the screen or to assign a descriptive name to an expression that is of special significance.

Variable assignments that you forget about can lead to surprising or incorrect results.  Thus using multi-character names for assigned variables is recommended since it reduces the chance of name conflicts with unassigned variables.

Derive repeatedly applies variable assignments until a constant or unassigned variable is reached.  For example, if r is assigned the value s², then s is assigned the value 5, then r will simplify to 25 rather than s².

The following utility files provide good examples of the use of assigned variables:

•	ENGLISH.MTH - English Units Conversion

•	METRIC.MTH - Metric Units Conversion

•	PHYSICAL.MTH - Physical Constants

Other Declare commands


Declare > Variable Domain command

Use the Declare > Variable Domain command or press Ctrl+Alt+D to examine or change the domain declaration of a particular variable or the default domain used for undeclared variables.  This command can turn the name of a user-defined function back into a variable name.  However, it cannot turn the name of one of the Built-in Functions and Constants into a variable name.  For more information see the Significance of Domain Declarations.

In the Variable Name field of the command’s dialog box, enter a variable name or type default to change the default domain used for undeclared variables.  Declared variable names can be multi-character and of mixed case, no matter what the current Input Settings are (see the Declare > Input Settings command).

After you enter a name, the Domain field of the dialog box displays the current domain declaration of the variable and allows you to change the declaration by clicking on one of the following buttons:

•	Click on the Integer button to declare the variable to be an integer.

•	Click on the Real button to declare the variable to be a real number.

•	Click on the Complex button to declare the variable to be a complex number.

•	Click on the Vector button to declare the variable to be a vector (which includes being a matrix).

•	Click on the Set button to declare the variable to be a set.

•	Click on the Logical button to declare the variable to have a logical truth-value.

If you declare the variable to be an Integer or Real number, the Interval field of the dialog box display the current interval declaration of the variable and allows you to change the declaration by clicking on one of the following buttons:

•	Click on the All button to declare the variable to be a number between -∞ and +∞.

•	Click on the Positive button to declare the variable to be a number greater than 0.

•	Click on the Negative button to declare the variable to be a number less than 0.

•	Click on the Nonnegative button to declare the variable to be a number greater than or equal to 0.

•	Click on the Nonpositive button to declare the variable to be a number less than or equal to 0.

•	Click on the Open interval button to declare the variable to be a number in the open interval whose endpoints are given in the Bounds field.

•	Click on the Closed interval button to declare the variable to be a number in the closed interval whose endpoints are given in the Bounds field.

•	Click on the Open-closed interval button to declare the variable to be a number in the open-closed interval whose endpoints are given in the Bounds field.

•	Click on the Closed-open interval button to declare the variable to be a number in the closed-open interval whose endpoints are given in the Bounds field.

If you declare the variable to be in a specified interval, the Bounds field of the dialog box displays the current upper and lower bounds declaration of the variable, if any, and allows you to change the declaration by entering new numerical bounds.

When a domain declaration is made to a variable and no interval is specified or the All interval is selected, the Declare > Variable Domain command generates an expression of the form

variable :ε domain

where variable is the variable name anddomain is Integer, Real, Complex, Vector, Set, or Logical.  If the Integer or Real domain is selected and an interval other than All is selected, the command generates an expression of the form

variable :ε domain interval

where interval is an interval expressed in standard notation.  Parentheses ( ) denote open intervals, square brackets [ ] denote closed intervals, and a combination denotes half-open intervals.

Domain declarations can also be made on the expression entry line by entering expressions of the above form using upper and lower case exactly as shown.  The epsilon character can be entered by clicking on the ε on the Greek symbol toolbar.  For example, entering

p :ε Real [0, inf)

declares p to be a nonnegative real-valued variable.

Other Declare commands


Declare > Function Definition command

When using Derive, you may find it necessary to perform a sequence of operations repeatedly or frequently.  As a shortcut, you can define functions in terms of the Built-in Functions and Constants and then save these function definitions in an MTH file using the File > Save command.  Such files eliminate the time required to redeliver and reenter formulas.  The utility files distributed with Derive are just such collections of function definitions.

Use the Declare > Function Definition command or press Ctrl+Alt+F to declare a function and optionally assign it a definition, or to clear an existing definition.  This command can turn a variable name into a function name.  However, Derive's Built-in Functions and Constants can not be redefined.

You can use the Declare > Variable Value command to clear a user-defined function and make it a variable name.

Declared function names can be multi-character and of mixed case, no matter what the current Input Settings are (see the Declare > Input Settings command).

The Declare > Function Definition command allows you to enter a function name and definition.  Function names can be multi-character even in character input mode (see the Declare > Input Settings command).  The function name should be followed by the functions arguments enclosed in parentheses and separated by commas.  If you leave the definition line blank, the name becomes an arbitrary function.  If you enter an expression, the name becomes a user-defined function having the expression as its definition.

While entering a function definition, you can use all the line editing features normally provided by Derive (see Entering Mathematical Expressions).

Instead of a Declare > Function Definition command, you can use an Author > Expression command to declare a function and optionally assign it a definition or clear an existing definition.  On the expression entry line, enter:  the function name and a list of some or all of the variables in the function's definition, enclosed in parentheses and separated by commas; then enter the := assignment operator and the function's definition.  Omit the definition for arbitrary functions.

For example, entering

ACCELERATION(f, m) := f/m

assigns the function ACCELERATION(f, m) the definition f/m.

When an expression containing calls to a function is simplified, all function calls are replaced by a copy of its definition in which the variables have been replaced by the values specified in the call on the function.  For example, if ACCELERATION is defined as above, then

ACCELERATION(6, 2)

simplifies to 3.  If a function is called with fewer arguments than there are variables in its definition, the excess variables are not replaced.  For example,

ACCELERATION(6)

simplifies to 6/m.  Entering

ACCELERATION(f, m) :=

clears any definition previously assigned to ACCELERATION and makes it an arbitrary function.

Other Declare commands


Declare > Input Settings command

Use the Declare > Input Settings command or press Ctrl+Alt+I to view and/or modify the Derive state variables that affect the reading of mathematical expressions entered on the expression entry line.  The Input Settings dialog box displays the following fields:

•	Use the Input Mode field to select either character or word input mode for the names of variables and functions entered on the expression entry line.

•	Use the Case Sensitivity field to select either sensitive or insensitive case mode for the names of variables and functions entered on the expression entry line.

•	Use the Radix field to select the radix base for numbers entered on the expression entry line.  See the topic Controlling Radix Base for details about setting the input and output radix base.

When a new input mode for names is selected, this command generates an expression of the form

InputMode := mode

where mode is Character or Word.  When a new case mode for names is selected, this command generates an expression of the form

CaseMode := mode

where mode is Insensitive or Sensitive.  The input and case modes can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.

Declared variables are user variables that have been assigned a domain (see Declare > Variable Domain command) or a value (see Declare > Variable Value command).  Declared functions are user functions that have been given a definition ( Declare > Function Definition command).  The names of declared variables and functions can be of any length and of mixed case.

Use the Input mode field of the Declare > Input Settings command to select the input mode for reading variable and function names:

•	In character input mode, undeclared variables can have names consisting of only a single Latin or Greek letter (except as noted below).  If you are satisfied with such names, this input mode eliminates having to insert a space between variables being multiplied.  For example, xyz is read as the product of the variables x, y, and z.  However, if xyz is a declared variable or function, then xyz is read as that variable or function.  Character is the factory default input mode setting.

•	In word input mode, undeclared variables can have names consisting of any number of letters, digits, or underscore characters, provided they begin with a letter.  For example, in word input mode, x1, velocity, and light_years are valid multi-character variable names.  Note that word input mode requires that variable and function names be separated by a space, an operator, a function, or a parenthesis.

In either input mode, undeclared variables can have names consisting of a single letter followed by one or more underscore characters, or of an at-sign character followed by one or more decimal digits.  For example, in character or word input mode, x_ and @123 are valid variable names.

In either input mode, undeclared variables can have multi-character names consisting of any character, including spaces and mathematical operators, provided the name is enclosed in double quote marks.  These string variables provides a convenient way to include comments in Derive sessions that are saved in MTH files.  For example, the following is a valid variable name:

"If x < 3, the following equation is true:"

Use the Case sensitivity field of the Declare > Input Settings command to select the case mode for reading variable and function names:

•	In case sensitive mode, the case of a variable and function name entered on the expression entry line must exactly match the name given the variable or function when it was defined.  For example, entering r and R results in two distinct variables.  Note that in this mode the Built-in Functions must be entered using all upper-case letters.  For example, the name of the sine function must be entered as SIN.

•	In case insensitive mode, the case of a variable and function name entered on the expression entry line does not have to exactly match the name given the variable or function when it was defined.  For example, entering r and R results in the same variable whose name is r.  Also, the name of the sine function can be entered as sin, Sin, or SIN.  However, if there are two variables or functions whose names differ only in case and a name is entered that exactly matches one of the names, that variable or function is used.  Insensitive is the factory default case mode setting.

In either case mode, variable and function names are displayed in the case in which they were defined.  Also, when Greek characters are entered by clicking on the Greek symbol toolbar or by typing in their equivalent Latin name (e.g. when typing "gamma" for γ or "GAMMA" for Γ), the case of the Greek characters is always respected, even when the case of Latin characters is being ignored (i.e. when in case insensitive mode).

Click on the Reset button and then on the OK button to generate assignment statements that will restore the Derive state variables that affect the input of mathematical expressions to their factory default settings.  For more information about state variables see Using and Saving State Variables.

Other Declare commands


Declare > Output Settings command

Use the Declare > Output Settings command or press Ctrl+Alt+O to view and/or modify the Derive state variables that control how mathematical expressions are displayed on the screen or printed on a printer.  The various options are described in the following topics:

•	Ordering Variables in Expressions

•	Controlling Notation

•	Controlling Radix Base

•	Controlling Expression Format

Click on the Reset button and then on the OK button to generate assignment statements that will restore the Derive state variables that affect the output of mathematical expressions to their factory default settings.  For more information about state variables see Using and Saving State Variables.

Other Declare commands


Declare > Simplification Settings command

Use the Declare > Simplification Settings command or press Ctrl+Alt+S to view and/or modify the state variable settings that affect the simplification of mathematical expressions.  The Simplification Settings dialog box displays the following fields:

•	Exponential field

•	Logarithm field

•	Trigonometry field

•	Trig Powers field

•	Angular Unit field

•	Precision field

•	Branch field

Click on the Reset button and then on the OK button generate assignment statements that will restore the Derive state variables that affect the simplification of mathematical expressions to their factory default settings.  For more information about state variables see Using and Saving State Variables.

Other Declare commands


Exponential field

Use the Exponential field of the Declare > Simplification Settings command to control the collection or expansion of expressions involving exponentials.  The transformation

 z  w      z+w
ê ·ê  ⇐⇒ ê

is valid if z and w are real or complex expressions.  The transformation

  z k      k·z
(ê )  ⇐⇒ ê

is valid if k is an integer, or if k is a fraction and z is a real or complex expression whose imaginary part lies in the interval (-π, π].  The Exponential field provides the following options:

•	Select the Collect option to apply both transformations to the right when simplifying expressions.

•	Select the Expand option to apply both transformations to the left when simplifying expressions.

•	Select the Auto option to apply the transformations in such a way as to produce the most compact and attractive form when simplifying expressions.  Auto is the factory default exponential mode setting.

For example, if the Collect option is selected, the expression

x^a·ê^(b + c)

simplifies to

 a·LN(x) + b + c
ê

whereas if the Expand option is selected, it simplifies to

 b  c  a
ê ·ê ·x

whereas if the Auto option is selected, it simplifies to

 b + c  a
ê     ·x

When a new exponential transform direction is selected, this command generates an expression of the form

Exponential := direction

where direction is Auto, Collect, or Expand.  The exponential transform direction can also be changed by entering an expression of the above form using upper and lower case exactly as shown on the expression entry line.

Other Declare > Simplification Settings command fields


Logarithm field

Use the Logarithm field of the Declare > Simplification Settings command to control the collection or expansion of expressions involving logarithms.  The transformation

LN(x) + LN(z)  ⇐⇒  LN(x·z)

is valid if z is real or complex and x is nonnegative.  The transformation

                  k
k·LN(x)  ⇐⇒  LN(x )

is valid if k is a rational number, and x is nonnegative or k lies in the interval (-1, 1].  The Logarithm field provides the following options:

•	Select the Collect option to apply both transformations to the right when simplifying expressions.

•	Select the Expand option to apply both transformations to the left when simplifying expressions.

•	Select the Auto option to apply the transformations in such a way as to produce the most compact and attractive form having the fewest number of radicals when simplifying expressions.  Auto is the factory default logarithm mode setting.

For example, if the Collect option is selected, the expression

LN(x·y^4 + 2·x·y^2 + x)/2

simplifies to

        2
LN(√x·(y  + 1))

whereas if the Expand option is selected, it simplifies to

 LN(x)        2
——————— + LN(y  + 1)
   2

whereas if the Auto option is selected, it simplifies to

        2     2
 LN(x·(y  + 1) )
—————————————————
        2

When a new logarithm transform direction is selected, this command generates an expression of the form

Logarithm := direction

where direction is Auto, Collect, or Expand.  The logarithm transform direction can also be changed by entering an expression of the above form using upper and lower case exactly as shown on the expression entry line.

Other Declare > Simplification Settings command fields


Trigonometry field

Use the Trigonometry field of the Declare > Simplification Settings command to control the application of the angle-sum and multiple-angle trigonometric transformations.  The Trigonometry field provides the following options:

•	Select the Collect option to collect products and powers of trig functions into trig functions of angle sums and multiple angles when simplifying expressions.

•	Select the Expand option to expand trig functions of angle sums and multiple angles into products and powers of trig functions when simplifying expressions.

•	Select the Auto option to apply the transformations in such a way as to produce the most compact and attractive form when simplifying expressions.  Auto is the factory default trig mode setting.

When a new trigonometry transform direction is selected, this command generates an expression of the form

Trigonometry := direction

where direction is Auto, Collect, or Expand.  The trigonometry transform direction can also be changed by entering on the expression entry line an expression of the above form using upper and lower case exactly as shown.

When the Expand trigonometry direction is selected, the following transformations are applied:

SIN(z+w)  ⇒  SIN(z)·COS(w) + COS(z)·SIN(w)

COS(z+w)  ⇒  COS(z)·COS(w) - SIN(z)·SIN(w)

SIN(m·z)  ⇒  2·COS((m-1)·z)·SIN(z) + SIN((m-2)·z)

COS(m·z)  ⇒  2·COS((m-1)·z)·COS(z) + COS((m-2)·z)

if m is a positive integer greater than 1.  Also, trig functions with arguments of the form π/n, where n is a power of 2 times 1, 3, 5, or 15, are expanded into algebraic numbers using radicals.  For example, if the Expand direction is selected,

SIN(2·x + y)

simplifies to

        2
2·COS(x) ·SIN(y) + 2·SIN(x)·COS(x)·COS(y) - SIN(y)

and

COS(2·pi/15)

simplifies to

  15     3·√5     √5     1
√———— - —————— + ———— + ———
  32      32       8     8

When the Collect trigonometry direction is selected, the following transformations are applied:

                    COS(z-w) - COS(z+w)
SIN(z)·SIN(w)  ⇒  —————————————————————
                             2

                    COS(z-w) + COS(z+w)
COS(z)·COS(w)  ⇒  —————————————————————
                             2

                    SIN(z-w) + SIN(z+w)
SIN(z)·COS(w)  ⇒  —————————————————————
                             2

      m       1 - COS(2·z)        m-2
SIN(z)   ⇒  ——————————————·SIN(z)
                    2

      m       1 + COS(2·z)        m-2
COS(z)   ⇒  ——————————————·COS(z)
                    2

a·SIN(z) + b·COS(z)  ⇒

           2    2      π·SIGN(b)         a
        √(a  + b )·SIN(————————— - ATAN(———) + z)
                           2             b

if m is a positive integer greater than 1.  For example, if the Collect direction is selected,

2·COS(x)^2·SIN(y) + 2·SIN(x)·COS(x)·COS(y) - SIN(y)

simplifies to

SIN(2·x + y)

When the Auto trigonometry direction is selected, only those trigonometric transformations that clearly yield a simplification are applied.  Usually this results in the most compact and attractive form of trigonometric expressions.  However, you may find examples where selecting the Collect or Expand trigonometry direction enables a simplification that does not occur in the Auto direction.  On the other hand, selecting the Collect or Expand direction may produce huge results and take a long time to simplify.

Other Declare > Simplification Settings command fields


Trig Powers field

Use the Trig Powers field of the Declare > Simplification Settings command to control the transformation of powers of sines into cosines and vice versa.  The Trig Powers field provides the following options:

•	Select the Sines option to transform powers of cosines into sines when simplifying expressions.

•	Select the Cosines option to transform powers of sines into cosines when simplifying expressions.

•	Select the Auto option to apply the transformations in such a way as to produce the most compact and attractive form when simplifying expressions.  Auto is the factory default trig powers setting.

When a new direction is selected, the command generates an expression of the form

Trigpower := direction

where direction is Auto, Sines, or Cosines.  The trig power transform direction can also be changed by entering on the expression entry line an expression of the above form using upper and lower case exactly as shown.

When the Cosines direction is selected, the following transformations are applied:

      2·m                 2 m
SIN(z)     ⇒  (1 - COS(z) )

      2·m + 1                      2 m
SIN(z)        ⇒ SIN(z)·(1 - COS(z) )

if m is an integer.  For example, if the Cosines direction is selected,

SIN(x)^4

simplifies to

      4           2
COS(x)  - 2·COS(x)  + 1

When the Sines direction is selected, the following transformations are applied:

      2·m               2 m
COS(z)    ⇒ (1 - SIN(z) )

      2·m + 1                      2 m
COS(z)        ⇒ COS(z)·(1 - SIN(z) )

if m is an integer.  For example, if the Sines direction is selected,

COS(x)^4 - 2·COS(x)^2 + 1

simplifies to

      4
SIN(x)

When the Auto direction is selected, only the above transformations that clearly yield a simplification are applied.  Usually this results in the most compact and attractive form of trigonometric expressions.  However, you may find examples where selecting the Sines or Cosines trig power direction enables a simplification that does not occur in the Auto direction.  On the other hand, selecting the Sines or Cosines direction may produce huge results and take a long time to simplify.

Other Declare > Simplification Settings command fields


Angular Unit field

Use the Angular Unit field of the Declare > Simplification Settings command to specify the unit of angular measurement (degree or radian) used by the Trigonometric Functions and returned by the Inverse Trigonometric Functions.

When a new unit of angular measurement is selected, this command generates an expression of the form

Angle := unit

where unit is Degree or Radian.  The angular unit can also be changed by entering on the expression entry line an expression of the above form using upper and lower case exactly as shown.  Radian is the factory default angular unit setting.

An angle of 180 degrees is the same as an angle of π radians.  So, one degree is π/180 radians.  In Derive the degree constant is defined to be π/180.  The degree constant can be entered by clicking on the ° on the math symbol toolbar, pressing Ctrl+O, or by typing deg on the expression entry line.  For example, in Radian mode,

SIN(pi/4)

and

SIN(45 deg)

both simplify to √2/2; whereas in Degree mode

SIN(45)

simplifies to √2/2.

Conversely, in Radian mode

ASIN(1/2)

simplifies to π/6; whereas in Degree mode,

ASIN(1/2)

simplifies to 30.

Note that the current angular unit also affects both 2D and 3D plots (see 2D-plot Window Commands and 3D-plot Window Commands).

Other Declare > Simplification Settings command fields


Precision field

Internally Derive stores all numbers as integers or reduced ratios of integers (fractions).  All numerical operations are performed using rational arithmetic.  Either exact, approximate, or mixed precision can be used.

Use the Precision field of the Declare > Simplification Settings command to determine and/or change the precision mode and digits of precision.  The current precision mode is the highlighted in the mode field.  The minimum number of significant decimal digits used in approximate or mixed modes is displayed in the digits field.

When a new precision mode is selected, the command generates an expression of the form

Precision := mode

where mode is Approximate, Exact, or Mixed.  When a new number of digits of precision is entered, the command generates an expression of the form

PrecisionDigits := digits

where digits is a positive integer.  The precision mode and digits of precision can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.  Exact is the factory default precision mode setting, and 10 is the factory default digits of precision.

If Exact is selected, irrational numbers are not approximated and as much memory as necessary is used to store rational numbers.  Exact precision mode is appropriate when you want an exact answer and must be sure that you have an exact answer.

Irrational numbers can not be represented exactly as ratios of integers.  Thus, in exact mode, radicals (surds) are left in symbolic form when simplified rather than being approximated.  For example, √4 simplifies to 2, but √3 remains symbolic.  In exact mode various techniques are used to simplify expressions involving nested radicals.  For example,

SQRT(4 - 2·SQRT(3))

simplifies to √3 - 1.

If Approximate is selected, irrational numbers and large rational numbers simplify to the simplest rational number that approximates the original number accurate to the current precision.

The number of significant digits of precision can be set in the Precision field to any desired positive integer.  However, the time required to perform rational operations roughly quadruples when the number of digits of precision is doubled.  In addition, huge rational numbers will quickly exhaust available memory.

Approximate mode can be significantly faster and require less memory than exact or mixed mode when rational operations result in numbers having large numerators and denominators.

Approximate mode is appropriate when you want to save time and space at the expense of some roundoff errors.  This may be acceptable if the expected roundoff error is negligible compared to errors in experimental data or compared to the accuracy required of the result.

If Mixed is selected, irrational numbers are approximated but rational numbers are not.  As with approximate precision mode, irrational numbers simplify to the simplest rational number that approximates the original number accurate to the current precision.

Mixed precision mode is appropriate when you are willing to approximate irrational operations to force numeric results but want all rational operations done exactly.

For example, in approximate mode with 6 digits of precision

SQRT(3422357/2313 - 1140443/771)

simplifies to 0.666622 an approximate result because rounding the rational numbers before they are subtracted results in significant roundoff error.  However, in mixed mode it simplifies to 2/3 an exact result because the difference of the two rational numbers is computed exactly.

Regardless of the number in the digits field, exact mode uses as many digits as necessary for exactness.  Thus, set the digits field to the precision you want for approximate calculations.

If you change the precision and issue another Declare > Simplification Settings command, the number of digits displayed in the Precision field may exceed by one the precision you requested.  Derive stores rational numbers using enough bytes of memory to provide the current precision.  Since each byte provides more than one decimal digit of precision, the precision may be slightly more than you requested.

Most individual roundoff errors are a few digits more accurate than the indicated precision.  However, roundoff errors may accumulate in a sequence of operations.  Moreover, subtracting two nearly equal approximate numbers may yield a result having few or no significant digits.  This is called catastrophic cancellation.

For example, if n is a large positive integer, a difference of the form √(n²+1) - n leads to catastrophic cancellation since √(n² + 1) and n approximate to nearly equal numbers.  Thus, in approximate mode with 6 digits of precision

SQRT(10001) - 100

simplifies to 0.00499722.  However, only the first three digits of this result are correct.  This can be verified by increasing the digits of precision to 10 and resimplifying the above difference.

As opposed to the floating-point arithmetic used by most calculators and mathematical software, approximate rational arithmetic has the useful property that simple exact rational results are often obtained despite intermediate roundings or irrational approximations.

If an irrational expression is equivalent to a simple fraction, then approximate mode is more likely than mixed mode to yield that simple fraction.  Otherwise, mixed mode is likely to be more accurate.

In exact mode Derive tries to denest expressions involving nested radicals.  For example,

SQRT(5 + 2·SQRT(6))

simplifies to √3 + √2, and

(243·SQRT(5) - 294·SQRT(3))^(1/3)

simplifies to 3√5 - 2√3.  However, it is difficult if not impossible to fully simplify all such expressions involving nested radicals (but we're working on it!).

Other Declare > Simplification Settings command fields


Branch field

In mathematics the imaginary unit, √(-1), is usually denoted by the letter i.  To distinguish it from the variable name i, Derive displays the imaginary unit as î.  The exponentiation symbol over the character is to remind you of the exponentiation symbol used when entering the imaginary unit as (-1)^(1/2).

The imaginary unit can be entered by clicking on the î on the math symbol toolbar, by pressing Ctrl+I, or by typing #i.

A complex expression is an expression that contains the imaginary unit.  A real expression does not contain the imaginary unit.  Operations such as factoring and equation solving can yield complex expressions.  Therefore, it is important to recognize them even if you do not plan to enter any complex expressions.

A complex expression is in rectangular form if it consists of the sum of a real expression and the imaginary unit times another real expression.  Derive simplifies complex expressions to rectangular form.  For example,

(1 + î)^3

simplifies to

-2 + 2·î

and

(î + 7)/(3·î + 4)

approximates to

1.24 - 0.68·î

A point in the complex plane is determined by its magnitude (i.e. its distance from the origin) and its phase angle (i.e. the angle of the point from the x-axis).  By definition, the phase angle in radians is restricted to the interval

-π < phase angle ≤ π

If z is a point in the complex plane and n is an integer, then z^(1/n) could be any one of n distinct points, called branches, in the complex plane:  The magnitude of z^(1/n) is equal to |z|^(1/n), but the phase of z^(1/n) could be any one of n equally spaced angles.  For example, the magnitude of √9 is 3, but the phase can be either 0 radians yielding 3, or π radians yielding -3.

The principal branch of z^(1/n) is the point in the complex plane whose magnitude is |z|^(1/n) and whose phase is the phase of z divided by n.  For example, the principal branch of √9 is 3 and the principal branch of (-8)^(1/3) is 1 + √3i.

Use the Branch field of the Declare > Simplification Settings command to change the branch Derive returns when simplifying fractional powers.  When a new branch option is selected, the command generates an expression of the form

Branch := option

where option is Principal, Real, or Any.  The branch option can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.

Select the Principal option to force Derive to always select the principal branch.  The principal branch is the most widely accepted systematic branch choice.  Principal is the factory default branch setting.

Select the Real option to force Derive to select a real branch if one exists, even if it is not the principal branch.  For example, if this option is selected,

(-8)^(1/3)

simplifies to -2 instead of  1 + √3i.  Note that the Real branch selection may be preferable for precalculus applications.

Select the Any option to allow Derive to use the maximum number of transformations when it does not matter which branch is chosen.   For example, the plus-or-minus "operator" in the quadratic formula constructs both solutions no matter which branch is chosen for the square root in the formula.  In Any branch mode, Derive applies the transformations

(z^m)^(1/n)  ⇒  z^(m/n)

(z·w)^(1/n)  ⇒  z^(1/n)·w^(1/n)

even if the phases of z and w are unknown.  For example, in Any branch mode

(x^2)^(1/2)

simplifies to x instead of the more conservative |x|, even if the sign of x is unknown.  Thus instead of consistently using a single branch in Any branch mode, Derive uses the positive branch when x is positive and the negative branch when x is negative.

If n and m are integers, z^(m/n) is equivalent to (z^(1/n))^m.  Thus when simplifying z^(m/n) Derive first picks the appropriate branch for z^(1/n) and then raises this result to the mth power.

Other Declare > Simplification Settings command fields


Declare > Reset All Settings command

Use the Declare > Reset All Settings command or press Ctrl+Alt+R to generate assignment statements that will restore all Derive state variables to their factory default settings.  Note that if no assignment statements are generated as a result of issuing this command, then the state variables are already set at the factory default settings.

If the DERIVE Initialization File, DFW.INI, is deleted from the Derive directory, all the state variables will have their factory default settings when Derive  is started.  For more information on state variables see Using and Saving State Variables.

Other Declare commands


Algebra Window Options commands

Use the Options commands to set various screen display and printing options.

Display > Alignment of New Objects...

Display > Font of All Expressions...

Display > Font of New Text Objects...

Display > Background Color...

Printing > Expression Layout...

Printing > Header and Footer...

Printing > Page Setup...

Printing > Printer Setup...

Startup command

•	Renumber Expressions

•	Hide Labels

•	Hide Plots

•	Hide Text

•	Hide OLE Objects

Other Algebra Window Commands


Options > Display > Alignment of New Objects command

Use the Options > Display > Alignment of New Objects command to control the wrapping of newly created expressions to fit the screen width and the alignment of newly created objects (i.e. expressions, plot objects, text objects, and OLE objects).

Other Algebra Window Options commands


Options > Display > Font of All Expressions command

Use the Options > Display > Font of All Expressions command to control the text size (large or small) and the color used to display expressions in the worksheet.

Other Algebra Window Options commands


Options > Display > Font of New Text Objects command

Use the Options > Display > Font of New Text Objects command to control the initial font name, style (regular, italic, or bold), point size, and color of text in newly created text objects.  Note that the formatting toolbar can be used to change the font of existing text in a text object.

Other Algebra Window Options commands


Options > Display > Background Color command

Use the Options > Display > Background Color command to select the background color of the active window.  For plot windows, note that line segments will appear more clearly on solid background colors.

Other Algebra Window Options commands

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Printing > Expression Layout command

Use the Options > Printing > Expression Layout command to control the inclusion of annotations and computation times of expressions when a worksheet is printed using the File > Print command or previewed using the File > Print Preview command.  This command also allows you to select the size of the font used to print or preview expressions.  The dialog box for this command displays the following fields:

•	Annotation  If this box is checked, the annotation associated with an expression will be printed on the line above the expression.  An expression’s annotation is also displayed on the algebra window’s status bar.  Use the Edit > Annotation command to modify an expression’s annotation.

•	Computation Time  If this box is checked, the computation time associated with an expression will be printed on the line above the expression if it has one.  Only those expressions generated by simplification or approximation will have a computation time.  An expression’s computation time is also displayed on the algebra window’s status bar, next to the [image] clock icon.

•	Bold Font  If this box is checked, the expressions will be printed using a darker bold font.

Font Size  The number entered in this field is the font size used to print and preview expressions.

Note that the printing of expressions is also controlled by various screen display options as well as the above options.

Other Algebra Window Options commands


Options > Printing > Header and Footer command

Use the Options > Printing > Header and Footer command to specify the header and footer used when an algebra window worksheet or a plot window graph is printed.  Fields are provided for entering the text, position, and font of the header and footer.  The factory default is to display the date and time 0.50 inches from the top of the page, and to display the page number 0.50 inches from the bottom of the page.  For worksheet printouts, the filename is also printed at the top of the page by default.

Other Algebra Window Options commands

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Printing > Page Setup command

Use the Options > Printing > Page Setup command to specify the margins used when an algebra window worksheet or a plot window graph is printed.  Fields are providing for entering the left, right, top, and bottom margins in inches.  One inch is the factory default setting of all four margins.

Other Algebra Window Options commands

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Printing > Printer Setup command

Use the Options > Printing > Printer Setup command to specify the printer name, paper size, paper source, print orientation (portrait or landscape), and printer properties.

Other Algebra Window Options commands

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Startup command

Use the Options > Startup command to specify the following settings the next time Derive is launched:

•	The amount of physical memory to allocate for Derive, displayed as a percentage between 20% and 80%.  50% is the factory default allocation.

•	The directory in which to search for a utility file when the file must be autoloaded (see the Utility File Functions).  The \Math subdirectory created when Derive is installed is the factory default autoload directory.

•	The option to display file pathnames relative to the current directory, rather than displaying the full file pathname.  Displaying relative pathnames is the factory default setting.

•	The option to display a prompt when Derive is launched asking whether the factory default settings should be used, rather than the settings of the previous Derive session.  Prompting at startup is the factory default setting.

Other Algebra Window Options commands


Options > Renumber Expressions command

Click on the Options > Renumber Expressions command to toggle on or off the automatic renumbering of expression label numbers when expressions are moved or deleted.

If automatic renumbering is off, moving, deleting, and undeleting expressions can cause the expression label numbers to get out of order.  If automatic renumbering is on, label numbers are automatically kept in sequential order and the label numbers in annotations are automatically updated, provided the label numbers are preceded by the # character.

Expressions and annotations are automatically renumbered when expressions are saved as an MTH file using a File > Save command or a File > Save As command.

Other Algebra Window Options commands


Options > Hide Labels command

Click on the Options > Hide Labels command to toggle on or off the display of label numbers when expressions are displayed on the screen, printed, or print previewed.  If this option is turned on, a label number of the form #n, where n is a positive integer, is displayed to the left of all expressions.

Other Algebra Window Options commands


Options > Hide Plots command

Click on the Options > Hide Plots command to toggle on or off the display of all plot objects in the active worksheet.

Other Algebra Window Options commands


Options > Hide Text command

Click on the Options > Hide Text command to toggle on or off the display of all text objects in the active worksheet.

Other Algebra Window Options commands


Options > Hide OLE Objects command

Click on the Options > Hide OLE Objects command to toggle on or off the display of all OLE objects in the active worksheet.

Other Algebra Window Options commands


Window commands

Use the Window commands to rearrange the existing windows, to open new plot windows, and to toggle on or off the display of tool and status bars.

Cascade

Tile Horizontally

Tile Vertically

Display Tabs

New 2D-plot Window

New 3D-plot Window

•	View Toolbars commands

A list of the open windows is displayed at the bottom of the Window command menu.  Each open window is preceded by a number.  Clicking on the window name or entering the number of the window makes it easy to activate that window.

Alternatively, the toolbars and function keys may be used to navigate between algebra, 2D-plot, and 3D-plot windows as follows:

•	When in an algebra window, click on the [image] icon on the command toolbar to go to a 2D-plot window.

•	When in an algebra window, click on the [image] icon on the command toolbar to go to a 3D-plot window.

•	When in a 2D or 3D-plot window, click on the [image] icon on the command toolbar or press Ctrl+1 to go to the associated algebra window.

Other Help Contents


Window > Cascade command

Use the Window > Cascade command or press Ctrl+Shift+C to arrange all the open algebra, 2D-plot, or 3D-plot windows in overlapping style, like offset note cards.  The currently active window will the be the top window.

Other Window commands


Window > Tile Horizontally command

Use the Window > Tile Horizontally command or press Ctrl+Shift+H to arrange all the open algebra, 2D-plot, or 3D-plot windows in tiled style from top to bottom.  The currently active window will be the top most window.

Other Window commands


Window > Tile Vertically command

Use the Window > Tile Vertically command or press Ctrl+Shift+V to arrange all the open algebra, 2D-plot, or 3D-plot windows in tiled style from left to right.  The currently active window will be the left most window.

Other Window commands


Window > Display Tabs command

Click on the Window > Display Tabs command or press Ctrl+Shift+B to toggle on or off the display of tabs for selecting the active window.

Other Window commands


Window > New 2D-plot Window command

Use the Window > New 2D-plot Window command to create a new 2D-plot window ready to plot a single expression highlighted in the associated algebra window.

Other Window commands


Window > New 3D-plot Window command

Use the Window > New 3D-plot Window command to create a new 3D-plot window ready to plot a single expression highlighted in the associated algebra window.

Other Window commands


Window > View Toolbars commands

Use the Window > View Toolbar commands to toggle on or off the display of the following toolbars:

•	Command Toolbar:  Click on icons on a window's command toolbar to issue frequently used command.  When the mouse cursor is moved over an icon, a message is displayed on the status bar indicating the effect of clicking on the icon.

•	Expression Entry Toolbar:  Enter mathematical expressions on the expression entry line, and then click on icons on the toolbar to enter, simplify, or approximate the expressions (see Entering Mathematical Expressions).

•	Formatting Toolbar:  Format text in text objects using the formatting toolbar (see the Edit > Object command).

•	Greek Symbol Toolbar:  Click on characters on the Greek symbol toolbar to enter Greek letters on the expression entry line and elsewhere (see Entering Mathematical Expressions).

•	Math Symbol Toolbar:  Click on characters on the math symbol toolbar to enter mathematical symbols on the expression entry line and elsewhere (see Entering Mathematical Expressions).

•	Plot Tracing Toolbar:  Click on icons on the plot tracing toolbar to move the trace line in the 3D-plot window (see the 3D-plot window Options > Trace Plots command).

•	Status Bar:  Help and warning messages are displayed on the status bar at the bottom of the Derive screen.

Other Window commands


Help commands

Use the Help commands or press the F1 key to get on-line help about Derive.

Contents

Index

Frequently Asked Questions

Additional Resources

Link to Derive Web Site

About Derive

Other Help Contents


Help > Contents command

Use the Help > Contents command to display the table of contents of Derive’s on-line help.  Once there, you can get detailed help on any underlined topic by clicking on it.

Other Help commands


Help > Index command

Use the Help > Index command to search Derive’s on-line help for a topic or specific word in an alphabetical list of topics or words.  The command presents a dialog box with tabs for the following two options:

Index:  Use this option to search for help on a topic in the on-line help index.  Type the first few letters of the topic, and/or scroll through the list of entries in the index.  Then click on the index entry you want, and click on the Display button.  Or just double click on the index entry that you want help on.

Find:  Use this option to search for help on specific words or phrases anywhere in the text of the on-line help, instead of just the topics in the index.  The first time you choose this option, a few seconds will be required to create a database of all the words in the on-line help.  Then you can type one or more words that you want to find.  A list of topics containing those words will be displayed.  Then click on the topic you want, and click on the Display button.  Or just double click on the topic that you want help on.

Other Help commands


Help > Frequently Asked Questions command

Use the Help > Frequently Asked Questions command to get answers to questions frequently asked about Derive.

Other Help commands


Help > Additional Resources command

Use the Help > Additional Resources command to find additional sources of information about using Derive to teach, learn, and do mathematics.

Other Help commands


Help > Link to Derive Web Site command

Use the Help > Link to Derive Web Site command to launch your computer’s web browser and link to the www.derive.com web site for the latest information about Derive.  At the Derive web site you can

•	learn the major capabilities of the Derive computer algebra system.

•	check out features recently added to Derive and download a free update to the latest version.

•	find a list of math books based on Derive.

•	link to other web sites of interest to Derive users.

•	download user contributed utility files and a Derive demonstration program.

•	send problem reports directly to TI-Cares Educator Support services.

Other Help commands


Help > About Derive command

Use the Help > About Derive command to display the following information:

•	Full product name

•	Version number (please include the version when requesting technical support for Derive)

•	Program size in megabytes

•	Percentage of memory available for storing and simplifying expressions

•	Copyright and trademark information

Click on the Acknowledgments button to display a list of the people who programmed and documented Derive.

Click on the Technical Support button to find out how to request technical support for Derive.

Other Help commands


Entering Mathematical Expressions

Mathematical expressions are entered using mathematical functions, operators, and constants (see Built-in Functions and Constants).  Of particular importance are the four basic Numerical Operators +, −, ∗, and /.  Parentheses are used to control the order operators are applied.  For example, the parentheses in the expression

-2*(8+7)/3

are necessary to force the addition of 8 and 7 before being multiplied by -2 and then divided by 3.

If you try to enter an expression on the expression entry line and there is a syntax error, a warning message is displayed indicating the type of syntax error.  Also, the cursor is positioned where the error was detected to help locate and correct the error.  Note that the error may actually have occurred anywhere to the left of the cursor on the line.

While entering an expression, you can press the F3 key or right click on the mouse to insert the currently highlighted expression or subexpression on the expression entry line.  Press F4 to insert the currently highlighted expression enclosed in parentheses on the expression entry line.

Note that in the various dialog boxes for entering expressions, the highlighted expression in the active algebra window can be changed at any time.  First click in the algebra window to highlight the desired expression or subexpression (see Selecting Objects and Subexpressions).  Then click on the expression entry line and move the blinking cursor to the desired location before pressing the F3 or F4 key.

While entering mathematical expressions on the expression entry line, you can use the Greek symbol toolbar to enter Greek letters and the math symbol toolbar to enter mathematical symbols.  Click on the desired Greek letter or math symbol to insert it on the expression entry line at the current cursor position.  Use the Window > View Toolbars commands to turn on and off the Greek and math symbol toolbars.

Alternatively, you can enter Greek letters and math symbols by typing in their equivalent names on the keyboard (e.g. typing "gamma" for γ, "SQRT" for √, and ">=" for ≥).  The equivalent keyboard names for all the characters on the Greek and math symbol toolbars is displayed when the mouse cursor is moved over the character.

Finally, several of the most common Greek letters and Math symbols can be entered by pressing the following control key ("hotkey") combinations (i.e. pressing the letter while holding down the Ctrl key):

Control key	Math symbol	Derive name	Description
Ctrl+P	π	pi	area of the unit circle (3.14159...)
Ctrl+E	ê	#e	base of the natural logarithms (2.71828...)
Ctrl+I	î	#i	imaginary unit (square root of −1)
Ctrl+O	°	deg	number of radians per degree (π/180)
Ctrl+0	∞	inf	plus infinity
Ctrl+U	∪	UNION	union operator for sets
Ctrl+N	∩	INTERSECTION	intersection operator for sets
Ctrl+T	`	`	transpose operator for matrices complement operator for sets
Ctrl+B	↓	SUB	subscript operator for vectors and matrices
Ctrl+Q	√	SQRT	square root function
Note that Ctrl+X, Ctrl+C, Ctrl+V, and Ctrl+H are reserved by Windows for the cut, copy, paste, and backspace operations respectively.


Selecting Objects and Subexpressions

Note that the highlight (selection) is automatically moved to each new mathematical expression, plot or text object added to the worksheet in the algebra window, except for those expressions resulting from the various Declare commands.

Use one of the following methods to select a single object:

•	Click once on the object using the left mouse button.

•	Press ↑ (press the up arrow key) to select the object above the currently selected object.

•	Press ↓ (press the down arrow key) to select the object below the currently selected object.

•	Press Ctrl+Home (press the home key while holding down the control key) to select the first object in the worksheet.

•	Press Ctrl+End (press the end key while holding down the control key) to select the last object in the worksheet.

•	Press PgUp (press the page-up key) to scroll the display up and then select the object at the top of the algebra window.

•	Press PgDn (press the page-down key) to scroll the display down and then select the object at the bottom of the algebra window.

•	Press Ctrl+PgUp (press the page-up key while holding down the control key) to select the object at the top of the algebra window.

•	Press Ctrl+PgDn (press the page-down key while holding down the control key) to select the object at the bottom of the algebra window.

Use one of the following methods to select multiple contiguous objects:

•	Click the left mouse button once outside the selected object and drag the mouse up or down to highlight previous or subsequent objects.

•	With the currently selected object as an anchor, press and hold the Shift key and click on the last object in the range of objects to be selected.

•	Press Ctrl+Shift+↑ to include the object above the currently selected objects in the selected objects.

•	Press Ctrl+Shift+↓ to include the object below the currently selected objects in the selected objects.

•	Press Ctrl+Shift+Home to include all the objects above the currently selected objects in the selected objects.

•	Press Ctrl+Shift+End to include all the objects below the currently selected objects in the selected objects.

Use the following method to select multiple non-contiguous objects:

•	Press and hold the Ctrl key and then click once with the left mouse button on each object to add to the selection.

To highlight a subexpression of an expression, highlight the expression and then use one of the following methods:

•	Repeatedly click the left mouse button on a subexpression until only the desired subexpression is highlighted.

•	Press Shift+→, Shift+←, Shift+↑ or Shift+↓ (press one of the arrow keys while holding down the shift key) to highlight the desired subexpression.

•	Double click the left mouse button on a subexpression to highlight the smallest subexpression at the mouse point.


Ordering Variables in Expressions

Since addition and multiplication are commutative and associative, the terms of a sum and the factors of a product could be arranged in any order.  However, the Derive normal form orders terms and factors in a certain way to aid the collection of similar terms and factors.  For example, the similar terms of

5·y·x + 7 - 3·x·y

are much easier to find and collect if the terms are first rearranged as

5·x·y - 3·x·y + 7

The Declare > Output Settings command lets you control the ordering used to sort variables.  This variable ordering has a strong influence on how the terms of a sum and the factors of a product are ordered.

Derive maintains a list of variables that specifies the ordering used to sort variables.  The factory default variable order list consists of the variables x, y, and z in that order.

A variable on the list is more main than variables after it on the list or variables not on the list.  A variable not on the list is less main than variables on the list or variables before it in alphabetical order.  For example, x is more main than y, which is more main than a.

When an expression has more than one variable, the most main variable is called the primary variable.  The next most main variable is called the secondary variable, and so on.  For example, x is the primary variable of

     2
5·a·x  + x·y

y is the secondary variable, and a is the tertiary variable.

The coefficient of a product consists of those factors that do not contain the primary variable of the product.  For example, if x is the primary variable of

     2  5
3·a·x ·y

then 3·a·y^5 is the coefficient, and 3 is the numeric coefficient.

The ordering of the factors in a product is based solely on the bases of the factors; the exponents of the factors have no influence on the ordering.  Bases of a product that consist of a variable on the order list are sorted in that order.  For example,

z^2·x^3·y^5

displays as

 2  3  5
z ·x ·y

and simplifies to

 3  5  2
x ·y ·z

Bases of a product that consist of a variable not on the order list are sorted in alphabetical order before bases that consist of a variable on the order list and after the numeric coefficient of the product.  For example,

z^3·b^2·a·2·x^5·c

displays as

 3  2      5
z ·b ·a·2·x ·c

and simplifies to

     2    5  3
2·a·b ·c·x ·z

When ordering the terms of a sum, terms that contain the primary variable come before terms free of the variable.  Moreover, terms that contain the primary variable come before terms that contain that variable to a lower degree.  For example,

5·y^3+2·x^2-3·a·x

displays as

   3      2
5·y  + 2·x  - 3·a·x

and simplifies to

   2              3
2·x  - 3·a·x + 5·y

The coefficients of terms are used to break ties in the ordering of sums.  The terms of the sum that do not contain the primary variable of the sum are ordered using their own primary variable.

Derive sometimes rearranges the terms of a sum to produce more attractive output by eliminating a leading minus sign or displaying the real part of a sum before the imaginary part.  For example,

-x + y

simplifies to

y - x

Use the Declare > Output Settings command to change and/or rearrange the variables on the variable order list.  This command displays the current list and invites you to make changes.  Note that existing expressions must be resimplified to see the effect of changing the variable order list.

When a new variable ordering is entered, this command generates an expression of the form

VariableOrder := [x1, x2, ..., xn]

where x1, x2, ..., xn are variables.  The variable ordering can also be changed by entering on the expression entry line an expression of the above form using upper and lower case for VariableOrder exactly as shown.    [x, y, z] is the factory default variable order setting.

If changing the variable order list does not yield exactly the desired form for a simplified expression, you can rearrange the expression using the Edit > Object command.

Subexpressions are less likely to be expanded if their variables are least main.  Similarly, ratios are least likely to be combined if variables in sums in their denominators are least main.  Thus the ordering of variables can dramatically affect the conciseness of a simplified result and the time required to obtain it.  For example, if x is more main than y (as it is by default),

(x + 1)^9 + y

simplifies to

 9    8     7     6      5      4     3     2
x + 9x + 36x + 84x + 126x + 126x + 84x + 36x + 9x + y + 1

because the subexpression (x+1)^9 is expanded.  However, if you change the variable order list to y,x,z using the assignment

VariableOrder := [y, x, z]

then

(x + 1)^9 + y

simplifies to

           9
y + (x + 1)

because the subexpression (x+1)^9 is not expanded, thus giving a compact result that requires less time to compute.  Before continuing, we recommend restoring the default Derive variable ordering by issuing the comand

VariableOrder := [x, y, z]

Expression growth from an unfortunate ordering of variables can exhaust memory before a result is derived.  If this occurs while simplifying a multivariate expression, change the ordering of the variables and try resimplifying the expression.  Alternatively, use the Simplify > Variable Substitution command to interchange the names of the variables in the expression before resimplifying.


Controlling Notation

Precision is the accuracy used to compute numbers (see the Precision field of the Declare > Simplification Settings command).  A related but separate issue is the notation used to display numbers.

Numbers can be displayed using rational notation:  Integers are displayed as integers and fractions are displayed as ratios of integers.  Rational notation has the advantage that all stored numbers can be displayed exactly.  However, numbers that require many digits to display in rational notation are difficult to comprehend.

Thus, it is also possible to display fractions using decimal point notation.  It is also possible to display large magnitude and small magnitude numbers using scientific notation.  Finally, it is possible to display numbers in mixed notation using whichever style is most concise:  rational notation if a number is simple, decimal point notation if a number's magnitude is not extreme.  Otherwise use scientific notation.

You can also control the maximum number of fractional digits displayed in decimal point notation or the maximum number of significant digits displayed in scientific notation.  This number can be more, less, or the same as the number of digits of precision set in the Precision field of the Declare > Simplification Settings command.  For decimal fraction, scientific, or mixed notation, it is usually advisable to display no more digits than are accurate and necessary for your purposes.  This policy avoids misleading results and increases comprehension.

Use the Notation and Digits fields of the Declare > Output Settings command to see and/or change the notation style and the number of digits used when displaying numbers on the screen and when saving numbers in MTH files.  Regardless of the number in the Digits field, rational notation uses as many digits as necessary to display results.  Thus, set the Digits field to the digits you want displayed for decimal fraction, scientific, or mixed notation.

When a new notation style is selected, this command generates an expression of the form

Notation := style

where style is Decimal, Mixed, Rational, or Scientific.  When a new number of digits to display is entered, the command generates an expression of the form

NotationDigits := digits

where digits is a positive integer.  The notation style and digits to display can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.

If you use the Precision field of the Declare > Simplification Settings command to change the precision to exact mode, the notation style is automatically changed to rational.  If you change the precision to approximate mode, the notation style is changed to scientific.  If you change the precision to mixed mode, the notation style is changed to mixed.

If you use the Precision field of the Declare > Simplification Settings command to change the number of digits of precision, the number of digits displayed is changed to the requested precision.

Normally these automatic changes made to the notation by the precision commands make it unnecessary for you to have to change the notation yourself.  However, if you want some other notation, the notation command must be issued after the precision command.

For example, if you use the Precision field of the Declare > Simplification Settings command to set precision to approximate mode using 6 significant digits, then π simplifies to 3.14159, a decimal approximation for π.  Then if you use the Notation field of the Declare > Output Settings command to set the notation style to rational, then π simplifies to 355/113, a rational approximation for π.


Controlling Radix Base

Use the Radix field of the Declare > Input Settings command to view and/or change the current input base.  Use the Radix field of the Declare > Output Settings command to view and/or change the current output base.

Sometimes it is convenient to convert numbers between radix bases and/or to work with numbers in bases other than base ten.  You above commands make it possible to independently control the base used for entering numbers and the base used for displaying numbers.

The most commonly used radix bases are binary (base two), octal (base eight), decimal (base ten), and hexadecimal (base sixteen).  You can specify a radix base for the above commands by selecting Binary, Octal, Decimal, or Hexadecimal from a menu, or by typing in an integer between 2 through 36, inclusive.  In the latter case, enter the integer using decimal (base ten) notation.

When you specify a new input radix base, the Declare > Input Settings command generates an expression of the form

InputBase := base

where base is Binary, Octal, Decimal, Hexadecimal, or an integer between 2 and 36, inclusive.  When you specify a new output radix base, the Declare > Output Settings command generates an expression of the form

OutputBase := base

where base is Binary, Octal, Decimal, Hexadecimal, or an integer between 2 and 36, inclusive.  The input and output radix bases can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.

For radix bases greater than ten, the letter A is used to represent the digit ten, the letter B is used to represent the digit eleven, and so on through the letter Z for the digit thirty-five.  To avoid ambiguity with variables, such numbers that start with a letter are displayed and must be entered using a leading zero (0) digit.  For example, in base sixteen the decimal number fourteen is displayed and must be entered as 0E.

If you enter a number and it displays differently than what you typed, you may have inadvertently changed the input and/or output radix.  You can use one of the above commands to determine the current radix.


Controlling Expression Format

Use the Expression display field of the Declare > Output Settings command to control how expressions are displayed on the screen or sent to the printer.

Click on the Normal or Compressed radial button to select the display format for expressions.  In normal display format, spaces are used around some operators, like + and -, to enhance the readability of expressions.  In compressed display format, nonessential spaces around operators are eliminated.  Compressed format may make it possible to display a large expression without having to wrap the expression on multiple lines or to scroll it horizontally.  Normal is the factory default display format setting.

The proper symbol to use for the times operator, used to indicate multiplication, is a subject of heated debate and a matter of personal taste.  Therefore, Derive gives you a choice.  Use the Multiplication operator field of the Declare > Output Settings command to select the Asterisk, Dot, or Implicit to indicate multiplication.  If Implicit is selected, a space is inserted between operands to indicate multiplication.  Dot is the factory default times operator setting.

When a new display format is selected, this command generates an expression of the form

DisplayFormat := format

where format is Normal or Compressed.  When a new times operator is selected, this command generates an expression of the form

TimesOperator := operator

where operator is Asterisk, Dot, or Implicit.  The display format and times operator can also be changed by entering on the expression entry line expressions of the above form using upper and lower case exactly as shown.

Note that selecting both Compressed display format and the Implicit times operator results in poorly spaced expressions.  For example, examine

a·b+c·d

using each of the six possible settings provided by the Expression display and Multiplication operator fields of the Declare > Output Settings command.


Step-by-Step Equation Solving

This topic illustrates how the Edit > Object and Simplify commands can be used to solve equations and relations manually by issuing a sequence of commands.  This procedure is useful for learning how to solve such problems.  Use the Solve > Expression command to automate the process of solving equations and relations.

If an equation is added to an equation, the result is an equation whose left side is the sum of the left sides of the original equations and whose right side is the sum of the rights sides of the original equations.  Similar remarks apply to subtracting, multiplying, and dividing an equation by an equation.

If an expression, other than an equation, is added to an equation, the expression is added to both sides of the equation.  Similar remarks apply to subtracting, multiplying, and dividing an equation by an expression.

The ability to combine equations with expressions makes it possible to solve equations in a step-by-step manner.  For example, to manually solve the linear equation

2·x - 3 = 5

for x, first enter the equation.  Then press the F4 key to copy the equation to the expression entry line enclosed in parentheses and add 3 to both sides of the equation by entering the expression

(2·x - 3 = 5) + 3

which simplifies to

2·x = 8

Then press the F4 key again and divide both sides of the equation by 2 by entering the expression

(2·x = 8)/2

which simplifies to the solution of the original equation

x = 4

Quadratic equations can also be solved manually by completing the square.  For example, to solve the quadratic equation x²+5·x+6=0 for x, start by subtracting 6 from both sides of the equation by entering the expression

(x^2 + 5·x + 6 = 0) - 6

which simplifies to

 2
x  + 5·x = -6

Then complete the square by adding 5/2 squared to both sides of the equation by pressing the F4 key and entering the expression

(x^2 + 5·x = -6) + (5/2)^2

which factors to

          2
 (2·x + 5)      1
———————————— = ———
      4         4

Then press the F4 key and multiply both sides of the equation by 4 giving

         2
(2·x + 5)  = 1

Taking the square root of both sides of this equation giving the two linear equations

2·x + 5 = 1

2·x + 5 = -1

that can be solved as described previously.

Quadratic and higher order polynomial equations can be solved by collecting all the terms on one side of the equation and factoring.  For example, rationally factoring the equation

 2
x  - 5·x + 6 = 0

yields the equation

(x - 2)·(x - 3) = 0

Then set the factors equal to 0 by highlighting each factor and using the Edit > Object command.  This gives the two linear equations

x - 2 = 0

x - 3 = 0

that can be solved as described previously.

The result of applying a function to an equation is an equation whose left and right sides are the result of independently applying the function to the left and right sides of the original equation.  For example, to solve the equation

LN(x) = 5

where LN is the natural logarithm function (see Built-in Functions and Constants), use the Edit > Object command to apply the exponential or inverse logarithm function EXP to the equation.  This gives

EXP(LN(x) = 5)

which simplifies to the solution of the original equation

     5
x = ˆ

Be aware that applying one of the Inverse Trigonometric Functions to an equation discards all solutions not on the principal branch.  Operations such as clearing the denominator or squaring both sides of an equation can introduce spurious solutions.  For example, squaring both sides of the equation

SQRT(x) = -1

yields x=1, which is not a solution.  Solutions should always be verified by substituting them into the original relation.


Solving Equations and Inequalities Algebraically

You can use the Solve > Expression command and the SOLVE and SOLUTIONS functions to solve equations and inequalities exactly using algebraic methods.  The Solve > Expression command and the SOLVE function return solutions in the form of equations and/or inequalities.  The SOLUTIONS function returns solutions in the form of a vector of values that satisfy the equations or inequalities.

The first argument of SOLVE and SOLUTIONS is the equation or inequality to be solved.  If neither an equation nor inequality, it is assumed equal to 0.  The second argument is the solution variable.  If the third argument is the constant Real, only solutions not having an imaginary component are returned.  For example,

SOLVE(x^3 + x^2 + x + 1, x)

simplifies to

x = -î ∨ x = î ∨ x = -1

whereas,

SOLVE(x^3 + x^2 + x + 1, x, Real)

simplifies to

x = -1

Given an equation or inequality, the Solve > Expression command and the SOLVE function return the solutions as a Boolean expression logically equivalent to the input but in disjunctive normal form.  That is an expression of the form

relation1 OR relation2 OR ...

where relationi is an equation or inequality.  For example, the equation

SOLVE(x^2-1 = 0, x)

simplifies to

x = -1 ∨ x = 1

and the inequality

SOLVE(ABS(ABS(2·x + 1) - 5) > 2, x)

simplifies to

x < -4 ∨ -2 < x < 1 ∨ x > 3

Given a 1-element vector whose element is an equation or inequality, the Solve > Expression command and the SOLVE function return a vector of solutions, each in the form of a relation.  For example,

SOLVE([x^2-1 = 0], x)

simplifies to

[x = -1, x = 1]

Given an equation or inequality or a 1-element vector whose element is an equation or inequality, SOLUTIONS returns a vector of values that satisfy the equation or inequality.  For example,

SOLUTIONS(x^2-1 = 0, x)

simplifies to

[1, -1]

Unless restricted to the real domain, the solve commands and functions attempt to find all the real and complex solutions of the equation or inequality.  The set of solutions returned is not restricted by the declared domains of the solution variables (see Declare > Variable Domain command).

The solve commands and functions can directly solve binomial, linear, quadratic, cubic, and quartic polynomial equations.  They can also solve higher degree polynomial equations that can be exactly factored into such equations.

To help solve equations involving trigonometric functions, try various settings of the trigonometry field of the Declare > Simplification Settings command.

Often equations involving trigonometric functions have infinitely many solutions.  For example, the solution to the equation  sin(x)=0  is  x = 0 ∨ x = π ∨ x = -π ∨ x = 2·π ∨ x = -2·π ∨ ... .  Since Derive has no way to represent an infinite number of disjuncts, the solve commands and functions return a representative sample of several solutions near the origin.  For example,

SOLVE(SIN(x) = 0, x)

simplifies to

x = -π ∨ x = π ∨ x = 0

If the given equation or inequality is too difficult to solve completely, one or more implicit relations are displayed as an equation or an inequality with an expression containing the variable in an inextricable way on the left and a zero on the right.  For example,

SOLVE(3^x = x^2, x)

simplifies to

 x    2
3  - x  = 0

Equations and inequalities can have any number of solutions, including none.  When there are no solutions, the truth-value false or the empty vector [ ] is returned, as appropriate.  For example,

SOLVE(x = x + 1, x)

simplifies to false.

An equation or inequality is degenerate if it is true for all values of the solution variable.  Given a degenerate equation or inequality, both the Solve > Expression command and the SOLVE function return the truth-value true.  For example,

SOLVE(|x - 2| >= 0, x)

simplifies to true.  Given a degenerate equation or inequality, the SOLUTIONS function returns a 1-element vector of the form [@n] where n is an integer.  You can think of "@" as an abbreviation for "arbitrary" or "anything".  n starts at 1 and increments by 1 each time a new variable is required.  For example,

SOLUTIONS(|x - 2| >= 0, x)

simplifies to [@1].


Solving Equations Numerically

You can use the Solve > Expression command and the NSOLVE and NSOLUTIONS functions to solve an equation dependent on one variable using approximate numerical methods.  NSOLVE and NSOLUTIONS cannot solve equations dependent on more than one variable, inequalities, or systems of equations.  Functions are defined in SOLVE.MTH - Solving Nonlinear Systems and Complex Solutions to solve systems of equations dependent on more than one variable using numerical methods.

The NSOLVE and NSOLUTIONS functions always use approximate numerical methods to solve an equation.  If Derive is in approximate mode and the functions SOLVE and SOLUTIONS are unable to solve an equation using algebraic methods, they switch to numerical methods to solve the equation.

The solutions returned by NSOLVE and NSOLUTIONS are in the same form as those returned by SOLVE and SOLUTIONS, respectively (see Solving Equations and Inequalities Algebraically).  In particular, if the third argument is the constant Real, only solutions not involving imaginary numbers are returned.  For example,

NSOLVE(x^5 - 2·x^3 + 4·x^2 + 2·x - 3 = 0, x)

simplifies to

x = 1.013396467 - 1.152395734·î ∨
x = 1.013396467 + 1.152395734·î ∨
x = 0.7265501429 ∨
x = -1.753343077 ∨
x = -1

whereas

NSOLVE(x^5 - 2·x^3 + 4·x^2 + 2·x - 3 = 0, x, Real)

simplifies to

x = 0.7265501429 ∨ x = -1.753343077 ∨ x = -1

As the examples above show, given a polynomial equation with numeric coefficients, NSOLVE and NSOLUTIONS return all the real and complex solutions to the equation.  However, for any other type of equation, NSOLVE and NSOLUTIONS return only one solution to the equation.

If the third and fourth arguments of NSOLVE and NSOLUTIONS approximate to numbers, the search for a solution is restricted to that interval and only one solution is returned.  For example, to find an approximate solution to the equation x·sin(x) = 1 between x=2 and 4, simplify the expression

NSOLVE(x·SIN(x) = 1, x, 2, 4)

If you have no idea where a solution occurs, you can plot the difference in the two sides of the equation to find an interval where the plot crosses or touches the x-axis.  To find a solution other than ones already found, specify an interval that excludes the known solutions.

The numerical equation solving commands and functions will find an approximate solution if the difference in the two sides of the equations is continuous and has different signs at the ends of the interval.  Even if the equation is discontinuous in the interval or does not have different signs at the ends, these commands and functions usually find a solution if one exists in the interval.

The numerical equation solving commands and functions are normally able to return a solution accurate to the current digits of precision specified in the Precision field of the Declare > Simplification Settings command.  However, catastrophic cancellation of approximate large magnitude terms can make the difference in the two sides equal 0 even though the approximate solution is not accurate to the current digits of precision.

Rationally factoring the difference in the two sides of an equation (see the Simplify Factor command) before using these commands and functions often results in more accurate solutions obtained more quickly.  For example,

NSOLVE((x - pi)^4 = 0, x, 3, 4)

simplifies to x = 3.141592653 which is a good approximation for π, whereas

NSOLVE(x^4 - 4·pi·x^3 + 6·pi^2·x^2 - 4·pi^3·x + pi^4 = 0, x, 3, 4)

simplifies to x = 3.140685047 which is a poor approximation.


Solving Systems of Equations

You can use both the Solve > Expression and Solve > System command commands to solve systems of polynomial equations.  You can also use the SOLVE and SOLUTIONS functions to solve such systems.  The first argument of SOLVE and SOLUTIONS is the system of equations to be solved.  The second argument is a vector of the solution variables.

All these methods use the Groebner basis algorithm to reduce the system of polynomial equations to a single univariate equation.  This univariate equation is then solved algebraically or numerically, and the result back-substituted into the other equations.

Given a conjunction of equations, the Solve > Expression command and the SOLVE function return the solutions as a Boolean expression logically equivalent to the input but in disjunctive normal form.  That is an expression of the form

conjunct1 OR conjunct2 OR ...

where conjuncti is an expression of the form

relationi1 AND relationi2 AND ...

where relationij is an equation or inequality.  For example,

SOLVE(x^2 + y^2 = 2·a^2 AND x - y = 0, [x, y])

simplifies to

(x = -a ∧ y = -a) ∨ (x = a ∧ y = a)

Given a vector of equations, the Solve > Expression command and the SOLVE function return a vector of solutions.  The Solve System command always returns the solutions in this form.  For example,

SOLVE([x^2 + y^2 = 2·a^2, x - y = 0], [x, y])

simplifies to

[x = a ∧ y = a, x = -a ∧ y = -a]

No matter how the equations are given, SOLUTIONS returns a vector of vectors (i.e. a matrix) of solution values.  For example,

SOLUTIONS(x^2 + y^2 = 2·a^2 AND x - y = 0, [x, y])

simplifies to

  a   a

 -a  -a

A system of equations is singular if the equations are not independent of one another.  Singular systems of equations can be either consistent or inconsistent.

Given a consistent singular system of equations, both the Solve commands and the SOLVE function return a simplified equivalent system of equations.  For example,

SOLVE(2·x + 6·y = 2 AND 3·x = 3 - 9·y, [x, y])

simplifies to

x + 3·y = 1

Given a consistent singular system of equations, the SOLUTIONS function returns a vector of solutions containing one or more arbitrary values of the form @n where n is an integer.  The number of distinct arbitrary values is equal to the number of solution variables minus the number of independent equations.   For example,

SOLUTIONS(2·x + 6·y = 2 AND 3·x = 3 - 9·y, [x, y])

simplifies to

      1 - @1
 @1  ————————
         3

Given an inconsistent singular system of equations, the Solve commands and the SOLVE function return the truth-value false or the empty vector [ ], depending on how the system is given.  For example,

SOLVE(x + 3·y = 1 AND 2·x + 6·y = 3, [x, y])

simplifies to false and

SOLVE([x + 3·y = 1, 2·x + 6·y = 3], [x, y])

simplifies to [ ].

The Solve commands and the SOLVE and SOLUTIONS functions cannot directly solve a system of equations if they are not polynomial in their solution variables.  Functions are defined in SOLVE.MTH - Solving Nonlinear Systems and Complex Solutions for computing approximate real or complex solutions to systems of non-polynomial equations.


Significance of Domain Declarations

Some transformations for simplifying mathematical expressions are valid for both real and complex expressions.  For example,

(√z)²  →  z

is valid whether z is a real or complex expression.  Some transformations are valid only for real expressions.  For example,

√(x²)  →  |x|

is valid only if x is real.  Some transformations are valid only for a restricted interval of real values.  For example,

√(x·y)  →  √(x)·√(y)

is valid for real x and y unless both are negative.  Some transformations are valid only for integer-valued expressions.  For example,

sin(n·π)  →  0

is valid only if n has an integer value.  Even as basic a transformation as commuting the operands of a product is valid only if the operands are scalars.

When simplifying an expression, Derive exploits a transformation only if it can determine that the transformation is valid.  This determination depends heavily on the declared domain of the variables in the expression.  Use the Declare > Variable Domain command to examine or change the domain declaration of a variable.

Since real-valued variables are the most common, the default domain of undeclared variables is real.  However, if an expression contains variables that only assume integer values or a subset of real values, you can restrict the domain of these variables.  On the other hand, if an expression contains variables that can be complex or even a vector, set, or logical truth-value, you can expand the domain of these variables.

The transformation

x - x  →  0 · x  →  0

is essential for simplifying expressions.  Since this and other transformations are questionable if x is infinity, Derive does not permit variable domains to include an infinite magnitude.  Thus infinite bounds are always strict.

Although variables cannot be declared infinite, you can substitute an infinite value for a variable in an expression (see the Simplify > Variable Substitution command).  However, you risk an invalid result if the expression was derived using transformations, such as the above, which are questionable for infinite values.

As might be expected, Derive simplifies both x/x and x^0 to 1, even if the domain of the variable x includes 0.  For consistency, Derive also simplifies 0^0 to 1, since this is just a special case of the above x^0 simplification.

The domains of variables are used during simplification of fractional powers, absolute values, logarithms, and some other irrational functions.  They do not restrict the values that can be substituted for variables (see the Simplify > Variable Substitution command).  Thus, you can substitute a complex value for a real variable or a negative value for a positive variable.  Such substitutions are made at your own risk.


Using and Saving State Variables

The settings of the algebra state variables affect how expressions are input, output, and simplified.  The first time Derive starts, the state variables are assigned factory default settings.

The algebra state variable settings can be examined and/or changed using the following commands:

•	Declare > Input Settings command

•	Declare > Output Settings command

•	Declare > Simplification Settings command

•	Declare > Reset All Settings command

Alternatively, if you know the state variable name and the desired value, you can use either the Declare > Variable Value or Author > Expression command command to generate the appropriate assignment statement.

If any of the algebra state variable settings are changed during a Derive session, you will be prompted when the file is closed to save the changed settings as the default.  If you say "Yes", the state variable settings associated with the active worksheet are saved to the DERIVE initialization file (DFW.INI) as the default settings to be used when subsequent worksheets are created.  If you say "No", then the DERIVE initialization file and thus the default settings will not be altered.

To restore the factory default settings of the state variables to the DERIVE initialization file , issue the Declare > Reset All Settings command.  Assignment statements will be generated for those state variables whose settings are different from the factory settings.  Then, use the File Close command to close the worksheet and choose "Yes" at the prompt to store the new state variable settings as the default.

When saving a MTH file using the File > Save As command, check the Save State Variables option to ensure that the current Derive state will be in effect when the MTH file is subsequently loaded into a worksheet.  All the current state variable settings associated with the active worksheet will be written to the MTH file before any of the expressions are saved.  To save just the current state variable settings to a MTH file, check the Save State Variables option and uncheck the Save Expressions option of the File > Save As command.


Derive Initialization File

Derive keeps information such as window sizes and colors, printing options, the Math file directory, and the algebra state variable settings in the DFW.INI initialization file.  The settings stored in the file are used to initialize Derive when it starts, unless you choose the "Use factory default settings" option provided by the Derive Startup dialog box.  If the file does not exist when Derive starts, it automatically creates a DFW.INI file using the factory default settings.

If Derive is launched by clicking on a shortcut icon on the Windows desktop, the DFW.INI file is stored in the "Start in" directory (also called the working directory) specified by the properties of the shortcut.  To examine and/or change the "Start in" directory, right click on the Derive desktop icon and select the "Properties" option.

If Derive is launched by clicking on a DFW or MTH file from Windows explorer or some other program, the DFW.INI file is stored in the same directory as the DfW.exe application file.  Normally the DfW.exe file resides in the directory named \DfW5 created when Derive is installed.

DFW.INI is a standard Windows INI (initialization) file that can be edited with a text editor.  However, we do not recommend editing the file yourself.  In any event, do not edit or delete the DFW.INI file while Derive is running, since it uses and modifies the file as it runs.

Related topics:

Using and Saving State Variables

Network Installation Questions

Algebra Window File > Close command

Plot Window File > Close command


Calculus commands

Use the Calculus commands to find symbolic limits, derivatives, integrals, sums, products, and Taylor series approximations; and to generate vectors and tables of data.

Limit...

Differentiate...

Taylor Series...

Integrate...

Sum...

Product...

Vector...

Table...

Other Algebra Window Commands


Calculus > Limit command

Use the Calculus > Limit command or press Ctrl+Shift+L to find the limit of an expression as one of its variables approaches a point.  This command allows you to select the limit variable, the limit point, and the direction from which the point is approached on the real line.

Alternatively, the limit of the expression u as the variable x approaches the point a can be entered by typing in an expression of the form LIM(u, x, a).  a defaults to 0.  For example, to use the limit to determine the derivative of x², simplify the expression

LIM(((x+h)^2-x^2)/((x+h)-x), h, 0)

If there is a discontinuity in u at x=a, the limit as x approaches a from the right may differ from the limit as x approaches a from the left.  The right-hand limit can be entered by calling LIM with a positive number, such as 1, as its fourth argument.  For example, to determine the limit of SIGN(x) as x approaches 0 from the right, simplify the expression

LIM(SIGN(x), x, 0, 1)

The left-hand limit can be entered by calling LIM with a negative number, such as -1, as its fourth argument. For example, to determine the limit of SIGN(x) as x approaches 0 from the left, simplify the expression

LIM(SIGN(x), x, 0, -1)

Note that the two-sided limit

LIM(SIGN(x), x, 0)

simplifies to ±1.

As another example, the right-hand limit

LIM(1/x, x, 0, 1)

simplifies to ∞ (plus infinity), the left-hand limit

LIM(1/x, x, 0, -1)

simplifies to -∞ (minus infinity), and the two-sided limit

LIM(1/x, x, 0)

simplifies to ±∞ (plus or minus infinity).

Limits as a variable increases without bounds can be found by calling LIM with infinity as the limit point.  Infinity can be entered by clicking on the ∞ on the math symbol toolbar, pressing Ctrl+0, or by typing inf.  For example, to determine the limit of a·x/(x+1) as x approaches plus infinity, simplify the expression

LIM(a·x/(x+1), x, inf)

Both LIM and SUBST (see the Simplify > Variable Substitution command) can be used to substitute a value for a variable in an expression.  However, the limit of an expression may simplify to a unique value; whereas substitution may simplify to an ambiguous answer such as ±inf, ±1, or ? (unknown).  For example,

LIM(x/SIN(x), x, 0)

simplifies to 1; whereas

SUBST(x/SIN(x), x, 0)

simplifies to ?.

To facilitate using LIM for substitution, its second argument can be a vector of variables, instead of just a variable.  Then its third argument should be a vector of values for those variables.  For example,

LIM(x^2+y^2, [x,y], [2,3])

simplifies to 13 (i.e. 2²+3²).

You can use LIM to substitute values for variables in function definitions (see the Declare > Function Definition command).  For example, to define the function SLOPE which returns the slope of the secant line through the points u(a) and u(b), enter the expression

SLOPE(u,x,a,b) := (LIM(u,x,b)-LIM(u,x,a))/(b-a)

Then, to determine the slope of the secant line to the curve EXP(x) through the points x=1 and x=2, simplify the expression

SLOPE(EXP(x),x,1,2)

Other Calculus commands


Calculus > Differentiate command

Use the Calculus > Differentiate command or press Ctrl+Shift+D to find the partial derivative of an expression.  This command allows you to select the differentiation variable and the order of the derivative.

Alternatively, the partial derivative of the expression u with respect to the variable x can be entered by typing in an expression of an expression of the form DIF(u, x). Note that the differentiation must be with respect to a variable rather than an expression.  For example,

DIF(SIN(a·x^2),x)

displays as

d         2
—— SIN(a·x )
dx

and simplifies to

             2
2·a·x·COS(a·x )

The nth order partial derivative of the expression u with respect to the variable x can be entered by typing in an expression of the form DIF(u, x, n).  For example, the second-order partial derivative

DIF(LN(COS(x)),x,2)

simplifies to

      1
- —————————
         2
   COS(x)

You can issue successive Calculus > Differentiate commands or enter nested calls on DIF to obtain mixed partial derivatives.  For example, the mixed second-order partial derivative

DIF(DIF((a·x + b·y)^3,x),y)

simplifies to

6·a·b·(a·x + b·y)

If an expression does not explicitly contain the differentiation variable, it is considered independent of the variable and the derivative simplifies to 0.  To take the derivative of an arbitrary function, say F, first use the Declare > Function Definition command to declare F an arbitrary function.  For example, if F is declared an arbitrary function using the assignment

F(x) :=

then

DIF(F(x)^3,x)

simplifies to

            2
3·F'(x)·F(x)

As shown above, the prime notation can be used to indicate differentiation of named functions.  If F is the name of a user-defined function of one variable, the nth derivative of F(x) with respect to u can be entered by typing an expression of the form F’...’(u), where ‘...’ is n primes.  For example, if F(x) is defined using the assignment

F(x) := SIN(a·x^2)

then F'(x) simplifies to

             2
2·a·x·COS(a·x )

and F'(LN(y)) simplifies to

                     2
2·a·LN(y)·COS(a·LN(y) )

Derive uses the chain rule to differentiate compositions of functions.  For example, F and G are declared arbitrary functions, then

DIF(F(G(x)),x)

simplifies to

G'(x)·F'(G(x))

Derive can compute the derivative of all its pre-defined mathematical functions and operators with the exception of the factorial operator ! (see Probability Functions).  The derivative of ! can be defined in terms of the psi and polygamma functions defined in the utility file PROBABIL.MTH.

Functions for numerical differentiation are defined in NUMERIC.MTH.  Many applications of differentiation, including functions for implicit differentiation, curvature, tangents, and osculating circles, are defined in DIF_APPS.MTH.

Other Calculus commands


Calculus > Taylor Series command

Use the Calculus > Taylor Series command or press Ctrl+Shift+T to find a Taylor polynomial approximation to an expression.  This command allows you to select the expansion variable, the order (maximum degree) of the approximation, and the expansion point.

Alternatively, the Taylor polynomial approximation of the expression u with respect to the expansion variable x about the expansion point a of order n can be entered by typing in an expression of the form TAYLOR(u, x, a, n).  For example,

TAYLOR(#e^x, x, 0, 5)

simplifies to

   5      4      3      2
  x      x      x      x
————— + ———— + ———— + ———— + x + 1
 120     24      6      2

The order of the approximation is the number of partial derivatives used in the truncated Taylor series approximating the expression.  Some of these derivatives may simplify to 0 at the expansion point, so the number of terms and the degree of the resulting polynomial may be less than the specified order.  For example,

TAYLOR(c·SIN(x),x,0,6)

simplifies to

    5        3
 c·x      c·x
—————— - —————— + c·x
  120       6

For some expressions, successive partial derivatives grow rapidly in size and hence computing time.  Thus when computing Taylor polynomial approximations, it is wise to start with a small value for the order of approximation (such as 2 or 3).  For example, compute the first, second, and third derivatives of

(x+1)/(EXP(x)+1)

and note the strongly increasing complexity and computing time for successive derivatives.

It is possible for all the derivatives of an expression to evaluate to 0 at a point, even though the expression is not a constant.  The Taylor polynomial approximation of such an expression expanded about this point is 0, no matter how large the order of approximation.  For example, verify that the fourth, fifth, and sixth order Taylor polynomial approximations of

EXP(-1/x^2)

about the point x=0 are all 0.  Then plot the above expression to see that 0 is indeed a good approximation of it near x=0.

Some expressions cannot be approximated by a Taylor polynomial beyond a certain order because the derivatives are not finite at the expansion point beyond that order.  In such cases, TAYLOR simplifies to plus-or-minus infinity, complex infinity, or ? (unknown).  For example, the 0th order Taylor polynomial approximation of SQRT(x) about the point x=0 is 0, but the first order approximation is complex infinity and the second order approximation is ? .

Functions that use Taylor series approximations to solve equations, invert functions, and solve first and second order differential equations are defined in various utility files (see Utility File Functions).

Other Calculus commands


Calculus > Integrate command

Use the Calculus > Integrate command or press Ctrl+Shift+I to find the definite integral or indefinite integral (antiderivative) of an expression.  This command allows you to select the integration variable, and definite or indefinite integration.  If you request definite integration, you can enter the lower and upper limits.  If you request indefinite integration, you can enter the integration constant.  Note that the #n notation can be used to refer to previous expressions when entering integration limits.

Alternatively, the antiderivative of the expression u with respect to the variable x without an integration constant can be entered by typing in an expression of the form INT(u, x).  The antiderivative of the expression u with respect to the variable x with the integration constant c can be entered by typing in an expression of the form INT(u, x, c).  The definite integral of the expression u with respect to the variable x from the lower limit a to the upper limit b can be entered by typing in an expression of the form INT(u, x, a, b).

Antiderivatives and definite integrals are displayed using an integral sign.  Upon simplification, Derive attempts to determine a closed-form expression whose partial derivative is the integrand.  A closed-form expression does not contain infinite series, infinite products, integrals, or limits.  For example,

INT(x/(a^2+b^2·x^4),x)

simplifies to

           2
        b·x
 ATAN (——————)
          a
———————————————
      2·a·b

Use the Calculus > Differentiate command to find higher order antiderivatives by entering a negative integer for the order of the derivative.  Alternatively, the nth order antiderivative of the expression u with respect to the variable x can be entered by typing in an expression of the form DIF(u, x, -n).  For example, the second-order antiderivative

DIF(-TAN(x)^2-1, x, -2)

simplifies to

LN(COS(x))

Issue successive Calculus > Integrate commands or enter nested calls on INT to obtain iterated definite integrals.  This provides a convenient method for computing double integrals and triple integrals.  For example, the iterated definite integral

INT(INT(x·LN(y), y, x, 2·x), x, 0, 2)

simplifies to

8·LN(2) - 32/9

Derive uses powerful techniques that enable it to find antiderivatives for a large class of expressions.  These expressions include extended polynomials; products of polynomials with sinusoids, logarithms, or exponentials that are linear in their arguments; piecewise continuous functions; and many rational expressions or expressions involving square roots of linear or quadratic expressions.

If a simplified result includes one or more integral signs it is because the antiderivative does not exist or Derive is unable to find the antiderivative.

If Derive determines that a closed-form antiderivative does not exist in terms of its pre-defined functions and operators, it displays the message No elementary integral on the status line.

If Derive is unable to find an antiderivative that does exist, you may be able to help it along by making a change of variable or using integration by parts.  Functions to facilitate both these integration techniques are defined in the utility file MISC.MTH.

If all else fails, you can approximate the antiderivative of an expression by integrating its Taylor polynomial approximation (see Calculus > Taylor Series command).  You may need to use several different expansion points to make the series converge more rapidly over the interval of interest.  For example, to find an approximation for the antiderivative of SIN(x)/x by integrating its fourth order Taylor polynomial approximation about the point x=0, simplify the expression

INT(TAYLOR(SIN(x)/x,x,0,4),x)

If you chose to add an arbitrary constant to antiderivatives, use a new constant name each time to prevent unjustified cancellations of the constants when subtracting antiderivatives.

When comparing a Derive produced antiderivative with one in an integral table, it is important to realize that they may appear quite different.  They may be different forms of equivalent expressions, or they may differ by a well disguised constant.  Note that if such different forms occur, you can use Derive to simplify the difference of the two antiderivatives and see if the result is independent of the integration variable.

If precision is in approximate mode and the integrand depends only on the integration variable and both limits are numeric, then Derive uses an extrapolated adaptive Simpson's rule to numerically approximate definite integrals.  This algorithm is also used if precision is in mixed mode and Derive is unable to determine a closed-form antiderivative for the integrand.

The computing time for this numerical integration algorithm usually increases sharply with the current precision.  For many integrals the resulting accuracy is nearly that of the current precision.  However, the accuracy may be significantly worse than the current precision if the integrand or one of its low order derivatives has a discontinuity or a singularity within the interval or at either endpoint.  Integrals that have relatively equal areas above and below the axis can also cause poor relative error via catastrophic cancellation.  Derive is usually able to recognize that one of these situations has occurred, in which case it displays the warning message Dubious accuracy.

If precision is in exact or mixed mode, Derive simplifies definite integrals by trying to determine a closed-form antiderivative for the integrand.  Then it subtracts the limit of the antiderivative as the integration variable approaches the lower limit from the limit as the integration variable approaches the upper limit.  Both limits are approached from within the interval.  Thus, Derive can determine some improper integrals having infinite limits or integrand singularities at the limits.  For example,

INT(1/x^2,x,1,inf)

simplifies to 1, and

INT(1/SQRT(x),x,0,1)

simplifies to 2.

Although this technique is valid for endpoint singularities, it may be invalid if there is a singularity within the integration interval.  Instead of the Riemann integral, it may yield the Cauchy principal value.  For example,

INT(1/x^3,x,-1,2)

simplifies to 3/8 which is correct only if the assumption is made that the singularity at 0 is approached at the same rate from both sides, thus exactly canceling the positive and negative infinite areas.

An even more serious problem occurs when a difference of antiderivatives across a singularity gives results that even Cauchy would call wrong.  As is the case when using integral tables, it is your responsibility to find singularities that occur within the interval of integration and to split the integrals there.

If the integrand looks as though it may have singularities but their locations are not obvious, try using the soLve command to find the zeros of the integrand's common denominator.  Plotting the integrand over the integration interval may also help.  However, there is no known method that is guaranteed to find all internal singularities.

There may exist a closed-form definite integral of an expression for which there is no closed-form antiderivative.  Although Derive can not directly integrate such expressions, it is useful for doing the steps required by various advanced techniques required to solve such problems.

Many applications of integration, including functions for Laplace transforms, Fourier series, arc lengths, surface areas, centroids, and moments of inertia, are defined in INT_APPS.MTH - Applications of Integration.

Other Calculus commands


Calculus > Sum command

If f and F are functions such that for all n, f(n) = F(n + 1) - F(n) then F(n) is called the antidifference of f(n).  Using telescoping cancellation, it is easy to see that the summation of f(i) from i=m to n is F(n + 1) - F(m).

Thus finding the antidifference of an expression enables you to determine closed-form definite sums of the expression with variable upper or lower limits.  This is analogous to using antiderivatives to compute definite integrals.

Use the Calculus > Sum command or press Ctrl+Shift+S to find the antidifference or a definite sum of an expression.  This command allows you to select the summation variable, and if you request a definite sum, the lower limit and upper limit.

Alternatively, the antidifference of the expression u with respect to the variable n can be entered by typing in an expression of the form SUM(u, n).  For example,

SUM(1/2^n, n)

displays using the usual Σ (Sigma) summation notation and simplifies to

   1-n
- 2

The definite sum of the expression u with respect to n from k to m can be entered by typing in an expression of the form SUM(u, n, k, m).  For example,

SUM(1/2^n, n, 1, m)

simplifies to

     -m
1 - 2

To avoid definite sums simplifying to expressions involving the FLOOR function (see Piecewise Continuous Functions), Derive assumes variables occurring in the sums' upper and lower limits are integers.  Therefore, substituting noninteger values for these variables may give incorrect results.

As with antiderivatives, closed-form antidifferences may not exist in terms of the operators and functions known to Derive.  Even when such an antidifference exists, there is no known method that is guaranteed to find it.

Derive uses several techniques that enable it to find the antidifference of a large class of expressions.  These expressions include extended polynomials, products of polynomials with exponentials that are linear in their arguments, some rational expressions, and telescoping sums.

Of course, if the upper and lower limits are actual numbers, the sum can be computed directly without having to find the antidifference.  For example,

SUM(1/k^2, k, 1, 5)

simplifies to 5269/3600 even though a closed-form antidifference does not exist in terms of the elementary math functions.

If the third argument of SUM is a vector, the summation variable ranges over the elements of the vector.  For example,

SUM(k^2, k, [2,3,5,7,11])

simplifies to 208, the sum of the squares of the first five prime numbers.

Finally, if given a single argument which is a vector, SUM returns the sum of the elements.  For example,

SUM([2,3,5,7,11])

simplifies to 28, the sum of the first five prime numbers.

Other Calculus commands


Calculus > Product command

If f and F are functions such that for all n, f(n) = F(n + 1)/F(n), then F(n) is called the antiquotient of f(n).  Using telescoping cancellation, it is easy to see that the product of f(i) from i=m to n is F(n + 1)/F(m).

Thus finding the antiquotient of an expression enables you to determine closed-form definite products of the expression with variable upper or lower limits.  This is analogous to using antiderivatives to compute definite integrals.

Use the Calculus > Product command or press Ctrl+Shift+P to find the antiquotient or a definite product of an expression.  This command allows you to select the index variable, and if you request a definite product, the lower limit and upper limit.

Alternatively, the antiquotient of u with respect to the variable n can be entered by typing in an expression of the form PRODUCT(u, n).  For example,

PRODUCT(n^2, n)

displays using the usual Π (Pi) product notation and simplifies to

      2
(n-1)!

The definite product of the expression u with respect to n from k to m can be entered by typing in an expression of the form PRODUCT(u, n, k, m).  For example,

PRODUCT(n^2, n, 1, m)

simplifies to

  2
m!

Note that the upper case Greek letter for pi ( Π ) used for products is distinct from the lower case Greek letter for pi ( π ) used to denote the ratio of the circumference to the diameter of a circle (3.14159...).

To avoid definite products simplifying to expressions involving the FLOOR function (see Piecewise Continuous Functions), Derive assumes variables occurring in the products' upper and lower limits are integers.  Therefore, substituting noninteger values for these variables may give incorrect results.

As with antiderivatives and antidifferences, closed-form antiquotients may not exist in terms of the operators and functions known to Derive.  Even when such an antiquotient exists, there is no known method that is guaranteed to find it.

Derive uses several techniques that enable it to find the antiquotient of a large class of expressions.  These expressions include monomials, exponentials, products of these, and telescoping products.

Of course, if the upper and lower limits are actual numbers, the product can be computed directly without having to find the antiquotient.  For example,

PRODUCT(k^2+1, k, 1, 5)

simplifies to 44200 even though a closed-form antiquotient does not exist.

If the third argument of PRODUCT is a vector, the index variable ranges over the elements of the vector.  For example,

PRODUCT(k^2, k, [2,3,5,7,11])

simplifies to 5336100, the product of the squares of the first five prime numbers.

Finally, if given a single argument which is a vector, PRODUCT returns the product of the elements.  For example,

PRODUCT([2,3,5,7,11])

simplifies to 2310, the product of the first five prime numbers.

Other Calculus commands


Calculus > Vector command

Use the Calculus > Vector command, press Ctrl+Shift+R, or use the VECTOR function to generate a vector of the values of an expression evaluated at a sequence of points.  The command allows you to select a variable and to enter the starting value, the ending value, and the step size.

Alternatively, an expression of the form VECTOR(u, k, n) simplifies to a vector of n elements generated by simplifying the expression u(k) with the variable k stepping from 1 through n in steps of size 1.  For example,

VECTOR(x^2, x, 5)

simplifies to

[1, 4, 9, 16, 25]

VECTOR(u, k, m, n) simplifies to a vector of n-m+1 elements generated by simplifying the expression u(k) with the variable k stepping from m through n in steps of size 1.  For example,

VECTOR(j!, j, 0, 4)

simplifies to

[1, 1, 2, 6, 24]

VECTOR(u, k, m, n, s) simplifies to a vector of (n-m)/s+1 elements, rounded down, generated by simplifying the expression u(k) with the variable k stepping from m through n in steps of size s.  For example,

VECTOR(SIN(z), z, 0, π/4, 0.2)

approximates to

[0, 0.198669, 0.389418, 0.564642]

If the third argument of VECTOR is a vector or a set, the variable ranges over the elements of the vector or set.  For example,

VECTOR(k^2, k, [2, 3, 5, 7, 11])

simplifies to the squares of the first five prime numbers

[4, 9, 25, 49, 121]

Since a matrix is just a vector of vectors, a nested call on VECTOR can be used to generate a matrix.  For example,

VECTOR(VECTOR(j + k, k, 1, 4), j, 1, 3)

simplifies to the 3 by 4 matrix having elements equal to the sum of their indices

 2  3  4  5

 3  4  5  6

 4  5  6  7

Other Calculus commands


Calculus > Table command

Use the Calculus > Table command, press Ctrl+Shift+A, or use the TABLE function to generate a table (i.e. a matrix) of data values.  The table shows the values of an expression evaluated at a sequence of points.  The command allows you to select a variable and to enter the starting value, the ending value, and the step size.

Alternatively, an expression of the form TABLE(u, k, n) simplifies to a table of n rows and 2 columns generated by simplifying the expression u(k) with the variable k stepping from 1 through n in steps of size 1.  For example,

TABLE(x^2, x, 5)

simplifies to

 1   1

 2   4

 3   9

 4  16

 5  25

If u is a vector of m elements, an expression of the form TABLE(u, k, n) simplifies to a table of n rows and m+1 columns generated by simplifying each of the elements of u with the variable k stepping from 1 through n in steps of size 1.  For example,

TABLE([x^2, x^3, x^4], x, 5)

simplifies to

 1   1   1    1

 2   4   8   16

 3   9  27   81

 4  16  64   256

 5  25  125  625

TABLE(u, k, m, n) simplifies to a table of n-m+1 rows generated by simplifying the expression u(k) with the variable k stepping from m through n in steps of size 1.  For example,

TABLE(j!, j, 0, 4)

simplifies to

 0   1

 1   1

 2   2

 3   6

 4  24

TABLE(u, k, m, n, s) simplifies to a table of (n-m)/s+1 rows, rounded down, generated by simplifying the expression u(k) with the variable k stepping from m through n in steps of size s.  For example,

TABLE([SIN(z), COS(z)], z, 0, π/4, 0.2)

approximates to

  0         0             1

 0.2  0.1986693307  0.9800665778

 0.4  0.3894183423   0.921060994

 0.6  0.5646424733  0.8253356149

If the third argument of TABLE is a vector or a set, the variable ranges over the elements of the vector or set.  For example,

TABLE(k^2, k, [2, 3, 5, 7, 11])

simplifies to a table of the squares of the first five prime numbers

  2   4

  3   9

  5  25

  7  49

 11  121

Other Calculus commands


2D-plot Window Commands

The following are the 2D-plot window commands:

File commands

Embed

Update

Close

Export commands...

Page Setup...

Print Preview

Print...

Exit

Edit commands

Annotation...

Delete Plot

Delete All Plots

Delete Annotation

Delete All Annotations

Copy Plot Window

Mark and Copy...

Insert commands

Plot

Annotation...

Set commands

Coordinate System...

Cross Position...

Plot Region...

Plot Range...

Aspect Ratio...

Options commands

Display > Axes...

Display > Cross...

Display > Grids...

Display > Points...

Display > Plot Color...

Display > Background Color...

Printing > Header and Footer...

Printing > Page Setup...

Printing > Printer Setup...

•	Printing > Black and White Only

•	Trace Plots

•	Follow Cross

•	Simplify Before Plotting

•	Approximate Before Plotting

•	Autoscale New Plots

•	Change Plot Colors

•	Plot Real and Imaginary Parts

Window commands

Cascade

Tile Horizontally

Tile Vertically

Display Tabs

New 2D-plot Window

New 3D-plot Window

•	View Toolbars commands

Help commands

Contents

Index

Frequently Asked Questions

Additional Resources

Link to DERIVE Web Site...

About DERIVE...

Additional 2D-plot window topics

Multiple Plots

Polar Plots

Parametric Plots

Data Matrix Plots

Implicit Plots

Other Help Contents


Plot Window File commands

Use the plot window File commands to embed a new plot object or update an existing plot object in the active worksheet, to close the plot window, to create a graphic image file, to print or preview an image of the plot window, or to exit Derive.

Embed

Update

Close

Export commands...

Page Setup...

Print Preview

Print...

Exit

Other 2D-plot Window Commands

Other 3D-plot Window Commands


File > Embed command

Use the File > Embed command or press Ctrl+B to embed an image of the active plot window as a new plot object in the active worksheet.  The active worksheet is the worksheet of the algebra window associated with the active plot window.

Other Plot Window File commands


File > Update command

Use the File > Update command or press Ctrl+U to update the worksheet plot object associated with the active plot window with an image of the plot window.  If there is no plot object associated with the active plot window, this command is disabled.

Other Plot Window File commands


Plot Window File > Close command
File > Close command

Use the plot window File > Close command to close the active plot window.  If the plot window is associated with an embedded plot in the worksheet and changes have been made to the plot, you will be given the opportunity to update the embedded plot before closing the plot window.

When a plot window is closed, various display and printing options (see the 2D-plot Window Options commands and the 3D-plot Window Options commands) are automatically saved to the DERIVE initialization file.  These settings will be used when subsequent plot windows are created.

Other Plot Window File commands


File > Export commands

Use the File > Export commands to create a graphic image file of the active plot window.  The file can be saved in any one of the following graphic image file formats:

File format	Extension	Description
DIB file	.bmp	The Windows device independent bitmap file format
JPEG file	.jpg	The Internet JPEG file interchange file format
TARGA file	.tga	The Truevision graphics image file format
TIFF file	.tif	The tagged image file format, version 6

The File > Export commands ask you to enter the name for the file using the standard Windows dialog box for saving files.  The standard file name extension for each file format is shown above.  If you do not specify a file name extension, the standard extension name is used.

Other Plot Window File commands


Plot Window Edit commands

Use the plot window Edit commands to edit or delete plots or annotations, or to copy plot window screen images to the Windows clipboard.

Plot... (3D-plot window only)

Annotation...

Delete Plot

Delete All Plots

Delete Annotation

Delete All Annotations

Copy Plot Window

Mark and Copy...

Other 2D-plot Window Commands

Other 3D-plot Window Commands


Edit > Plot command

Use the 3D-plot window's Edit > Plot command to edit the range of the plot parameters, the number of panels, and the color of the selected 3D plot.  If there are multiple 3D plots, click on the desired plot to select it.  The Edit > Plot command uses the same dialog boxes as the 3D-plot window's Insert > Plot command.

There is no Edit > Plot command in 2D-plot windows.

Other Plot Window Edit commands


Plot window Edit > Annotation command
Edit > Annotation command

Use the plot window Edit > Annotation command to edit the selected annotation in the active plot window.  Click on the desired annotation to select it.  This command displays the same dialog box as the Insert > Annotation command of the current plot window.  For details, see the 2D-plot window's Insert > Annotation command or the 3D-plot window's Insert > Annotation command.

Other Plot Window Edit commands


Edit > Delete Plot command

Use the 3D-plot window Edit > Delete Plot command, click on the [image] icon on the command toolbar, or press the Del key to delete the selected plot in the active plot window.  If there are multiple plots, click on the desired plot to select it for deletion.

Use the 2D-plot window Edit > Delete Plot command to delete plots in the active plot window.  This command provides the following options:

•	Click on the First option to delete the plot that was plotted first.

•	Click on the Last option, click on the [image] icon on the command toolbar, or press the Del key to delete the plot that was plotted last.

•	Click on the Butlast option to delete all but the plot that was plotted last.

Note that deleting a plot of an expression in a plot window does not delete the expression in the worksheet.  Similarly, deleting an expression from a worksheet does not delete a plot of the expression in a plot window.

Other Plot Window Edit commands


Edit > Delete All Plots command

Use the Edit > Delete All Plots command or press Ctrl+D to delete all the plots in the active plot window.

Other Plot Window Edit commands


Edit > Delete Annotation command

Use the Edit > Delete Annotation command to delete the selected annotation in the active plot window.  Before issuing this command, click on the annotation to be deleted.  The Edit > Delete Annotation command presents a dialog box to confirm that you want to delete the annotation.  Click on the Yes button to delete it; click on the No button to abort the command without deleting any annotation.

Other Plot Window Edit commands


Edit > Delete All Annotations command

Use the Edit > Delete All Annotations command to delete all the annotations in the plot window.  The command presents a dialog box to confirm that you want to delete all the annotations.  Click on the Yes button to delete all of them; click on the No button to abort the command without deleting any annotation.

Other Plot Window Edit commands


Edit > Copy Plot Window command

Use the Edit Copy Window menu command, Ctrl+C, or [image] to copy the contents of the plot window in bitmap format to the Windows clipboard.  Once this image is in the clipboard it can be pasted into various word-processing or graphics programs.

If you want to copy a user-defined rectangular region of a plot window to the Windows clipboard use the Edit > Mark and Copy command.

Other Plot Window Edit commands


2D-plot Window Insert commands

Use the following Insert commands to add new plots and annotations to the 2D-plot window:

Plot

Annotation...

Other 2D-plot Window Commands


2D Insert > Plot command
Insert > Plot command

Use the 2D-plot window Insert > Plot command, click on the [image] icon on the command toolbar, or press the F4 key to plot the expression highlighted in the algebra window associated with the active 2D-plot window.  The PLOT2D.MTH and PLOTPARA.MTH files distributed with Derive include numerous examples of interesting expressions to plot in a 2D-plot window.

The Plot command will be available only if there is a highlighted expression in the algebra window.  The highlighted expression will be plotted using the next plot color (see the Options > Display > Plot Color command).  If you wish to stop the plotting before completion, press the Esc key.

Derive ’s 2D-plot window is used for plotting the following types of expressions and equations generated in an algebra window:

•	univariate expressions;

•	equations of the form y = u, where y is a variable (other than x) and u is a univariate expression in another variable; and

•	equations of the form u = v, where u and v are expressions of at most two variables (see Implicit Plots).

If the result of issuing the Plot command is the message

Too many variables for this plot window

then modify the highlighted expression so that it conforms to one of the above expression types.

If the result of issuing the Plot command is the message

Sorry, the highlighted expression cannot be plotted

then Derive’s plotting algorithm is unable to plot the expression.

For more information about specific types of 2D-plotting see:

Multiple Plots

Polar Plots

Parametric Plots

Data Matrix Plots

Implicit Plots

Other 2D-plot Window Insert commands


2D Insert > Annotation command
Insert > Annotation command

Use the 2D-plot window’s Insert > Annotation command, click on the [image] icon on the command toolbar, or press the F12 key to insert a new annotation the active plot window.  The command's dialog box displays the following:

•	In the Text field enter the desired text for the annotation.  Press Ctrl+Enter to move the cursor down a line and make a multi-line annotation.  Characters on the Greek and math symbol toolbars can be entered by clicking on them.

•	Click on the Font button to change the font type, style, and size used to display the text.

•	Click on the Color button to change the color used to display the text.

•	In the Horizontal and Vertical fields enter the desired coordinates for the annotation.  The default is the current coordinates of the cross.  Annotation text will be left-justified on the horizontal coordinate and centered on the vertical coordinate.

Use the Edit > Annotation command to edit an annotation.  Use the Edit > Delete Annotation command to delete an annotation.

Other 2D-plot Window Insert commands


2D-plot Window Set commands

Use the following 2D-plot window Set commands to examine and/or change the coordinate system, cross position, and the plot region, range, and aspect ratio:

Coordinate System...

Cross Position...

Plot Region...

Plot Range...

Aspect Ratio...

Other 2D-plot Window Commands


2D Set > Coordinate System command
Set > Coordinate System command

The 2D-plot window coordinate system setting plays an important role in the plotting of expressions and displaying of coordinates.  Use the 2D-plot window Set > Coordinate System command or press Ctrl+Y to select the coordinate system used to display cross coordinates and to plot expressions.  The command presents a dialog box with the following fields:

•	Rectangular:  Click on this button to have subsequent expressions plotted using rectangular coordinates.  In rectangular coordinates the [image] icon is displayed at the left end of the plot window status bar.

•	Polar:  Click on this button to have subsequent expressions plotted using polar coordinates.  In polar coordinates the [image] icon is displayed at the left end of the plot window status bar.  See Polar Plots for more information.

The following summarizes how 2D-plots of expressions, equations, and 2-element vectors are interpreted in rectangular and polar coordinates:

Rectangular coordinates:

If the expression u(t) is plotted and t is a variable other than y, Derive interprets t as a horizontal distance to the right of the y-axis and u(t) as the corresponding vertical distance above the x-axis.  Whereas, if u(y) is plotted, Derive interprets y as a vertical distance above the x-axis and u(y) as the corresponding horizontal distance to the right of the y-axis.

If the equation s=u(t) is plotted and s is a variable other than x, Derive interprets t as a horizontal distance to the right of the y-axis and u(t) as the corresponding vertical distance above the x-axis.  Whereas, if x=u(t) is plotted, Derive interprets t as a vertical distance above the x-axis and u(t) as the corresponding horizontal distance to the right of the y-axis.

If the vector [x(t), y(t)] is plotted, Derive interprets the expression x(t) as a horizontal distance to the right of the y-axis and the expression y(t) as the corresponding vertical distance above the x-axis.  For more information see Parametric Plots.

Polar coordinates:

If the expression u(t) is plotted and t is a variable other than r, Derive interprets t as an angle measured counterclockwise from the positive x-axis and u(t) as the corresponding radial distance from the origin.  Whereas, if u(r) is plotted, Derive interprets r as a radial distance from the origin and u(r) as the corresponding angle measured counterclockwise from the positive x-axis.

If the equation s=u(t) is plotted and s is a variable other than θ, Derive interprets t as an angle measured counterclockwise from the positive x-axis and u(t) as the corresponding radial distance from the origin.  Whereas, if θ=u(t) is plotted, Derive interprets t as a radial distance from the origin and u(t) as the corresponding angle measured counterclockwise from the positive x-axis.

If the vector [r(t), θ(t)] is plotted, Derive interprets the expression θ(t) as an angle measured counterclockwise from the positive x-axis and r(t) as the corresponding radial distance from the origin.  For more information see Parametric Plots.

Angles are measured in radians or degrees depending on the angle mode set by the Angular Unit field of the algebra window’s Declare > Simplification Settings command.  Negative distances plot in the opposite direction of positive ones.

Other 2D-plot Window Set commands


Set > Cross Position command

Use the Set > Cross command, click on the desired location, press Ctrl+E, or use the direction keys to move the cross in the 2D-plot window.  The current cross coordinates are displayed at the left end of the 2D-plot window status bar.  If the cross is moved outside the plot region and the Options > Follow Cross command is checked, the region will be scrolled as necessary to include the cross.

The Set > Cross command dialog box provides the following options:

•	Click the Center button to set the coordinates in the Horizontal and Vertical fields to those at the center of the window.

•	Click the Origin button to set the coordinates in the Horizontal and Vertical fields to that of the origin.

•	In the Horizontal field, enter the desired horizontal coordinate for the cross.

•	In the Vertical field, enter the desired vertical coordinate for the cross.

To position the cross using the mouse, click at the desired location in the 2D-plot window.  You can also move the cross using the direction keys as follows:

•	Up arrow moves the cross up one pixel.

•	Down arrow moves the cross down one pixel.

•	Left arrow move the cross left one pixel.

•	Right arrow moves the cross right one pixel.

•	PgUp or Ctrl-Up arrow moves the cross up half a tick mark.

•	PgDn or Ctrl-Down arrow moves the cross down half a tick mark.

•	Ctrl-Left arrow moves the cross left half a tick mark.

•	Ctrl-Right arrow moves the cross right half a tick mark.

•	Home moves the cross to the center of the plot region.

Other 2D-plot Window Set commands


2D Set > Plot Region command
Set > Plot Region command

Use the 2D-plot window Set > Plot Region command or press Ctrl+N to examine and/or set the plot region parameters.  The dialog box displays the current horizontal and vertical lengths and center coordinates of the plot region, as well as the number of grid intervals in both directions.  You have the opportunity to enter new plot region parameters.  The number of grid intervals should be a positive integer.

After you enter new plot region parameters, press OK to accept the new values.  The plot window will be redrawn and all expressions replotted.  Press Reset to restore the default plot region parameters (i.e. 8 for the lengths, 0 for the center coordinates, and 1 for the scales).  Press Cancel to cancel the command and make no changes to the plot region.

You can also use icons on the command toolbar to change the center of the plot region as follows:

•	Click on the [image] icon to center the plot region on the cross.

•	Click on the [image] icon to center the plot region on the origin.

You can also change the lengths of the plot region using the zoom commands on the plot window’s command toolbar or by the function keys.  Zooming in magnifies details by displaying a smaller portion of the curve.  Zooming out shrinks details by displaying a larger portion of the curve.  You can zoom in the horizontal direction, the vertical direction, or both directions at once.  When you zoom in or out, the length of the plot region is changed to the next closest number in the sequence: ... 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20 ... .

Use the following command toolbar icons or function keys to zoom the plot region out (i.e. to increase the plot range):

•	Click on the [image] icon or press the F10 key to zoom both directions out.

•	Click on the [image] icon or press the F8 key to zoom the vertical direction out.

•	Click on the [image] icon or press the F6 key to zoom the horizontal direction out.

Use the following command toolbar icons or function keys to zoom the plot region in (i.e. to decrease the plot range):

•	Click on the [image] icon or press the F9 key to zoom both directions in.

•	Click on the [image] icon or press the F7 key to zoom the vertical direction in.

•	Click on the [image] icon or press the F5 key to zoom the horizontal direction in.

The horizontal scale of the plot region is the number of units between tick marks on the horizontal axis.  The horizontal scale equals the horizontal length of the plot region divided by the number of grid intervals in the horizontal direction.  Thus, to change the horizontal scale to a particular value, you can use the Set > Plot Region command to set the horizontal plot length equal to the desired scale times the desired number of grid intervals.  For example, to have a scale of 5 units per tick mark with 12 grid intervals, set the plot length to 60 and the number of intervals to 12.  Similar remarks apply to setting the vertical scale using the Set > Plot Region command.

The center coordinates and scales of the plot region are continuously displayed on the 2D-plot window’s status bar.

Other 2D-plot Window Set commands


2D Set > Plot Range command
Set > Plot Range command

Use the 2D-plot window Set > Plot Range command or press Ctrl+R to examine and/or set the plot range parameters.  The dialog box displays the current horizontal and vertical minimum and maximum values of the plot range, as well as the number of grid intervals in both directions.  You have the opportunity to enter new plot range parameters.  The number of grid intervals should be a positive integer.

Alternatively, click on the [image] icon on the command toolbar to specify the plot range with the mouse by means of a range box.  The mouse pointer will change into a large cross.  Move the mouse cross to the desired upper left corner of the plot range, then hold down the left mouse button and move the mouse cross to the desired lower right corner of the plot range and release the mouse button.  The new plot range parameters will be displayed in the dialog box for you to accept or edit.

After you enter new plot range parameters, press OK to accept the new values.  The plot window will be redrawn and all expressions replotted.  Press Reset to restore the default plot range parameters (i.e. -4 for the minimums, 4 for the maximums, and 8 for the intervals).  Press Cancel to cancel the command and make no changes to the plot range.

You can also change the plot range parameters using the zoom commands on the plot window’s command toolbar or by the function keys (see the Set > Plot Region command for details).

The horizontal scale of the plot region is the number of units between tick marks on the horizontal axis.  The horizontal scale equals the horizontal length of the plot region divided by the number of grid intervals in the horizontal direction.  Thus, to change the horizontal scale to a particular value, you can use the Set > Plot Range command to set the horizontal plot length (i.e. the difference between the horizontal maximum and minimum values) equal to the desired scale times the desired number of grid intervals.  For example, to have a scale of 5 units per tick mark with 12 grid intervals, set the minimum value to -30, the maximum value to 30, and the number of intervals to 12.  Similar remarks apply to setting the vertical scale using the Set > Plot Range command.

Note that the center coordinates and scales of the plot region are continuously displayed on the 2D-plot window’s status bar.

Other 2D-plot Window Set commands


2D Set > Aspect Ratio command
Set > Aspect Ratio command

Use the 2D-plot window Set > Aspect Ratio command or press Ctrl+A to examine and/or change the aspect ratio of the plot window.  The aspect ratio of a 2D-plot window is the ratio of its horizontal to vertical physical screen length in pixels.  The command's dialog box provides two fields for entering integers so the ratio of its horizontal and vertical lengths can be specified.

Press the OK button to reduce the plot window in size as necessary to give it the desired aspect ratio.  Press the Cancel button to abort the command.  Press the Reset button to set an aspect ratio such that the horizontal distance between tick marks is the same as the vertical distance.

Sometimes it is desirable to make the horizontal scale of a plot window the same as the vertical scale.  For example, you may want the equation for a circle

x^2 + y^2 = 4

to plot like a circle instead of an ellipse.  Making the horizontal and vertical scales the same can be accomplished in two steps as follows:

•	First use the Set > Plot Region command to set the horizontal length equal to the number of horizontal intervals, and the vertical length equal to the number of vertical intervals.  For example, if the horizontal length of the Derive window is longer than the vertical length, you might want to set the horizontal length and intervals to 16, and the vertical length and intervals to 8.

•	Then issue the Set > Aspect Ratio command, and click on the Reset button and the OK button to make the physical distance between horizontal and vertical tick marks the same.

When a 2D-plot object is embedded in an algebra window worksheet using the File > Embed command, the aspect ratio of the 2D-plot object will be the same as that of the 2D-plot window.  However, the aspect ratio of the 2D-plot object can be distorted if the object is resized in the algebra window.  To restore the original aspect ratio, double click on the 2D-plot object to reactivate the plot window, and then use the File > Update command to update the aspect ratio of the 2D-plot object to that of the 2D-plot window.

Other 2D-plot Window Set commands


2D-plot Window Options commands

Use the following Options > Display commands to control 2D-plot window display options:

Axes...

Cross...

Grids...

Points...

Plot Color...

Background Color...

Use the following Options > Printing commands to control the printing of the 2D-plot window:

Header and Footer...

Page Setup...

Printer Setup...

•	Black and White Only

Use the following Options commands to toggle on and off various parameters of the 2D-plot window:

•	Trace Plots

•	Follow Cross

•	Simplify Before Plotting

•	Approximate Before Plotting

•	Autoscale New Plots

•	Change Plot Colors

•	Plot Real and Imaginary Parts

Other 2D-plot Window Commands


Options > Display > Axes command

Use the Options > Display > Axes command to control the display of axes lines, labels, and titles in the 2D-plot window.  Axes labels are the numbered tick marks displayed along the axes.  The display of the axes lines and labels can be turned on or off.  The default initial setting is to have the axes lines and labels turned on.  The titles of the axes are displayed at the positive ends of the axes.  The default initial titles of the horizontal and vertical axes are x and y, respectively.

The Options > Display > Axes command dialog box displays the following fields:

Lines:

•	Click the On button to turn on the display of the axes lines.

•	Click the Off button to turn off the display of the axes lines.

•	Click the Color button to select the color of the axes lines.

Labels:

•	Click the On button to turn on the display of the axes labels.  As many labels as possible are put on the axes lines, using scientific notation where appropriate.

•	Click the Off button to turn off the display of the axes labels.

•	Click the Color button to select the color of the axes labels.

•	In the Horizontal scale factor field, enter the scale factor for the horizontal axis.  The default horizontal axis scale factor is 1.

•	In the Vertical scale factor field, enter the scale factor for the horizontal axis.  The default vertical axis scale factor is 1.

Titles:

•	In the Horizontal axis field, enter the title for the horizontal axis.  Leave this field blank if no title is desired.  The default initial horizontal axis title is x.

•	In the Vertical axis field, enter the title for the vertical axis.  Leave this field blank if no title is desired.  The default initial vertical axis title is y.

•	Click the Color button to select the color of the axes titles.

(The underlined button name in a field indicates the default initial setting.)

The axis scale factors make it possible to display axis labels in a unit appropriate for the expression being plotted.  For example, when plotting trigonometric functions, it is often convenient to make the horizontal axis labels multiples of π.  To do this, use the Options > Display > Axes command to set the horizontal axes scale factor to π by clicking on it in the Greek symbol toolbar.  Then click on the [image] icon or press the F6 key to obtain simple multiples of π.

Other 2D-plot Window Options commands


Options > Display > Cross command

Use the Options > Display > Cross command to turn on or off the display of the cross (+) in the 2D-plot window and to select its color.  This command’s dialog box provides the following options:

•	Click the On button to turn on the display of the cross.

•	Click the Off button to turn off the display of the cross.

•	Click the Color button to select the color of the cross.

Even if the cross display is turned off, its coordinates are displayed in the status bar and it can still be moved using the Set > Cross Position command.

(The underlined button name in a field indicates the default initial setting.)

Other 2D-plot Window Options commands


Options > Display > Grids command

Use the Options > Display > Grids command to control the number and appearance of vertical and horizontal intervals (grids) displayed in the 2D-plot window.

The Options > Display > Grids command dialog box displays the following fields:

Display:

•	Click the Lines button to turn on the display of grid lines.

•	Click the Points button to display points at the intersection of grid lines.

•	Click the Off button to turn off the display of grid points and lines.

•	Click the Color button to select the color of grid lines.

Intervals:

•	In the Horizontal field, enter the number of horizontal grid lines.  The default initial setting is 8.

•	In the Vertical field, enter the number of vertical grid lines.  The default initial setting is 8.

(The underlined button name in a field indicates the default initial setting.)

Other 2D-plot Window Options commands


Options > Display > Points command

Use the Options > Display > Points command to control the plotting characteristics of data points.  Only subsequent data point plots will be affected by these settings.

The Options > Display > Points command dialog box displays the following fields:

Connect:

•	Click the Yes button to connect the data points of data matrix plots with line segments.

•	Click the No button to not connect the data points of data matrix plots with line segments.

Size:

•	Click the Small button to display a data point as a 1 pixel rectangle.

•	Click the Medium button to display a data point as a 3 by 3 pixel filled rectangle.

•	Click the Large button to display a data point as a 5 by 5 pixel filled rectangle.

(The underlined button name in a field indicates the default initial setting.)

Other 2D-plot Window Options commands


Options > Display > Plot Color command

Use the Options > Display > Plot Color command to select the color of the next plot.  If not automatically changing plot colors, the selected color is used for subsequent plots as well.  Use the Options > Change Plot Colors command to toggle on or off the automatic changing of plot colors.

Other 2D-plot Window Options commands


Options > Printing > Black and White Only command

Click on the Options > Printing > Black and White Only command to toggle on or off the printing of plots in black on a white background.  Choose this option if you’re printing to a non-color printer.  Turn this option off if you’re using a color printer and wish to print the plot colors as viewed on the screen.  Note that not all the colors used in the 2D-plot window may be supported on every color printer; in this case the nearest color will be used.

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


2D-plot window Options > Trace Plots command
Options > Trace Plots command

Click on the Options > Trace Plots command or press the F3 key to toggle on or off plot trace mode.

If you move the cross to a location that appears to be "on" a plot, it may be near but not quite on the plot.  To more accurately display the coordinate values of a specific point on the plot, turn on trace mode.  If trace mode is on, the cross is confined to moving along (or tracing) the plot from point to point while displaying the corresponding coordinate values in the status bar.

When you switch to trace mode the cross will move up or down to the plot line at the current x coordinate.  In trace mode the cross displays as a small square unfilled box, whose center lies on the plot line.  The expression number of the plot being traced is displayed in the 2D-plot window title bar.  This makes trace mode useful for distinguishing plot lines when plotting multiple expressions (see Multiple Plots).

Once in trace mode, use the direction keys or the mouse to move the box along the plot as follows:

•	Left arrow or click the right mouse button and choose Move left one unit to move the box left one pixel and up or down as necessary to stay on the plot.

•	Right arrow or click the right mouse button and choose Move right one unit to move the box right one pixel and up or down as necessary to stay on the plot.

•	Ctrl-Left arrow or click the right mouse button and choose Move left multiple units to move the box left half a tick mark and up or down as necessary to stay on the plot.

•	Ctrl-Right arrow or click the right mouse button and choose Move right multiple units to move the box right half a tick mark and up or down as necessary to stay on the plot.

The Up arrow and Down arrow keys as well as the mouse can be used to trace another plot line in a 2D-plot window with multiple expressions plotted (see Multiple Plots).

Alternatively, the trace box may be moved to a specific plot value using the mouse.  Simply click the left mouse button at the desired x coordinate to move the box to the corresponding plot value at that coordinate.

In trace mode the Set > Cross Position command moves the box to the point specified by the horizontal and vertical cross coordinates, regardless of whether this point is on the plot line.  To move the box back to the plot line and continue tracing use the direction keys or the mouse as explained previously.

When trace mode is turned off the cross will return to its original shape and the cross direction keys to their original use.

All 2D plots may be traced except for data matrix (see Data Matrix Plots) and implicit plots (see Implicit Plots).  See Polar Plots for specifics about tracing in polar coordinates.  If you try to turn on trace mode, hear an error beep and the cross does not move to the plot line, either there is no explicit plot to trace or the expression is not real and finite at the cross’s current x coordinate.  Move the cross left or right to where the expression is real and finite and try again to switch to trace mode.

Tracing a plot is especially helpful in visually locating intercepts and minimum and maximum expression values.  If, while tracing along a plot, you encounter a point at which the expression does not have a finite real value, the message

Tracing expression #n, not real and finite!

is displayed in the 2D-plot window title bar and a warning error beep occurs.  This makes tracing useful for locating removable singularities that may not be apparent on the plot.  If you continue moving the cross, the message will remain until the expression has a finite, real value.

When tracing a plot, it may be advantageous to turn on follow cross mode using the Options > Follow Cross command.  If follow cross mode is off and you trace to a point on the plot that extends past the window borders the cross will disappear from sight.  However, the coordinate values of the cross will continue to be updated in the status bar.  If follow cross mode is on while you are tracing a plot, the window will be scrolled to follow the cross as it moves outside the 2D-plot window.

Other 2D-plot Window Options commands


Options > Follow Cross command

Click on the Options > Follow Cross command to toggle on or off follow cross mode.

If you are interested in a part of the plot not visible in the 2D-plot window, you may want to turn on follow cross mode.  In this mode, the window "follows" the cross when it is moved outside the window borders.  You can move the cross outside the window borders by using the Set > Cross Position, Set > Plot Region, or Set > Plot Range commands, or by pressing the arrow direction keys.

In follow cross mode, if the cross is moved just outside a window border, the window will be scrolled by 1/3 of the window dimension in the appropriate direction.  If the cross is moved far from any window border, the window will be centered on the new cross position.

Other 2D-plot Window Options commands


Options > Simplify Before Plotting command

Click on the Options > Simplify Before Plotting command to toggle on or off the automatic simplification of expressions before plotting them.

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Approximate Before Plotting command

Click on the Options > Approximate Before Plotting command to toggle on or off the automatic approximation of expressions before plotting them.

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Autoscale New Plots command

Click on the Options > Autoscale New Plots command to toggle on or off the automatic autoscaling of new plots.

Autoscaling is helpful to frame a plot so it lies within the plot region.  If automatic scaling is on, before an expression is plotted, it is evaluated at several sample points to estimate the range of values the expression assumes over the horizontal plot interval.  This estimate is then used to adjust the vertical length and center of the plot region so that the plot is properly framed.  Note that:

•	Some parts of an autoscaled plot may lie outside the vertical plot region because only a sampling of data points is taken.

•	Autoscaling adjusts both the vertical length and center of the plot region in order to autoscale the plot.

•	Autoscaling does not adjust the horizontal plot range.

Other 2D-plot Window Options commands

Other 3D-plot Window Options commands


Options > Change Plot Colors command

Click on the Options > Change Plot Colors command to toggle on or off the automatic changing of the plot color for each new plot.

If automatically changing plot colors, the colors cycle through the array of colors defined in the system default palette, skipping the current plot window background color.  If not automatically changing plot colors, the color of the next plot is that color selected by the Options > Display > Plot Color command.

Other 2D-plot Window Options commands


Options > Plot Real and Imaginary Parts command

Click on the Options > Plot Real and Imaginary Parts command to toggle on or off the simultaneous plotting of the real and imaginary parts of an expression dependent on a single real-valued variable.  If this option is on, the imaginary part is plotted in the same color as the real part, but using a bolder line.  If this option is off, only real values of expressions are plotted; complex values are not plotted.  For example, plot

ASIN(x)

with plot real and imaginary parts mode turned off, and then again with it turned on.

If complex intermediate values occur while approximating a real-valued expression, round-off errors can introduce a spurious imaginary component in the result.  If this phenomenon occurs while plotting a real-valued expression, turn plot real and imaginary parts mode on so the real-values of the expression can be plotted, and the small relative size of the imaginary component can be confirmed.  For example, with both the Simplify Before Plotting and the Approximate Before Plotting modes turned off, plot

SIN(ASIN(x))

with plot real and imaginary parts mode turned off, and then again with it turned on.

Other 2D-plot Window Options commands


Multiple Plots

To plot multiple expressions in the same 2D-plot window simply change the highlighted expression in the algebra window, switch to the 2D-plot window and issue a Insert > Plot command for each expression to be plotted.

A vector of two expressions will be plotted as a parametric plot (see Parametric Plots).  However, if a vector of three or more expressions is highlighted, the Insert > Plot command plots each element of the vector.

Use the Author > Vector command to type in a vector of new expressions.  Alternatively, use the Calculus > Vector command to generate a vector of an expression evaluated at a sequence of points.  For example,

VECTOR(x^k, k, 0, 2, 1/4)

simplifies to

    1/4   1/2   3/4      5/4   3/2   7/4   2
1, x   , x   , x   , x, x   , x   , x   , x

and plots as a family of curves in the 2D-plot window.

Note that multiple plots all share the same plot scale and range.  Therefore, you may have to zoom out and/or move the center of the 2D-plot window to see all of the plot lines simultaneously.  Also, you can press the Esc key to stop any subsequent plots from being plotted in the 2D-plot window.

To move a plot line relative to the others, add an offset to the corresponding expression in the algebra window.  To magnify or shrink a plot line relative to the others, multiply the corresponding expression by a scaling factor in the algebra window.  Sometimes it is advisable both to shift and scale plot lines in order to optimally frame several of them in a single window.  Or, instead of individually scaling expressions, expressions may be plotted in multiple plot windows, each with their own scales (see the Window > New 2D-plot Window command).

To compare coordinate values of multiple plot lines you may want to turn on trace mode using the Options > Trace Plots command.  When you switch on trace mode the cross (displayed as a small box) will move to the plot line of the last expression in the list at the current x coordinate.  You may then use the mouse or right and left arrow keys as described previously to trace along the plot.  To trace another plot line use mouse or the up and down arrow keys as follows:

•	Up arrow  or click the right mouse button and choose Trace previous plot to move the box to the previous expression’s plot line.

•	Down arrow or click the right mouse button and choose Trace next plot to move the box to the next expression’s plot line.

In trace mode the number of the expression being traced is displayed in the 2D-plot window title bar.  Thus when plotting several expressions, trace mode is a good way to determine the correlation between plot line and expression.

Use the Options > Display > Plot Color command to customize the colors used for multiple plot lines.

A particular plot line may be deleted by using the Edit > Delete Plot command.

Whenever a 2D-plot window changes size, all plots currently contained in that plot window will be recalculated and subsequently replotted.

If it takes too long to regenerate the plots while resizing a plot window using the sizing handles, you can turn off the Show Window Contents While Dragging feature of Windows.  When this feature is on, a window’s contents is displayed while it is moved or resized.  When this feature is off, only an outline of a window is displayed while it is moved or resized.  So, turning this feature off allows the plot window to be resized before any plots are regenerated.

To toggle this feature on or off, run the Window’s Control Panel Display program.  If running Windows 98, click on the Effects tab of the dialog box.  If running Windows NT or Windows 95 with Microsoft Plus!, click on the Plus! tab.  Finally click on the Show Window Contents While Dragging check box to toggle the feature on or off.

Related topics:

Insert > Plot command

2D-plot Window Commands


Polar Plots

To make polar plots of expressions use the Set > Coordinate System command to select the polar coordinate system.  See the on-line help for that command for a summary of how plots of expressions and equations are interpreted in polar coordinates.

In polar coordinates the 2D-plot window's Insert > Plot command prompts you to enter information into the Parametric Plot Parameters dialog box.

In polar coordinates the position of the cross is displayed in polar coordinates on the status bar.  The radial distance of the cross from the origin is the first coordinate.  The angle of the cross, represented in either radians or degrees depending on the angle mode, is measured counterclockwise from the positive x-axis and is the second coordinate.

Trace mode is available in both rectangular and polar coordinates.  When you start tracing in polar coordinates, the cross goes to the midpoint of the parameter range.  The midpoint of the parameter range is calculated from the value in the Points field when plotted in discrete mode.  The midpoint of a continuous plot is calculated from the current value in the Points field.

When tracing plots in polar coordinates, the 2D-plot window title bar shows a message of the form

Tracing expression #n, at t = x.xxxxxxx

where n is the number of the expression being traced and x.xxxxxxx is the parameter value at the box location.

For tracing purposes, the angular range of the polar plot is divided into equally spaced points.  The number of points is 10 times the number of points entered in the Parametric Plot Parameters  dialog box.  When tracing a polar plot, use the direction keys or mouse to move the box along the plot as follows:

•	Left arrow  or click the right mouse button and choose Move left one unit to decrease the parameter value to move the box the distance of one point along the plot.

•	Right arrow or click the right mouse button and choose Move right one unit to increase the parameter value to move the box the distance of one point along the plot.

•	Ctrl+Left arrow or click the right mouse button and choose Move left multiple units to decrease the parameter value to move the box the distance of ten points along the plot.

•	Ctrl+Right arrow or click the right mouse button and choose Move right multiple units to increase the parameter value to move the box the distance of ten points along the plot.

The Up arrow and Down arrow keys as well as the mouse can be used to trace another rectangular or polar plot line in a 2D-plot window with multiple expressions plotted (see Multiple Plots ).

Alternatively, the trace box may be moved to a specific location using the mouse.  Simply click the left mouse button at the desired angular coordinate to move the box to the corresponding plot value at that coordinate.

The polar plot line only spans expression values from the minimum parameter to the maximum parameter specified.  When tracing a polar plot, the box can be moved off the edge of the plot line in order to visualize the shape of the plot if the parameter range were extended.

Related topics:

Insert > Plot command

2D-plot Window Commands


Parametric Plots

A parametric plot results from plotting a vector of two univariate expressions dependent on the same variable.  In rectangular coordinates the value of the first expression is the x-coordinate, and the value of the second expression is the y-coordinate.  In polar coordinates the value of the first expression is the radial distance from the origin.  The value of the second expression is the angle, represented in either radians or degrees depending on the angle mode (see Angular Unit field), and measured counterclockwise from the positive x-axis.

When plotting a parametric plot the 2D-plot window's Insert > Plot command prompts you to enter information into the Parametric Plot Parameters dialog box.

When making a continuous parametric plot, the parameter interval is recursively subdivided until the curve can be accurately approximated by a straight line.  This may take an unacceptably long time if subdividing the curve is outside the window or in the neighborhood of a singularity.  If this occurs, use the Edit > Delete Plot command to delete the continuous plot and replot the parametric expressions using the Parametric Plot Parameters dialog box to select discrete points.

Since parametric plots are done in a standard 2D-plot window, you can zoom, move the cross, and plot any mixture of expressions as described previously.  Tracing a parametric plot works in the same way as tracing a polar plot (see Polar Plots).

For a collection of parametric expressions that are interesting to plot, load the file PLOTPARA.MTH using the File > Load > Math File command.

Functions for plotting parametrically defined space curves such as helixes are defined in GRAPHICS.MTH - Plotting Space Curves & Complex Functions.

Related topics:

Insert > Plot command

2D-plot Window Commands


Data Matrix Plots

A data point is parametrically represented as a vector of two numbers.  For example, [2, 3] is the point whose x-coordinate is 2 and whose y-coordinate is 3.

A data point plots as a single point.  Since there is no parameter, the Insert > Plot command does not prompt for parametric plot parameters as it does for other parametric plots.  Note that in polar coordinates (see Polar Plots ) data points are plotted in polar coordinates.

A data matrix is a vector of data points.  When a data matrix is plotted, each point is plotted individually, making it convenient to plot a collection of data points.  For example,

[[2, 2], [2, -2], [-2, -2], [-2, 2]]

plots as 4 data points in a square.

Use the Options > Display > Points command to set the size (small, medium, or large) of data points, and to turn on or off the option to connect successive data points with line segments.  For example, if the option to connect successive data points is on

[[2, 2], [2, -2], [-2, -2], [-2, 2]]

plots as an open box.

Enter an expression of the form VECTOR([x, u], x, a, b, s ) to generate a data matrix for u (x) as x goes from a to b in steps of size s.  For example,

VECTOR([x, x!], x, 0, 5)

simplifies to a data matrix of factorials.

If, instead of both being numbers, any of the coordinate pairs depends upon the same one variable, then that pair is plotted parametrically after prompting for the parametric plot parameters.

Related topics:

Insert > Plot command

2D-plot Window Commands


Implicit Plots

Functions implicitly defined by an equation may be plotted using a relatively efficient algorithm of linear interpolation upon triangles.  As described in the 2D-plot window Insert > Plot command, the form of an implicitly defined equation is u = v, where u and v are expressions of at most two variables.  Examples of such equations are

 2    2
x  + y  = 4

 3    2
x  = y  - 5

x = 3

and

 2
r  + cos(θ) = 0

To produce an implicit plot in rectangular coordinates, the variables in the equation are assigned to the horizontal and vertical axes.  Usually, the primary variable is assigned to the horizontal axis, the secondary variable to the vertical axis (see Ordering Variables in Expressions).  If the equation contains only one variable, it will normally be assigned to the vertical axis.  However, if the variable is x, as in the third equation above, x will be assigned to the horizontal axis.  In general, if an equation contains the variable x, the equation will always be plotted with x assigned to the horizontal axis.  Thus, for implicit plotting in rectangular coordinates we recommend using x for the horizontal and y for the vertical coordinate.

To produce an implicit plot in polar coordinates, the angle and the distance from the origin are assigned to variables in the equation.  Usually, the primary variable is assigned to the angle, the secondary variable to the distance from the origin.  However, if one of the variables in the equation is a Greek letter, it is assigned to the angle.  For implicit plotting in polar mode we recommend using r for the distance from the origin and θ for the angle.

The implicit plotting algorithm starts in the top left corner of the 2D-plot window, plotting points in a top to bottom, left to right fashion.  Unlike most explicit plots, implicit plots may not be automatically scaled; nor may an implicit plot line be traced.

Explicit plots are faster and more accurate than implicit plots.  Before plotting, when possible, Derive automatically converts a function implicitly defined by an equation into a function explicitly defined by an equation of the form y = u where y is a variable and u is a univariate expression in another variable.  For example, the linear equation

2x + 3y = 6

is transformed into the equation

y = —2/3x + 2

and then plotted using the more expeditious explicit plotting algorithm.

A function implicitly defined by an equation may be solved for one of its variables in terms of the other by using the algebra window’s Solve > Expression command to generate explicit solutions.  If explicit solutions of the equation are achievable, explicit plots of these solutions may be superimposed in a 2D-plot window.

An alternate method for generating explicit solutions for implicitly defined equations is to substitute polar coordinates for the variables and solve for the distance from the origin in terms of the angle. For example,

 5    4    5    4
x  + x  = y  + y

cannot be solved exactly for either x or y.  However, substituting r cos(θ) for x and r sin(θ) for y, then solving for r gives the two explicit solutions

r = 0

and

                   2
       1 - 2 COS(θ)
r = ———————————————————
           5         5
     COS(θ)  - SIN(θ)

These explicit solutions may then be plotted in polar coordinates in the 2D-plot window.

Implicit 2D plots of a family of plot lines can be used to make contour plots of functions of two variables.  In a 2D-plot window after issuing the Options > Simplify Before Plotting command, plotting an expression of the form

VECTOR (z = u, z, m, n, s)

produces a contour plot of the function z = u where u is a function of x and y as z varies from m to n in steps of size s.  For example, the function

z = 10/(2^2+(x-2)^2+y^2) + 10/(2^2+(x+2)^2+y^2)

plots as "two mountains" in a 3D-plot window; whereas the vector

VECTOR(z = 10/(2^2+(x-2)^2+y^2) + 10/(2^2+(x+2)^2+y^2), z, 1, 3, 0.1)

plots as a contour plot of the function in a 2D-plot window.  Note that the Calculus > Vector command is an easy way to enter such expressions.

Related topics:

Insert > Plot command

2D-plot Window Commands


Parametric Plot Parameters

If the expression being plotted is a vector of two univariate expressions dependent on the same variable, the 2D-plot window Insert > Plot command displays a dialog box with the following fields:

Minimum value:  Enter the minimum value for the parameter of a parametric plot (see Parametric Plots ) or the minimum value for the angle in a polar plot (see Polar Plots).  The default initial minimum value is a numerical approximation of -π in radian angle mode and -180 in degree angle mode.

Maximum value:  Enter the maximum value for the parameter of a parametric plot (see Parametric Plots ) or the maximum value for the angle in a polar plot (see Polar Plots).  The default initial maximum value is a numerical approximation of π in radian angle mode and 180 in degree angle mode.

When changing the minimum and maximum parameter values, use radians if in radian angle mode and degrees if in degree angle mode.  See the Angular Unit field for information on changing the angle mode.

Plot Mode:

•	Click the Line button to plot the expression as a continuous line.

•	Click the Points button to plot the expression as a series of discrete points.

Points:

•	Click the Small button to display a data point as a 1 pixel rectangle.

•	Click the Medium button to display a data point as a 3 by 3 pixel filled rectangle.

•	Click the Large button to display a data point as a 5 by 5 pixel filled rectangle.

•	In the Number of field, enter the number of discrete points to plot.

Apply parameters to rest of plot list:  This option is displayed at the bottom of the Parametric Plot Parameters dialog box only if the expression being plotted is a multi-element vector.  Check this option if you wish to apply the above parameters to the remaining parametric plots.  Do not check this option if you wish to specify different parameters for the remaining parametric plots.

(The underlined button name in a field indicates the default initial setting.)

Related topics:

Polar Plots

Parametric Plots


Default Palette

The default palette is an array of color values identifying the colors that can be used with a device.  The default palette typically has 20 entries (colors), but the exact number of entries may vary from device to device.


3D-plot Window Commands

The following are the 3D-plot window commands:

File commands

Embed

Update

Close

Export commands...

Page Setup...

Print Preview

Print...

Exit

Edit commands

Plot...

Annotation...

Delete Plot

Delete All Plots

Delete Annotation

Delete All Annotations

Copy Plot Window

Mark and Copy...

Insert commands

Plot...

Annotation...

Set commands

Coordinate System...

Eye Position...

Plot Region...

Plot Range...

Aspect Ratio...

Options commands

Display > Axes...

Display > Box...

Display > Legend...

Display > Rotation...

Display > Background Color...

Printing > Header and Footer...

Printing > Page Setup...

Printing > Printer Setup...

•	Printing > Black and White Only

•	Trace Plots

•	Rotate Plots

•	Simplify Before Plotting

•	Approximate Before Plotting

•	Autoscale New Plots

•	Change Plot Colors

Window commands

Cascade

Tile Horizontally

Tile Vertically

Display Tabs

New 2D-plot Window

New 3D-plot Window

•	View Toolbars commands

Help commands

Contents

Index

Frequently Asked Questions

Additional Resources

Link to DERIVE Web Site...

About DERIVE...

Additional 3D-plot Window topics

Framing 3D Plots

Other Help Contents


3D-plot Window Insert commands

Use the following Insert commands to add new plots and annotations to the 3D-plot window:

Plot...

Annotation...

Other 3D-plot Window Commands


3D Insert > Plot command
Insert > Plot command

Use the 3D-plot window Insert > Plot command, click on the [image] icon on the command toolbar, or press the F4 key to plot the expression highlighted in the algebra window associated with the active 3D-plot window.  The coordinate system selected by the Set > Coordinate System command determines how the expression defines a plot surface.

The PLOT3D.MTH file distributed with Derive includes numerous examples of interesting expressions to plot in a 3D-plot window.  The Insert > Plot command is only available if there is a highlighted expression in the algebra window.  If you wish to stop the plotting before completion, press the Esc key.

A bivariate expressions defines a surface in three dimensional space.  Evaluating such a bivariate expression over a uniformly spaced grid of values for the two independent variables yields an array of points on the surface.  Connecting adjacent points by straight line segments produces a wire frame grid that approximates the shape of the surface.  Projecting and plotting this wire frame grid on a two dimensional computer screen allows you to visualize the three dimensional surface.  Only real finite values are plotted and connected to their neighbors.

In rectangular coordinates, the form of the expression or equation determines how it is plotted in the 3D-plot window as follows:

•	An expression of the form u where u is a bivariate expression plots as a functional surface defined by z = u.  The two independent variables of u range over uniformly spaced values in the current 3D plot region.

•	An equation of the form z = u where z is a variable and u is a bivariate expression in two other variables plots as a functional surface.  The two independent variables of u range over equally spaced values in the current 3D plot region.

•	A 3-element vector of the form [x, y, z] where x, y, and z are bivariate expressions in two variables plots as a parametrically defined surface.  The two independent variables of x, y, and z range over equally spaced values you specify in the Insert > Plot command dialog box.

For 3D data-point plots, the form of the vector being plotted determines how the data-points are displayed.  If xi, yi, and zi are numerical constants, the following summarizes how vectors of these constants are plotted:

•	[x, y, z] and [[x, y, z]] each plot as a single isolated point.

•	[[[x1, y1, z1]], [[x2, y2, z2]], ..., [[xn, yn, zn]]] plots as n isolated points.

•	[[x1, y1, z1], [x2, y2, z2]] plots as a single line segment.

•	[[x1, y1, z1], [x2, y2, z2], ..., [xn, yn, zn]] plots as n-1 connected line segments.

•	[[z11, z12, ..., z1n], [z21, z22, ..., z2n], ..., [zm1, zm2, ..., zmn]] plots as the functional surface defined by the n x m points [i, j, zij].

•	[[[x11, y11, z11], [x12, y12, z12], ..., [x1n, y1n, z1n]],
 [[x21, y21, z21], [x22, y22, z22], ..., [x2n, y2n, z2n]]
...
 [[xm1, ym1, zm1], [xm2, ym2, zm2], ..., [xmn, ymn, zmn]]] plots as the parametric surface defined by the n x m points [xij, yij, zij].

Note that the meaning of the 3-element vector coordinates in all the above forms, except the second to last one, depends on the coordinate system selected by the 3D-plot window Set > Coordinate System command:

•	In rectangular coordinates, [x, y, z] represents the point x units from the y-z plane, y units from the x-z plane, and z units from the x-y plane.

•	In spherical coordinates, [r, θ, ϕ] represents the point r units from the origin, θ radians from the positive x-axis, and ϕ radians from the positive z-axis.

•	In cylindrical coordinates, [r, θ, z] represents the point r units from the z-axis, θ radians from the positive x-axis, and z units from the x-y plane.

If the Insert > Plot command results in the warning message

Too many variables for this plot window!

the highlighted expression has 3 or more independent variables.  If the command results in the message

Invalid plot type

the highlighted expression was not one of the above forms.

Use the Plot Parameters dialog box displayed by the Insert > Plot command and the Edit > Plot command to set the number of grid panels in the x and y directions.  Note that the number of grid panels is one less than the number of grid lines for each direction.  When plotting parametric surfaces, this dialog box also allows you to set the minimum and maximum values of the two independent variables.

You can increase or decrease the number of grid lines in either the x or y direction or both.  Increasing the grid lines allows more surface detail to be resolved until a point is reached where the grid lines start running together.  This point of diminishing returns depends on the expression, the resolution of your graphics mode, and the size of your plot window.

The computation time and storage requirements increase with the number of grid panels.  A good strategy is to use a rather coarse grid until you are satisfied with the orientation and perspective of the plot.  If the warning message

Insufficient memory to perform operation

is displayed while computing a 3D plot, reduce the number of grid panels to complete the plot.

Use the Plot Color dialog box displayed by the Insert > Plot command and the Edit > Plot command to control the color of 3D plots.  The dialog box displays the following fields:

Use the Scheme drop down menu to select the color scheme for the 3D plot (Rainbow, Wire Grid, Gray Scale, Red & Blue Checker, Heat Wave, Auto Plot Color, or Custom).

If the Custom color scheme is selected, use the Color by drop down menu to select the method used to color the 3D plot (z value, Gradient, or Checkerboard).

Top:

•	Click the Minimum button to select the color of the top of the surface at its minimum value.

•	Click the Maximum button to select the color of the top of the surface at its maximum value.

Bottom:

•	Click the Minimum button to select the color of the bottom of the surface at its minimum value.

•	Click the Maximum button to select the color of the bottom of the surface at its maximum value.

Mesh Lines:

•	Click the Grids button to select the color of the grid lines when the 3D plot is not selected.

•	Click the Trace button to select the color of the grid lines when the 3D plot is selected.

Other 3D-plot Window Commands


3D Insert > Annotation command
Insert > Annotation command

Use the 3D-plot window’s Insert > Annotation command, click on the [image] icon on the command toolbar, or press the F12 key to insert a new annotation the active plot window.  The command's dialog box displays the following:

•	In the Text field enter the desired text for the annotation.  Press Ctrl+Enter to move the cursor down a line and make a multi-line annotation.  Characters on the Greek and math symbol toolbars can be entered by clicking on them.

•	Click on the Font button to change the font type, style, and size used to display the text.

•	Click on the Color button to change the color used to display the text.

•	Check the Draw behind plots box to hide the annotation whenever it is behind the plot.

Use the Edit > Annotation command to edit an annotation.  Use the Edit > Delete Annotation command to delete an annotation.

Other 3D-plot Window Insert commands


3D-plot Window Set commands

The following are the 3D-plot window Set commands:

Coordinate System...

Eye Position...

Plot Region...

Plot Range...

Aspect Ratio...

Other 3D-plot Window Commands


3D Set > Coordinate System command
Set > Coordinate System command

Use the 3D-plot window Set > Coordinate System command or press Ctrl+Y to select the coordinate system used to plot new expressions.  The command presents a dialog box with the following options:

•	Rectangular:  Click on this button to have subsequent expressions plotted using rectangular coordinates.  In rectangular plot mode the [image] icon is displayed at the left end of the plot window status bar.

•	Spherical:  Click on this button to have subsequent expressions plotted using spherical coordinates.  In spherical plot mode the [image] icon is displayed at the left end of the plot window status bar.

•	Cylindrical:  Click on this button to have subsequent expressions plotted using cylindrical coordinates.  In cylindrical plot mode the [image] icon is displayed at the left end of the plot window status bar.

The following summarizes how parametrically defined surfaces and explicitly defined surfaces are plotted in the three coordinate systems:

•	In rectangular coordinates, [x, y, z] represents the point x units from the y-z plane, y units from the x-z plane, and z units from the x-y plane.  Three-element vectors of the form [x(s,t), y(s,t), z(s,t)] where x(s,t), y(s,t), and z(s,t) are expressions involving the variables s and t, plot as a parametrically defined surface.  For example, in rectangular coordinates

[s, t, s^2 - t^2]

plots as a saddle shaped surface.  For parametrically defined surfaces, like the above example, that have one coordinate value (i.e. the z value) dependent on the other two coordinates (i.e. the x and y values), the expression can also be explicitly defined by entering it as an equation.  For example, in rectangular coordinates

z = s^2 - t^2

also plots as a saddle shaped surface.

•	In spherical coordinates, [r, θ, ϕ] represents the point r units from the origin, θ radians from the positive x-axis, and ϕ radians from the positive z-axis.  Three-element vectors of the form [r(s,t), θ(s,t), ϕ(s,t)] where x(s,t), θ(s,t), and ϕ(s,t) are expressions involving the variables s and t, plot as a parametrically defined surface.  For example, in spherical coordinates

[2, s, t]

plots as a sphere of radius 2 if s is allowed to vary from -π to π, and t is allowed to vary from 0 to π.  For parametrically defined surfaces, like the above example, that have one coordinate value (i.e. the r value) dependent on the other two coordinates (i.e. the θ and ϕ values), the expression can also be explicitly defined by entering it as an equation.  For example, in spherical coordinates

r = 2

also plots as a sphere of radius 2.

•	In cylindrical coordinates, [r, θ, z] represents the point r units from the z-axis, θ radians from the positive x-axis, and z units from the x-y plane.  Three-element vectors of the form [r(s,t), θ(s,t), z(s,t)] where x(s,t), θ(s,t), and z(s,t) are expressions involving the variables s and t, plot as a parametrically defined surface.  For example, in cylindrical coordinates

[2, s, t]

plots as a cylinder of radius 2 if s is allowed to vary from -π to π, and t is allowed to vary from -1 to 1.  For parametrically defined surfaces, like the above example, that have one coordinate value (i.e. the r value) dependent on the other two coordinates (i.e. the θ and z values), the expression can also be explicitly defined by entering it as an equation.  For example, in spherical coordinates

r = 2

also plots as a cylinder of radius 2.

Other 3D-plot Window Set commands


Set > Eye Position command

Use the Set > Eye Position command, click on the [image] icon on the command toolbar, or press Ctrl+E to set the coordinates of the viewer's eye relative to the plot region.  The current eye coordinates are displayed at the left end of the 3D-plot window status bar.

When you issue a 3D-plot window Set > Plot Region command or Set > Plot Range command, or click on a zoom button on the command toolbar, the coordinates of the eye are automatically adjusted to maintain the eye in the same position relative to the center and size of the plot region.

Other 3D-plot Window Set commands


3D Set > Plot Region command
Set > Plot Region command

Use the 3D-plot window Set > Plot Region command or press Ctrl+N to examine and/or set the plot region parameters.  The dialog box displays the current length, center coordinate, and scale of the plot region in the x, y, and z directions, and invites you to enter new ones.  The lengths and center coordinates are also continuously displayed on the 3D-plot window status bar.

After you enter new plot region parameters, press OK to accept the new values.  The plot window will be redrawn and all expressions replotted.  Press Reset to restore the default plot region parameters (i.e. 10 for the lengths, 0 for the center coordinates, and 2 for the scales).  Press Cancel to cancel the command and make no changes to the plot region.

You can also change the lengths of the plot region using the zoom commands on the plot window’s command toolbar or by the function keys.  Zooming in magnifies details by displaying a smaller portion of the surface.  Zooming out shrinks details by displaying a larger portion of the surface.  You can zoom in the x direction, the y direction, or both directions at once.  When you zoom in or out, the length of the plot region is changed to the next closest number in the sequence: ... 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20 ... .

Use the following command toolbar icons or function keys to zoom the plot region in or out (i.e. to decrease or increase the plot range):

Click on the [image] icon or press the F9 key to zoom both the x and y directions in.

Click on the [image] icon or press the F10 key to zoom both the x and y directions out.

Related topics: Framing 3D Plots

Other 3D-plot Window Set commands


3D Set > Plot Range command
Set > Plot Range command

Use the 3D-plot window Set > Plot Range command, click on the [image] icon on the command toolbar, or press Ctrl+R to examine and/or set the plot range parameters.  The dialog box displays the current minimum, maximum, and scale of the plot range in the x, y, and z directions, and invites you to enter new ones.

After you enter new plot range parameters, press OK to accept the new values.  The plot window will be redrawn and all expressions replotted.  Press Reset to restore the default plot range parameters (i.e. -5 for the minimums, 5 for the maximums, and 2 for the scales).  Press Cancel to cancel the command and make no changes to the plot range.

You can also change the plot range parameters using the zoom commands on the plot window’s command toolbar or by the function keys (see the Set > Plot Region command for details).

Related topics: Framing 3D Plots

Other 3D-plot Window Set commands


3D Set > Aspect Ratio command
Set > Aspect Ratio command

Use the 3D-plot window Set > Aspect Ratio command or press Ctrl+A to examine and/or change the aspect ratio of the plot window.  The aspect ratio of a 3D-plot window is the ratio of the physical screen lengths in pixels of the sides of the box around the plot region.  The command's dialog box provides three fields for entering integers so the ratio of the length of the sides of the box around the plot region can be specified.

Press the OK button to change the aspect ratio to that specified.  Press the Cancel button to abort the command.  Press the Reset button to set an aspect ratio of 1:1:1.

Other 3D-plot Window Set commands


3D-plot Window Options commands

Use the following Options > Display commands or press the F11 key to control 3D-plot window display options:

Axes...

Box...

Legend...

Rotation...

Background Color...

Use the following Options > Printing commands to control the printing of the 3D-plot window:

Header and Footer...

Page Setup...

Printer Setup...

•	Black and White Only

Use the following Options commands to toggle on and off various parameters of the 3D-plot window:

•	Trace Plots

•	Rotate Plots

•	Simplify Before Plotting

•	Approximate Before Plotting

•	Autoscale New Plots

•	Change Plot Colors

Other 3D-plot Window Commands


Options > Display > Axes command

Use the Options > Display > Axes command to control the display of axes lines and titles in the 3D-plot window.  The display of the axes can be turned on or off.  The default initial setting is to have the axes turned off, since they tend to clutter plot images.  However, if the axes are turned on, they are helpful in orienting 3D plots.  The titles of the three axes are displayed at the positive ends of the axes.  The default initial titles of the three axes are x, y, and z.

The Options > Display > Axes command dialog box displays the following fields:

Lines:

•	Click the On button to turn on the display of the axes lines.

•	Click the Off button to turn off the display of the axes lines.

•	Click the Color button to select the color of the axes lines.

Titles:

•	In the x axis field, enter the title for the x axis.  Leave this field blank if no title is desired.

•	In the y axis field, enter the title for the y axis.  Leave this field blank if no title is desired.

•	In the z axis field, enter the title for the z axis.  Leave this field blank if no title is desired.

•	Click the Color button to select the color of the axes titles.

Other 3D-plot Window Options commands


Options > Display > Box command

Use the Options > Display > Box command to control the display of the lines and titles of the box around the plot region in the 3D-plot window.  The display of the box can be turned on or off.  The default initial setting is to have the box turned on, since it is helpful in orienting 3D plots.  The titles of three sides of the box are displayed on the box edges.  The default initial titles are x, y, and z.

The Options > Display > Box command dialog box displays the following fields:

Lines:

•	Click the On button to turn on the display of the box.

•	Click the Off button to turn off the display of the box.

•	Click the Color button to select the color of the box lines.

Titles:

•	In the x side field, enter the title for the x side.  Leave this field blank if no title is desired.

•	In the y side field, enter the title for the y side.  Leave this field blank if no title is desired.

•	In the z side field, enter the title for the z side.  Leave this field blank if no title is desired.

•	Click the Color button to select the color of the box titles.

Other 3D-plot Window Options commands


Options > Display > Legend command

Use the Options > Display > Legend command to control the display of legend axis lines and titles in the 3D-plot window.  The display of the legend can be turned on or off.  The default initial setting is to have the legend turned on, since it is helpful in orienting 3D plots.  The titles of the three legend axis lines are displayed at the positive ends of the axes.  The default initial titles of the three axis lines are x, y, and z.

The Options > Display > Legend command dialog box displays the following fields:

Lines:

•	Click the On button to turn on the display of the legend.

•	Click the Off button to turn off the display of the legend.

•	Click the Color button to select the color of the legend axis lines.

Titles:

•	In the x axis field, enter the title for the x axis line.  Leave this field blank if no title is desired.

•	In the y axis field, enter the title for the y axis line.  Leave this field blank if no title is desired.

•	In the z axis field, enter the title for the z axis line.  Leave this field blank if no title is desired.

•	Click the Color button to select the color of the axis line titles.

Location:

•	Select the desired location for the legend (Top Left, Top Right, Bottom Left, or Bottom Right).

Other 3D-plot Window Options commands


Options > Display > Rotation command

Use the Options > Display > Rotation command to control the speed and smoothness of plot rotation in the 3D-plot window.  The dialog box displays the following:

•	In the Increment field, enter the number of degrees the 3D plot is rotated each increment.

•	In the Period field, enter the number of milliseconds between each rotation increment.

•	Click the Reset button to enter the default initial settings of the rotation increment and period.

Increasing the number of degrees the plot is rotated each increment increases the rotation speed, but makes the movement jerky.  Decreasing the number of milliseconds between each rotation increment also increases the rotation speed, but requires more computer processing time thus leaving less time for other tasks.  Other factors that affect plot rotation are the number of 3D plots being rotated and the number of grid lines of each plot.

Use the Options > Rotate Plots command, click on the [image] icon on the command toolbar, or press Ctrl+T to toggle on or off the continuous rotation of plots in the 3D-plot window.

Other 3D-plot Window Options commands


3D-plot window Options > Trace Plots command
Options > Trace Plots command

Use the Options > Trace Plots command or press the F3 key to trace plots in the 3D-plot window.  When a plot is traced, two of the grid lines on the surface of the plot are highlighted in a different color.  The coordinates of the point on the surface at the intersection of the two highlighted grid lines is displayed on the status bar.

The grid lines that are highlighted can be changed by clicking on the plot at the desired location, by pressing the arrow keys while holding the Shift key, or by pressing the arrow keys on the plot tracing toolbar.  Use the Window > View Toolbars commands to turn on and off the plot tracing toolbar.

Other 3D-plot Window Options commands


Options > Rotate Plots command

Use the Options > Rotate Plots command, click on the [image] icon on the command toolbar, or press Ctrl+T to toggle on or off the continuous rotation of plots in the 3D-plot window.  Continuous rotation can also be turned off by pressing the Esc key or by clicking anywhere in the 3D-plot window.

If continuous rotation is off, click on the [image] or [image] icon on the command toolbar to rotate the 3D plots one rotation increment left or right, respectively.   If continuous rotation is on, click on the [image] or [image] icon on the command toolbar to change the direction of the 3D plot rotation to the left or right, respectively.   At any time, click on the [image] or [image] icon to rotate the 3D plots one rotation increment up or down, respectively.

Use the Options > Display > Rotation command to control the speed and smoothness of plot rotation in the 3D-plot window.

Other 3D-plot Window Options commands


Framing 3D Plots

Imagine that the surface of an expression being plotted is enclosed in a transparent box just spanning the maximum and minimum computed values of x, y, and z.  Your monitor screen is between the box and an eye fixed somewhere in front of the screen.  Each point on the wire frame projects onto the screen along the line joining that point to the eye.

For maximum resolution it is usually desirable to magnify the surface as much as possible while keeping it entirely within the 3D-plot window.  Therefore, Derive automatically magnifies the image horizontally so the surface just fits the full width of the 3D-plot window.  Also, if using the optional automatic vertical centering and scaling, Derive automatically tries to magnify and shift the image vertically so the surface just fits the height of the 3D-plot window.  Naturally this is impossible if the surface projects as a horizontal line, in which case Derive generates an error beep.

To impose a specific scaling in all three directions, turn off the automatic centering and scaling of new plots using the Options > Autoscale New Plots command.  For example, you may want to impose equal scaling in all three directions.  Alternatively, you may want to magnify certain details at the expense of having portions clipped at the top or bottom edge of the plot window.

The framing challenge for three dimensions is more difficult than for two dimensions because of the lower effective resolution and the extra dimension to search.  If a few experiments do not reveal appropriate ranges for the two variables in your expression or equation, then use a 2D-plot window to plot cross-sections obtained by substituting various numeric values for one or the other of the two variables.  The ten-fold greater resolution of 2D plots often more quickly reveals appropriate ranges for viewing the two variables in a 3D-plot window.  If you zoom in on a 2D plot until the features of interest are at least 1/nth of the window width, they have a chance of being resolved in a 3D-plot window of that size using n grid lines for that coordinate.

Related topics:

Insert > Plot command

3D-plot Window Commands


Vectors and Matrices

These sections describe how vectors and matrices are entered and manipulated using Derive's built-in functions and operators.  The file VECTOR.MTH defines functions that perform additional vector and matrix operations.

The only limitation on the number of elements in vectors and matrices is the amount of space available for storing their elements.  Thus, the maximum number of elements depends strongly on the mathematical complexity of the elements.  Many of the matrix operations described in these sections may dramatically increase the complexity of the resulting elements.

Generating Vectors and Matrices

Vector Manipulation Functions

String Processing Functions

Vector Operations

Matrix Operations

Row Echelon Form

Eigenvalues

Vector and Matrix Algebra

Differential Vector Calculus

Integral Vector Calculus

Other Help Contents


Generating Vectors and Matrices

Use the Author > Vector command to enter a new vector.  Use the Author > Matrix command to enter a new matrix.  Use the Calculus > Vector command or the VECTOR function to generate vectors and matrices.  Use the Calculus > Table command or the TABLE function to generate tables of expression values.

An identity matrix is a square matrix whose elements are 1 on the main diagonal and 0 off the main diagonal.  Use the IDENTITY_MATRIX function to generate an identity matrix.  IDENTITY_MATRIX(n) simplifies to an n by n identity matrix.  For example,

IDENTITY_MATRIX(3)

simplifies to the 3 by 3 identity matrix

 1  0  0

 0  1  0

 0  0  1

Other Vectors and Matrices


Vector Manipulation Functions

Use the functions and operators in this section to extract, concatenate, delete, insert, reverse, select, and sort elements of vectors.  They can also be used to perform these same operations on the characters of a string or the digits of an integer (see the String Processing Functions).

Many of these functions and operators have arguments or operands that specify the index of a vector element.  If an index is a positive integer n, it specifies the nth element from the left end of the vector.  If an index is a negative integer n, it refers to the -nth element from the right end of the vector.

Use the SUB infix operator to extract the elements of a vector or matrix.  If v is a vector, v SUB n returns the nth element of v.  As an alternative to typing SUB on the expression entry line, it can be entered by clicking on the ↓ on the math symbol toolbar.  In the algebra window worksheet, subscripts are displayed using standard subscript notation.  For example,

[a, b, c, d] SUB 2

displays as

[a, b, c, d]
            2

and simplifies to b.  Use SUB twice to extract the elements of a matrix.  For example,

[a, b, c; d, e, f; g, h, i] SUB 2 SUB 3

displays as

 a  b  c

 d  e  f

 g  h  i
           2,3

and simplifies to f.  If the right operand of SUB is a vector of indices, a vector of the specified elements is returned.  For example,

[a, b, c, d] SUB [4, 2]

simplifies to [d, b], and

[a, b, c; d, e, f; g, h, i] SUB [3, 1]

simplifies to

 g  h  i

 a  b  c

The SUB operator can be used in conjunction with the := assignment operator (see the Declare > Variable Value command) to change designated elements of vectors assigned to variables.  If the value of the variable A is a vector and a subscripted assignment of the form

A SUB n := u

is simplified, the nth element of A is replaced by u.  If a subscripted assignment of the form

A SUB [n1, n2, ..., nm] := [u1, u2, ..., um]

is simplified, the elements n1, n2, ..., nm of A are replaced by u1, u2, ..., um, respectively.  Note that unlike regular assignments, subscripted assignments must be simplified in order to take effect.

Since matrices are stored as vectors of vectors, subscripted assignments can also be used to change designated elements of matrices assigned to variables.  If the value of the variable A is a matrix and a subscripted assignment of the form

A SUB n SUB m := u

is simplified, the mth element on the nth row of A is replaced by u.

The SUB operator can similarly be used in conjunction with the update operators :+, :-, :*, and :/ (for details see Procedural Programming) to update the elements of vectors and matrices.

Use the SUB SUB operator to extract the columns of a matrix.  If A is a matrix, A SUB SUB n returns the nth column of A as a vector.  For example, A↓↓3 returns the 3rd column of A; whereas A↓3 returns the 3rd row of A.  This scheme naturally extends to higher dimensional matrices.  For example, three SUB operators extract a plane from a 3-dimensional matrix.

Finally, if the right operand of SUB SUB is a vector of indices, a matrix of the specified columns is returned.  This makes it easy to extract arbitrary sub-matrices of a matrix.  For example,

A ↓ [2, 3] ↓↓ [3, ..., 7]

returns the sub-matrix consisting of rows 2 and 3, and columns 3 through 7 of A.

The ELEMENT function is equivalent to the SUB operator but is entered using functional notation.  ELEMENT(v, n) simplifies to the nth element of the vector v.  For example,

ELEMENT([a, b, c, d], 2)

simplifies to b.  ELEMENT(m, j, k) simplifies to the element in row j and column k of the matrix m.  For example,

ELEMENT([a, b, c; d, e, f; g, h, i], 2, 3)

simplifies to f.  Since the SUB operator is displayed using standard subscript notation, we recommend using it rather than the ELEMENT function.

Use the APPEND function to concatenate two or more vectors.  APPEND(v1, v2, ..., vn) simplifies to a vector consisting of the elements of the vectors v1 through vn.  For example,

APPEND([a, b], [c, d], [e, f])

simplifies to [a, b, c, d, e, f].  If A is a matrix, APPEND(A) simplifies to a vector consisting of the elements of A.  For example,

APPEND([[a, b], [c, d], [e, f]])

also simplifies to [a, b, c, d, e, f].  To append the columns of two matrices, use the function APPEND_COLUMNS defined in the VECTOR.MTH utility file.

Use the DELETE function to delete an element from a vector.  DELETE(v, n) simplifies to a copy of vector v but with the nth element deleted.  For example,

DELETE([a, b, c], 2)

simplifies to [a, c].  Note that if v is a matrix, the nth row of v is deleted.

Use the INSERT function to insert an element into a vector.  INSERT(u, v, n) simplifies to a copy of vector v but with expression u inserted before the nth element.  For example,

INSERT(d, [a, b, c], 2)

simplifies to [a, d, b, c].  n defaults to 1.  If n is one more than the dimension of the vector, the new element is added to the end of the vector.

Use the REPLACE function to replace an element in a vector.  REPLACE(u, v, n) simplifies to a copy of vector v but with expression u replacing the nth element.  For example,

REPLACE(d, [a, b, c], 2)

simplifies to [a, d, c].  n defaults to 1.

Use the REVERSE function to reverse the elements of a vector.  REVERSE(v) simplifies to a copy of vector v but with the elements reversed.  For example,

REVERSE([a, b, c])

simplifies to [c, b, a].

Use the SELECT function to find those elements of a vector that satisfy some test criteria.  SELECT (u, k, v) simplifies to a vector of those elements k of v for which u(k) is true.  For example,

SELECT(PRIME(k), k, [3, 5, 7, 9, 11])

simplifies to [3, 5, 7, 11].  SELECT can also be used to test the elements of a sequence.  SELECT(u, k, m, n, s) simplifies to a vector of those k for which u(k) is true with the variable k stepping from m through n in steps of size s.  s defaults to 1.  For example,

SELECT(PRIME(k), k, 1, 100)

simplifies to a vector of all the prime numbers less than 100.

Use the SORT function to sort the elements of a vector or set, and return the result as a vector.  Given a vector or set of numbers, SORT returns a vector of the numbers sorted in ascending numerical order of their real parts with ties broken on their imaginary parts.  Variable names are sorted lexicographically after numbers.  For example,

SORT([3, 2, y, pi, #e, SQRT(2), z, x, 1, 0, 2, 0, 0, -3])

simplifies to

[-3, 0, 0, 0, 1, √2, 2, 2, ê, 3, π, x, y, z]

Given a vector or set of vectors, the vectors are sorted by comparing their first elements with ties being broken by comparing their second elements, etc.  For example,

SORT({[2, 3], [3, 1], [2, 1], [1, 5]})

simplifies to

 1  5

 2  1

 2  3

 3  1

If, in addition to a vector or set, SORT is given a predicate and two variables, the ordering is based on the truth-value returned by the predicate.  For example,

SORT([-5, -2, 0, 3, 4], ABS(x)<ABS(y), x, y)

simplifies to

[0, –2, 3, 4, -5]

Other Vectors and Matrices


String Processing Functions

All the Vector Manipulation Functions treat the characters of strings and the digits of integers as if they were the elements of a vector.  Thus, you can use these same functions and operators to do a wide range of string processing operations, useful for cryptographic and other applications.  Note that strings are entered on the expression entry line enclosed in double quotes, but they are displayed in the algebra window worksheet without the double quotes.

In particular, the SUB subscript operator can be used to extract the characters of strings or the digits of integers.  For example,

"Derive" SUB 3

simplifies to string "r",

"Derive" SUB [1, 2, 6, 3]

simplifies to the string "Deer", and

123456789 SUB [1, 3, 5, -3, -1]

simplifies to the integer 13579.

Also, the vector manipulation functions work on strings and integers as expected.  For example,

REVERSE(1234567890)

simplifies to the integer 987654321,

APPEND("a", "b", "c", 3)

simplifies to the string "abc3", and

DELETE("Derive", 2)

simplifies to the string "Drive".  Note that these can also accept negative indices to specify characters from the right end of a string.  For example,

DELETE("Derive", -5)

also simplifies to "Drive".

Use the STRING function to convert expressions to strings.  If u is a variable, STRING(u) simplifies to the string having the same name as u, but enclosed in double quotes.  If u is a number, STRING(u) simplifies to the string having the same digits as u, but enclosed in double quotes.  For example,

STRING(123456789)

simplifies to the string "123456789".  Note that the digits representing u are determined by the current output radix base set by the Declare > Output Settings command.

If u is a function composition, STRING(u) simplifies to a vector consisting of the string variable corresponding to the expression's top-level function or operator, followed by the function's arguments or operator's operands.  Note that the arguments and operands are not converted to strings.  For example,

STRING(x+y-z)

simplifies to ["+", x, y, -z], and

STRING(COS(x^2))

simplifies to ["COS", x^2].  The STRING function distributes over the elements of vectors and sets.

Use the NAME_TO_CODES function to convert a string or integer to a vector of ASCII codes for the characters in the string or the digits in the integer.  For example,

NAME_TO_CODES("Exact")

simplifies to [69, 120, 97, 99, 116].

Use the CODES_TO_NAME function to convert a vector of ASCII codes to the corresponding string or integer.  For example,

CODES_TO_NAME([69, 120, 97, 99, 116])

simplifies to the string "Exact", and

CODES_TO_NAME([45, 52, 49])

simplifies to the integer -41.  To generate a 16 by 16 matrix showing the character corresponding to each ASCII code, simplify the expression

VECTOR(VECTOR(CODES_TO_NAME(j + 16·i), i, 0, 15), j, 0, 15)

Note that strings containing the ASCII codes 0, 10, 13, and 34 are not allowed.

Other Vectors and Matrices


Vector Operations

Since a matrix is just a vector of vectors, the vector operations described in this section also apply to matrices.

The dimension of a vector is the number of elements of the vector.  Use DIM to compute the dimension of a vector and the number of elements of a set.  Since a matrix is just a vector of vectors, the dimension of a matrix is the number of rows of the matrix.  For example,

DIM([[a, b, c], [1, 2, 3]])

simplifies to 2 since the matrix has two rows, and

DIM([[a, b, c], [1, 2, 3]] SUB 1)

simplifies to 3 since the first row of the matrix has three columns.

Use ABS to compute the magnitude (length) of a vector.  The absolute value of a vector is the square root of the sum of the squares of its elements.  For example,

ABS([a, b, c])

simplifies to the square root of (a²+b²+c²).

Use MEMBER? to test for set membership.  If u is an expression and v is a set or vector, MEMBER?(u, v) returns true if u is a member of v; otherwise it returns false.  For example,

MEMBER?(2*x, {x, x+x, x^2})

simplifies to true.

Use the + (plus) operator to add the corresponding elements of two vectors.  Use the - operator to subtract the corresponding elements of two vectors.  In either case, the vectors must have the same dimension.  For example,

[2·x, -5, x^2] + [-x, 8, 2·x]

simplifies to

        2
[x, 3, x  + 2·x]

Use the * (times) operator or implicit multiplication to multiply each element of a vector by a scalar.  Use the / operator to divide each element of a vector by a scalar.  For example,

3 [2·x, -5, x^2]

simplifies to

[6·x, -15, 3·x^2]

Use the  .  (period) infix operator to compute the dot product (also called the inner product) of vectors and matrices.  To prevent a period used for the dot product operator from being interpreted as a decimal point, use a space to separate the period from numbers that immediately precede or follow it.

The * operator or implicit multiplication can also be used to compute dot products provided the operands are vectors or have variables that have been declared nonscalar (see the Declare Variable Domain command).

The dot product of two vectors (also called the scalar product) is the sum of the products of corresponding elements of the vectors.  The dimensions of the vectors must be the same.  Note that the result is a scalar.  For example,

[2, a, 5] · [2·a, 3, -1]

simplifies to

7·a - 5

If n is a positive integer and v is a vector, v^n simplifies to the product v · v^(n-1).  If n is a negative integer, v^n  simplifies to (v/(v · v))^-n.  For example,

[a, b, c]^(-2)

simplifies to

       1
——————————————
  2    2    2
 a  + b  + c

The dot product of a matrix and a vector is the vector whose elements are the dot product of the vector and the rows of the matrix.  The dimension of the vector must be the same as the dimension of the rows of the matrix.  For example,

[a, b; c, d]·[2, 3]

display as

 a  b
       · [2, 3]
 c  d

and simplifies to

[2·a + 3·b, 2·c + 3·d]

The dot product of a vector and a matrix is the vector whose elements are the dot product of the vector and the columns of the matrix.  The dimension of the vector must be the same as the dimension of the matrix.  For example,

[2, 3]·[a, b; c, d]

display as

         [ a  b ]
[2, 3] · |      |
         [ c  d ]

and simplifies to

[2·a + 3·c, 2·b + 3·d]

The dot product of two matrices is the matrix whose elements are the dot product of the rows of the first matrix and the columns of the second matrix.  The number of columns of the first matrix must equal the number of rows of the second matrix.  For example,

[[a, b], [c, d]] · [[2], [3]]

display as

[ a  b ]   [ 2 ]
|      | · |   |
[ c  d ]   [ 3 ]

and simplifies to

[ 2·a + 3·b ]
|           |
[ 2·c + 3·d ]

As another, more general, example,

[ 2  3 ]   [ a  b  1 ]
|      | · |         |
[ 4  5 ]   [ c  d  1 ]

simplifies to

[ 2·a + 3·c  2·b + 3·d  5 ]
|                         |
[ 4·a + 5·c  4·b + 5·d  9 ]

Use CROSS to compute the cross product of two vectors.  Both vectors must have three elements or both must have two elements.  For example,

CROSS([1, 2, 3], [a, b, c])

simplifies to

[2·c - 3·b, 3·a - c, b - 2·a]

and

CROSS([1, 2], [a, b])

simplifies to

b - 2·a

Other Vectors and Matrices


Matrix Operations

The functions and operators described in this section only apply to matrices.

The ROW and COL infix operators can be used as an alternative to the SUB operator (see Vector Manipulation Functions) to extract rows and columns of matrices.  If A is a matrix, A ROW n and A COL n return the nth row and column of A as a vector, respectively.  For example,

[a, b, c; d, e, f; g, h, i] ROW 2

simplifies to [d, e, f], and

[a, b, c; d, e, f; g, h, i] COL 2

simplifies to [b, e, h].  If the right operand of ROW or COL is a vector of indices, a matrix of the specified rows or columns is returned.  For example,

[a, b, c; d, e, f; g, h, i] ROW [3, 1]

simplifies to

 g  h  i

 a  b  c

and

[a, b, c; d, e, f; g, h, i] COL [3, 1]

simplifies to

 c  a

 f  d

 i  g

Note that the ... ellipsis can be used to extract a range of rows or columns.  For example,

A ROW [3, ..., 7]

returns a matrix consisting of the 3rd through 7th rows of the matrix A.

The transpose of a matrix is the matrix resulting from interchanging its rows and columns.  The transpose of a scalar or a vector of scalars is the original scalar or vector of scalars.  Use the `(back-accent) postfix operator to generate the transpose of a matrix.  For example,

[[a, b, c], [1, 2, 3]]`

displays as

 a  b  c
         `
 1  2  3

and simplifies to

 a  1

 b  2

 c  3

A square matrix is a matrix with the same number of rows as columns.  Use DET to compute the determinant of a square matrix.  For example,

DET([2, 3; a, b])

simplifies to 2·b - 3·a.

The trace of a square matrix is the sum of its diagonal elements.  Use TRACE to compute the trace of a square matrix.  For example,

TRACE([a, b, c; d, e, f; g, h, i])

simplifies to a + e + i.

Use the ^ operator to raise a square matrix to an integer power.  For example,

[2, 3; a, b]^2

simplifies to

  3·a + 4    3·b + 6

                   2
 a·(b + 2)  3·a + b

A singular matrix is a square matrix whose determinant is 0.  A singular matrix has no inverse.  For example,

[2, 3; 4·a, 6·a]^(-1)

does not simplify further since the matrix is singular.

Inverting a matrix can produce dramatically more complicated elements than the original matrix.  The complexity of the inverse of an n by n matrix with symbolic elements often grows combinatorially with n.  Even for numeric matrices, the elements of an inverse computed in exact or mixed mode can have dramatically more digits than the given elements.

A system of linear equations can be represented as a vector of constants that is equal to the dot product of a coefficient matrix and a vector of unknowns.  Provided the matrix is nonsingular, you can use the matrix inverse and dot product operations to solve this matrix equation.  For example, to solve the system of equations

5·x + 3·y - 7·z  =  4
2·x - 8·y +  z  =  6
-x + 9·y + 4·z  =  5

enter the expression

[5, 3, -7; 2, -8, 1; -1, 9, 4]^(-1)·[4, 6, 5]

which approximates to the solution vector for x, y, and z

[2.910596026, 0.1754966887, 1.582781456]

Note that the exact rational solution can be found by simplifying, instead of approximating, the equation.

The above method is only able to solve systems of linear equations that are nonsingular.  Also since it requires the explicit computation of the inverse of a matrix, it is both space and time inefficient.  In contrast, the Solve commands and the function ROW_REDUCE (see Row Echelon Form) can solve larger as well as singular systems of linear equations, so long as they are consistent.

Other Vectors and Matrices


Row Echelon Form

Another method for solving systems of linear equations involves reducing a matrix to row echelon form.  In addition to being able to solve both singular and nonsingular systems, this method can simultaneously determine solutions to more than one set of constants on the right side of the equations.

Row echelon form is sometimes called reduced row echelon form or Hermite normal form.  A matrix is in row echelon form if:

•	the first nonzero element in every row is 1,

•	the first nonzero element in every row occurs to the right of the first nonzero element in the row above it, and

•	all the elements above the first nonzero element in a row are 0.

Use ROW_REDUCE to compute the row echelon form of a matrix.  The only matrix operations used are multiplying rows by scalars and adding rows.  These elementary row operations do not change the solution set.  Also, the rank of a matrix is equal to the number of nonzero rows in the row echelon form of the matrix.

If ROW_REDUCE is given two matrices, it adjoins them and returns the row echelon form of this augmented matrix.  Thus, to solve the matrix equation A·X = B where A and B are matrices and X is a vector of variables, enter and simplify (or approximate) an expression of the form

ROW_REDUCE(A, B)

If A is nonsingular, the result is a matrix in row echelon form: the identity matrix adjoined to the solution matrix.  For example,

ROW_REDUCE([1, 2; 5, 6], [3, 4; 7, 8])

simplifies to

 1  0  -1  -2

 0  1   2   3

and the solution is

 -1  -2

  2   3

If A is singular, rows having 0 on the main diagonal are consistent only with augmented columns having 0 in the same row, in which case the corresponding element of X is arbitrary.  For example, since

ROW_REDUCE([1, 1; 2, 2], [1, 1; 2, 1])

simplifies to

 1  1  1  0

 0  0  0  1

the right column is inconsistent, but the column preceding it is consistent.

Other Vectors and Matrices


Eigenvalues

The characteristic polynomial of a square matrix is the determinant of the difference of the matrix and a variable times the identity matrix.  If A is a square matrix and v is a variable, CHARPOLY(A, v) simplifies to the characteristic polynomial of A in terms of v.  For example,

CHARPOLY([2, 3; a, b], z)

simplifies to

 2
z  - z·(b + 2) - 3·a + 2·b

The default value of the variable used by CHARPOLY is w.

The eigenvalues of a square matrix are the zeros of its characteristic polynomial.  If A is a square matrix and v is a variable, EIGENVALUES(A, v) simplifies to the eigenvalues of A in terms of v.  For example,

EIGENVALUES([2, 3; 0, b], z)

simplifies to [z = 2, z = b].  The default value of the variable used by EIGENVALUES is w.

The degree of the characteristic polynomial equation that EIGENVALUES must solve is equal to the dimension of the matrix.  Since characteristic polynomials rarely factor exactly over the rational numbers, exact results usually require the cubic formula for 3 by 3 matrices or the quartic formula for 4 by 4 matrices.  Exact results are usually impossible for matrices larger than 4 by 4.  Moreover, the quartic formula generates such bulky results that the exact eigenvalues of 4 by 4 matrices often exhaust memory.  Thus, exact eigenvalues are rarely attainable for matrices larger than 3 by 3.

The characteristic polynomial of a numerical matrix is univariate.  Thus real-valued eigenvalues can be approximated by plotting the characteristic polynomial to find the zeros and then solving it numerically using the Solve > Expression command.  Note that the eigenvalues of symmetric and Hermitian matrices are all real.  For matrices with complex eigenvalues, the SOLVE.MTH utility file functions NEWTONS or FIXED_POINT can be used to find the complex zeros of their characteristic polynomials.

The file VECTOR.MTH defines functions for computing eigenvectors.

Other Vectors and Matrices


Vector and Matrix Algebra

Derive automatically uses the rules of vector and matrix algebra to simplify and normalize expressions involving vectors and matrices.  If the variables a, b, and c are declared to be vectors (see the Declare > Variable Domain command), the following transformations are used:

 a``  ⇒  a

(a^-1)`  ⇒  a`^-1

(a + b)`  ⇒  a` + b`

(a · b)`  ⇒  b` · a`

a · (b + c)  ⇒  a · b + a · c

(b + c) · a  ⇒  b · a + c · a

(a · b) · c  ⇒  a · (b · c)

(a · b)^-1    ⇒  b^-1 · a^-1

DET(a^-1)  ⇒  1/DET(a)

Other Vectors and Matrices


Differential Vector Calculus

Derive can do differential vector calculus in any orthogonal curvilinear coordinate system.  For example, you can compute gradients, divergences, and curls in Cartesian, polar-cylindrical, or spherical coordinates.  The default coordinate system is three-dimensional rectangular-Cartesian with x, y, and z used as the names of the coordinate variables.

Use GRAD to compute the gradient of an expression.  For example,

GRAD(x·y^2·z^3)

simplifies to

  2  3         3       2  2
 y ·z , 2·x·y·z , 3·x·y ·z

To compute the general form of the gradient in the Cartesian coordinate system, define F(x,y,z) to be an arbitrary function (see the Declare > Function Definition command) using the assignment

F(x, y, z) :=

then

GRAD(F(x, y, z))

simplifies to

d              d              d
—— F(x, y, z), —— F(x, y, z), —— F(x, y, z)
dx             dy             dz

To specify Cartesian coordinates with other coordinate variables, call GRAD with a vector of coordinate variables as the second argument.  For example,

GRAD(c·w + x^2 + y^3 + z^4, [w, x, y, z])

simplifies to the four-element vector

           2     3
c, 2·x, 3·y , 4·z

For other orthogonal coordinate systems, provide a second argument that is a coordinate geometry matrix of the form

 x1  x2  ...  xn

 h1  h2  ...  hn

The first row consists of the coordinate variables associated with successive elements of vectors.  The second row consists of the scale factors such that the squared infinitesimal length is given by

  2           2           2                 2
ds  = (h1·dx1)  + (h2·dx2)  + ... + (hn·dxn)

The file VECTOR.MTH assigns polar-cylindrical and spherical coordinate geometry matrices to the variables cylindrical and spherical respectively as follows:

               [ r  θ  z ]
cylindrical := |         |
               [ 1  r  1 ]

and

             [ r      θ     Φ ]
spherical := |                |
             [ 1  r·SIN(Φ)  r ]

Thus, if VECTOR.MTH is loaded,

GRAD(r·SIN(theta)·COS(phi), spherical)

simplifies to

[COS(ϕ)·SIN(θ), COT(ϕ)·COS(θ), - SIN(ϕ)·SIN(θ)]

For a right-hand coordinate system having the positive z-axis associated with the north pole, this definition of spherical coordinates measures colatitude Φ in radians south from the north pole and measures colongitude θ in radians east from the positive x-axis.  Be aware that some references define spherical coordinates differently, such as interchanging the definitions of θ and Φ.

All the differential vector functions take an optional second argument that is a Cartesian coordinate vector or a coordinate geometry matrix.

Use DIV to compute the divergence of a vector.  For example,

DIV([y^2·z^3, 2·x·y·z^3, 3·x·y^2·z^2])

simplifies to

      2        3
x·(6·y ·z + 2·z )

Use LAPLACIAN to compute the divergence of the gradient of an expression.  For example,

LAPLACIAN(x·y^2·z^3)

simplifies to

      2        3
x·(6·y ·z + 2·z )

Use CURL to compute the curl of a vector having two or three elements.  For example,

CURL([y^2, 2·x·z, 0])

simplifies to

[- 2·x, 0, 2·z - 2·y]

The curl of a planar vector field is a vector perpendicular to that plane.  Thus, the curl of a two element vector is a three element vector whose first two elements are zero.  In this case Derive follows the more common convention of just returning the third element as a scalar.  For example,

CURL([v^2, u], [u, v; 1, 1])

simplifies to 1 - 2·v.

Other Vectors and Matrices


Integral Vector Calculus

Derive can do integral vector calculus in any orthogonal curvilinear coordinate system.  For example, you can compute scalar or vector potentials in Cartesian, polar-cylindrical, or spherical coordinates.

Use POTENTIAL to compute a scalar potential of a vector.  For example,

POTENTIAL([y^2·z^3, 2·x·y·z^3, 3·x·y^2·z^2])

simplifies to

    2  3
 x·y ·z

As with antiderivatives, scalar potentials are unique only to within a constant. Thus, POTENTIAL may give a different result than one derived manually.  Such additive constants can be well disguised -- particularly in expressions involving logarithms or inverse trigonometric functions.  However, the gradient of a potential should be equivalent to the original vector.

Not all vectors have an associated scalar potential.  POTENTIAL merely computes a certain line integral involving the given vector.  If there is no potential, then the gradient of the resulting scalar will not be equivalent to the original vector.  It is your responsibility to check this.  In the case of a vector of two or three elements, it may be easier to see if the CURL of the given vector is equivalent to zero, as is necessary and sufficient for the existence of a scalar potential.

POTENTIAL takes an optional second argument that is a vector specifying the starting coordinates for the line integrals.  This argument defaults to a vector of zeros.  An inappropriate choice may lead to an infinite or unknown potential.  Try other values if this happens.  What you want is starting coordinates at which the given gradient is simple and finite.  π/2 and other simple rational multiples of π are often good alternatives for angular starting coordinates.  Infinity is often a good starting nonangular coordinate when 0 is not.  1 is often a good starting coordinate if the given gradient involves logarithms of that coordinate.

POTENTIAL also takes an optional third argument that is a Cartesian coordinate vector or a coordinate geometry matrix (see Differential Vector Calculus).  The default corresponds to three-dimensional Cartesian coordinates using successive variables x, y, and z.

Use VECTOR_POTENTIAL to compute a vector potential of a three-element vector.  For example,

VECTOR_POTENTIAL([x, 0, y - z])

simplifies to

[    2           ]
|   y            |
|- ----, - x·z, 0|
[   2            ]

As with POTENTIAL, VECTOR_POTENTIAL takes optional second and third arguments for specifying the starting coordinates and a coordinate geometry matrix.

Vector potentials are unique only to within an arbitrary gradient.  Consequently, two equally valid vector potentials may be quite different.  However, the curls of both vector potentials should be equivalent to the original vector.

Not all vectors have an associated vector potential.  VECTOR_POTENTIAL merely computes a certain line integral involving the given vector.  If there is no vector potential, the curl of the resulting vector will not be equivalent to the original vector.  It is your responsibility to check this.  Alternatively, it may be easier to see if the DIV of the given vector is zero, as is necessary and sufficient for the existence of a vector potential.

Other Vectors and Matrices


Built-in Functions and Constants

This topic provides help on Derive’s built-in mathematical functions and constants.  Utility Function Files describes the numerous functions defined in the utility files distributed with Derive.  Declare Function Definition command and Programming in DERIVE describe how to define your own functions in terms of Derive 's built-in operators, functions, and constants.

Numerous automatic and some optional transformations are used to simplify expressions involving the built-in functions and constants.  To see a demonstration of these simplifications, load the files TRIG.DMO and FUNCTION.DMO using a File > Load File > Demo File command.

Note that these transformations are not applied to an expression until you issue a Simplify command.  Merely entering an expression is not sufficient to force simplification, unless you click on the Simplify button to issue the Author commands.

Some transformations for simplifying the built-in functions are valid only for a restricted domain of values.  For example, it is not valid to simplify LN(x^2)/2 to LN(x) if x is negative.

When simplifying an expression, Derive does not exploit a transformation unless it can determine that the transformation is valid.  This determination depends on the domain of the variables in the expression.  Use the Declare Variable Domain command to restrict the domain of variables so that more transformations can be applied.

Given numeric arguments, the value of most built-in functions is usually an irrational number which therefore cannot be computed exactly.  For example, the square root of most rational numbers is irrational.  So in exact mode, only certain special numeric arguments simplify to rational numbers.  For example, in exact mode SQRT(4/9) simplifies to 2/3, but SQRT(8/9) simplifies to 2·SQRT(2)/3.  You can use the Simplify Approximate command to temporarily change the precision to obtain an approximate result.

Given a complex argument in rectangular form (see the Branch field of the Declare > Simplification Settings command), most built-in functions produce a simplified result that is also in rectangular form.  For example, SQRT(3 - 4·#i) simplifies to 2 - #i.

Exponential Functions

Logarithmic Functions

Trigonometric Functions

Inverse Trigonometric Functions

Hyperbolic Functions

Inverse Hyperbolic Functions

Piecewise Continuous Functions

Complex Variable Functions

Probability Functions

Statistical Functions

Error and Zeta Functions

Financial Functions

Number Theory Functions

Expression Type Functions

Expression Decomposition Functions

Numerical Operators

Relational Operators

Set Operators and Functions

Boolean Constants and Operators

Boolean Functions

Truth Table Functions

Other Help Contents


Exponential Functions

SQRT(z) is the square root of the expression z.  SQRT(z) is equivalent to z^(1/2).  Square roots are displayed using the √ symbol, and can be entered by clicking on the √ on the math symbol toolbar.  If z is a complex expression, then the phase of SQRT(z) in radians lies in the interval (-π/2, π/2].

The rules used to simplify expressions involving square roots take into account the current branch selection (see the Branch field of the Declare > Simplification Settings command) and the declared domain of variables (see the Declare Variable Domain command).

#e is the base of the natural logarithms (2.71828...).  #e displays as ê, and can be entered by clicking on the ê on the math symbol toolbar.  You are free to use the unembellished variable name e to represent energy, eccentricity, etc.

EXP(z) is the exponential of the expression z.  EXP(z) simplifies to ê^z.

Use the Exponential field of the Declare > Simplification Settings command to control the transformations used to simplify expressions involving exponentials.

Other Built-in Functions and Constants


Logarithmic Functions

LN(z) is the principal natural (Napierian) logarithm of the expression z.  For example, LN(ê^3) simplifies to 3.  If z is a complex expression, then the imaginary part of LN(z) lies in the interval (-π, π].

LOG(z, w) is the logarithm of z to the base w.  Thus, LOG(z, 10) is the common logarithm of z.  For example, LOG(8, 2) simplifies to 3.  LOG(z, w) simplifies to LN(z)/LN(w).  LOG(z) simplifies to LN(z).

Note that LN and LOG are well-defined for negative and even complex arguments.  For example, LN(-3) simplifies to LN(3) + πî.

Use the Logarithm field of the Declare > Simplification Settings command to control the transformations used to simplify expressions involving logarithms.

Other Built-in Functions and Constants


Trigonometric Functions

The trigonometric functions take an angle measured in the angular unit (degree or radian) specified by the Angular Unit field of the Declare > Simplification Settings command.  The following discussion assumes the angular unit is a radian.

pi is the area of a unit circle (3.14159...).  pi displays as the Greek letter π, and can be entered by clicking on the π on either the Greek or math symbol toolbars.  In exact mode pi remains symbolic; otherwise it simplifies to an approximate value accurate to the current precision.

deg is the number of radians per degree (i.e. π/180).  It displays using the standard symbol for degree.  Multiply an angle measured in degrees by deg to convert it to radians.  For example, 60·deg simplifies to π/3 radians.

SIN(z) is the sine of the angle z.

COS(z) is the cosine of the angle z.

TAN(z) is the tangent of the angle z.  TAN(z) is equal to SIN(z)/COS(z).

COT(z) is the cotangent of the angle z.  COT(z) is equal to COS(z)/SIN(z).

SEC(z) is the secant of the angle z.  SEC(z) simplifies to 1/COS(z).

CSC(z) is the cosecant of the angle z.  CSC(z) simplifies to 1/SIN(z).

Use the Trigonometry field of the Declare > Simplification Settings command to control the application of the angle-sum and multiple-angle trigonometric transformations during subsequent simplifications.

Use the Trig Powers field of the Declare > Simplification Settings command to control the transformation of powers of sines into cosines and vice versa.

If you want cosecants and secants in simplified results, use the Simplify > Subexpression Substitution command to replace reciprocals of sines and cosines by cosecants and secants.

Other Built-in Functions and Constants


Inverse Trigonometric Functions

The inverse trigonometric functions return an angle measured in the angular unit (degree or radian) specified by the Angular Unit field of the Declare > Simplification Settings command.  The following discussion assumes the angular unit is a radian.

ATAN(z) is the principal arctangent of z (i.e. the angle whose tangent is z).  ATAN(y, x) is the angle of the point (x, y) in the x-y plane measured counterclockwise from the positive x-axis.  ATAN(y, x) function simplifies to an equivalent expression using the single-argument ATAN function.

Note that the order of the arguments to ATAN(y, x) is opposite to the usual coordinate pair order.  You can remember this by noting that ATAN(y, x) equals ATAN(y/x) if x is positive.  If x is real, than ATAN(x) lies in the closed-interval [-π/2, π/2].  If x and y are real, then ATAN(y, x) lies in the interval (-π, π].

ACOT(z) is the principal arccotangent of z (i.e. the angle whose cotangent is z).  ACOT(x, y) is the angle of the point (x, y).  ACOT(z) simplifies to π/2 - ATAN(z).  ACOT(x, y) simplifies to ATAN(y, x), which is further transformed as described above.  If x is real, then ACOT(x) lies in the closed-interval [0, π].  If x and y are real, then ACOT(x, y) lies in the interval (-π, π].

ASIN(z) is the principal arcsine of z.  If x is in the interval [-1, 1], then ASIN(x) lies in the closed-interval [-π/2, π/2].

ACOS(z) is the principal arccosine of z.  ACOS(z) simplifies to π/2 - ASIN(z) which is further transformed as described above.  If x is in the interval [-1, 1], then ACOS(x) lies in the closed-interval [0, π].

ASEC(z) is the arcsecant of z.  ASEC(z) simplifies to ACOS(1/z), which is further transformed as described above.

ACSC(z) is the arccosecant of z.  ACSC(z) is replaced by ASIN(1/z), which is further transformed as described above.

Other Built-in Functions and Constants


Hyperbolic Functions

The hyperbolic functions simplify to equivalent expressions involving exponentials.

SINH(z) is the hyperbolic sine of z.  SINH(z) simplifies to

  z      -z
 ê      ê
———— - —————
  2      2

COSH(z) is the hyperbolic cosine of z.  COSH(z) simplifies to

  z      -z
 ê      ê
———— + —————
  2      2

TANH(z) is the hyperbolic tangent of z.  TANH(z) simplifies to

  2·z
 ê    - 1
——————————
  2·z
 ê    + 1

COTH(z) is the hyperbolic cotangent of z.  COTH(z) simplifies to

  2·z
 ê    + 1
——————————
  2·z
 ê    - 1

SECH(z) is the hyperbolic secant of z.  SECH(z) simplifies to

      z
   2·ê
——————————
  2·z
 ê    + 1

CSCH(z) is the hyperbolic cosecant of z.  CSCH(z) simplifies to

      z
   2·ê
——————————
  2·z
 ê    - 1

Other Built-in Functions and Constants


Inverse Hyperbolic Functions

The inverse hyperbolic functions simplify to equivalent expressions involving logarithms.  The following simplified results assume that domain of z has been declared complex.

ASINH(z) is the inverse hyperbolic sine of z.  ASINH(z) simplifies to

      2
LN(√(z  + 1) + z)

ACOSH(z) is the inverse hyperbolic cosine of z.  ACOSH(z) simplifies to

2·LN(√(z - 1) + √(z + 1)) - LN(2)

ATANH(z) is the inverse hyperbolic tangent of z.  ATANH(z) simplifies to

 LN(z + 1)     LN(1 - z)
——————————— - ———————————
     2             2

ACOTH(z) is the inverse hyperbolic cotangent of z.  ACOTH(z) simplifies to

     z + 1
 LN(———————)
     z - 1
—————————————
      2

ASECH(z) is the inverse hyperbolic secant of z.  ASECH(z) simplifies to

        1 - z        z + 1
2·LN(√(———————) + √(———————)) - LN(2)
          z            z

ACSCH(z) is the inverse hyperbolic cosecant of z.  ACSCH(z) simplifies to

          2
         z  + 1
    z·√(————————) + 1
            2
           z
LN(———————————————————)
            z

Other Built-in Functions and Constants


Piecewise Continuous Functions

This topic describes the functions used for defining functions in a piecewise manner and how these functions handle real arguments.  Complex Variable Functions describes how they handle complex arguments.  Note that the rules used to simplify expressions involving these functions take into account the user-declared domain of variables (see the Declare Variable Domain command).

ABS(x) simplifies to the absolute value of x.  An absolute value can be entered and is displayed using vertical bars to delimit the argument.  Hence if x is 0 or a positive number, |x| simplifies to x.  If x is a negative number, |x| simplifies to -x.

SIGN(x) simplifies to the sign of x.  Hence if x is a positive number, SIGN(x) simplifies to 1.  If x is a negative number, SIGN(x) simplifies to -1.  Since the sign of 0 is indeterminate, SIGN(0) simplifies to plus-or-minus 1.

The functions MIN and MAX can take any number of arguments, a vector, or a matrix.  If given a vector (see Vectors and Matrices), they are applied to the elements of the vector.  If given a matrix, they are applied to the rows of the matrix, and the results are returned as a vector.

MAX(x1, x2, ..., xn) simplifies to the maximum value of its arguments.  MAX(x , y) simplifies to the equivalent expression ABS(x-y)/2 + (x+y)/2.

MIN(x1, x2 ,..., xn) simplifies to the minimum value of its arguments.  MIN(x, y) simplifies to the equivalent expression (x+y)/2 - ABS(x-y)/2.

STEP(x), the unit step function, simplifies to 1 if x > 0; and to 0 if x < 0.  If the sign of x cannot be determined, STEP(x) simplifies to (SIGN(x)+1)/2.

CHI, the piecewise indicator function, is defined as follows:

•	CHI(a, x, b) simplifies to 1 if a < x < b; to 0 if x < a < b or if a < b < x; and to -CHI(b, x, a) if b < a.  If the relation between a, b, and x cannot be determined, CHI(a, x, b) simplifies to SIGN(x-a)/2 - SIGN(x-b)/2.

•	CHI(x) simplifies to CHI(0, x, 1).

•	CHI(a, x) simplifies to CHI(a, x, 1).

•	CHI(a, x, b, c) simplifies to c if x = a; to 1-c if x = b; otherwise it simplifies to CHI(a, x, b).

•	CHI(a, x, b, c, d) simplifies to c if x = a; to d if x = b; otherwise it simplifies to CHI(a, x, b).

FLOOR(m) simplifies to the greatest integer less than or equal to m.  If m is nonnegative, this is equivalent to the integer-part of m.  FLOOR(m, n) is equivalent to FLOOR(m/n) but is slightly more efficient.  For example,

FLOOR(5.73)

FLOOR(573, 100)

both simplify to 5.

CEILING(m) simplifies to the smallest integer greater than or equal to m.  CEILING(m, n) is equivalent to CEILING(m/n) but is slightly more efficient.  If m or n are not numbers, CEILING(m, n) simplifies to the equivalent expression  - FLOOR(- m/n).  For example,

CEILING(5.73)

CEILING(573, 100)

both simplify to 6.

ROUND(m) simplifies to the nearest integer to m.  ROUND(m, n) is equivalent to ROUND(m/n) but is slightly more efficient.  For example,

ROUND(5.73)

ROUND(573, 100)

both simplify to 6.

MOD(m, n) simplifies to m modulo n (i.e. the nonnegative remainder of m/n).  MOD(m, 0) simplifies to m.  Since n defaults to 1, MOD(m) simplifies to the fractional-part of m.  For example,

MOD(5.73)

MOD(573, 100)

simplify to 73/100 and 73, respectively.  If m, n>0, and p>0 are integers, MOD(m^p, n) is computed efficiently using the power-mod algorithm to raise m to the power p modulo n.  For example,

VECTOR(MOD(3^(10^n),10007),n,1,10)

simplifies to [9014, 4995, 6823, 5079, 2749, 8517, 594, 6074, 7480, 493].

MODS(m, n) simplifies to the symmetric m modulo n which will be in the half-open interval [-n/2,n/2).  MODS(m, 0) simplifies to m.  n defaults to 1.

MODS(5.73)

MODS(573, 100)

simplify to -27/100 and -27, respectively.  If m, n>0, and p>0 are integers, MODS(m^p, n) is computed efficiently using the power-mod algorithm to raise m to the power p modulo n.  For example,

VECTOR(MODS(3^(10^n),10007),n,1,10)

simplifies to [-993, 4995, -3184, -4928, 2749, -1490, 594, -3933, -2527, 493].

POLY_MOD(u, n) simplifies to the polynomial whose coefficients are those of u reduced by the modulus n, where n is an integer and u is a polynomial having numeric coefficients.

POLY_MODS(u, n) simplifies to the polynomial whose coefficients are those of u reduced by the symmetric modulus n, where n is an integer and u is a polynomial having numeric coefficients.

Other Built-in Functions and Constants


Complex Variable Functions

The rules used to simplify expressions involving the complex variable functions take into account the current branch selection (see the Branch field of the Declare > Simplification Settings command) and the user-declared domain of variables (see the Declare Variable Domain command).

#i is the imaginary unit, SQRT(-1).  #i displays as î, and can be entered by clicking on the î on the math symbol toolbar.  You are free to use the unembellished variable name i to represent electrical current, interest, etc.

unit_circle represents some arbitrary point on the unit circle in the complex plane.  For instance, 1, -1, î, and -î are points on the unit circle.  unit_circle may arise in limit problems or when solving equations.  For example, if z is declared complex (see the Declare Variable Domain command), solving the equation |z| = 2 for z gives z = 2·unit_circle.

ABS(z) simplifies to the absolute value (also called magnitude or modulus) of z.  The absolute value of z is the distance between z and the origin of the complex plane.  An absolute value can be entered and is displayed using vertical bars to delimit the argument.  Hence if x and y are real,

|x + î·y|

simplifies to

   2    2
√(x  + y )

SIGN(z) simplifies to the point on the unit circle in the complex plane that has the same phase angle as z.  For example,

SIGN(3 + 4·î)

simplifies to

 3     4·î
——— + —————
 5      5

RE(z) simplifies to the real part of z.  Hence if x and y are real, RE(x + îy) simplifies to x.

IM(z) simplifies to the imaginary part of z.  Hence if x and y are real, IM(x + îy) simplifies to y.

CONJ(z) simplifies to the complex conjugate of z.  Hence if x and y are real, CONJ(x+îy) simplifies to x - îy.

PHASE(z) simplifies to the principal phase angle of z, measured counterclockwise from the positive x-axis.  The angle is measured in the angular unit (degree or radian) specified by the Angular Unit field of the Declare > Simplification Settings command.  Thus if the angular unit is a radian, PHASE(z) lies in the interval (-π, π] for any z in the complex plane.

Other Built-in Functions and Constants


Probability Functions

The functions in this topic are useful for solving probability problems.

euler_gamma is Euler's γ (gamma) constant.  The constant can be entered by typing euler_gamma on the expression entry line.  The lower case Greek letter γ (gamma) on the Greek symbol toolbar is not associated with Euler's gamma constant, so that γ can be used as the name of a user-defined variable or function.  In exact mode arithmetic, euler_gamma remains symbolic since it is an irrational number.  In approximate or mixed mode arithmetic, it simplifies to an approximation for γ accurate to the current precision.  For example,

APPROX(euler_gamma, 25)

simplifies to 0.5772156649015328606065121.

z! is the factorial function z!, defined for all real and complex z.  If n is a positive integer, n! is the product of the first n integers.  For example,

VECTOR(k!, k, 0, 9)

simplifies to

[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]

and

(3/2)!

simplifies to

 3·√π
——————
   4

GAMMA(z) is the gamma function Γ(z), defined for all real and complex z.  If z is nonnumeric, Γ(z) simplifies to z-1 factorial.  The function can be entered by typing GAMMA on the expression entry line, or by clicking on the capital Greek letter Γ (Gamma) on the Greek symbol toolbar.  The incomplete gamma function and its relatives are defined in PROBABIL.MTH.  For example,

VECTOR(GAMMA(k), k, 1, 10)

simplifies to

[1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]

DIGAMMA(z) is the digamma function Ψ(z).  Ψ(z) is defined as the first derivative of the natural logarithm of Γ(z).  The function can be entered by typing DIGAMMA on the expression entry line.  The capital Greek letter Ψ (Psi) on the Greek symbol toolbar is not associated with the digamma function, so that Ψ can be used as the name of a user-defined variable or function.  If k is a nonnegative integer, Σ(1/n, n, 1, k) equals Ψ(k+1) + γ (Euler's gamma constant).  For example,

VECTOR(DIGAMMA(k + 1) + euler_gamma, k, 0, 7)

simplifies to

       3    11    25    137    49    363
0, 1, ———, ————, ————, —————, ————, —————
       2     6    12     60    20    140

PERM(m, n) is the number of permutations or arrangements of m things taken n at a time.  If z and w are nonnumeric, PERM(z, w) simplifies to z!/(z-w)!.  For example,

PERM(n, n)

simplifies to n!.

COMB(m, n) is the number of combinations or groupings of m things taken n at a time.  If z and w are nonnumeric, COMB(z, w) simplifies to z!/(w!·(z-w)!).  Note that COMB(m, n) is also the binomial coefficient of m and n.  For example,

VECTOR(VECTOR(COMB(j, k), k, 0, 8), j, 0, 8)

simplifies to the first 9 rows of Pascal's triangle.

RANDOM(n) invokes a pseudo-random number generator.  Random numbers are derived from a random number state variable, s, that is updated using the rule 2654435721·s + 1 mod 2^32 each time a random number is generated.

•	If n>1 is an integer, RANDOM(n) simplifies to a random integer in the interval [0, n).  For example, each time RANDOM(6) is simplified, it returns with equal probability one of the 6 integers from the set {0, 1, 2, 3, 4, 5}.

•	RANDOM(1) simplifies to a random number in the interval [0, 1).

•	If n<0 is an integer, RANDOM(n) simplifies to -n and initializes the random number state variable to -n.

•	RANDOM(0) simplifies to the time in centiseconds since the current calendar year began and initializes the random number state variable to that time.

Other Built-in Functions and Constants


Statistical Functions

The functions in this topic are useful for solving statistical problems.  The first four can take any number of arguments, a vector, or a matrix.  If given a vector (see Vectors and Matrices), the function is applied to the elements of the vector.  If given a matrix, the function is applied to the rows of the matrix, and the results are returned as a vector.

AVERAGE(z1, z2, ..., zn) is the arithmetic mean or average of z1, z2, ..., zn.  AVERAGE(z1, z2, ..., zn) simplifies to the sum of zi divided by n.  For example, both the expressions AVERAGE(2, 3, 4) and AVERAGE([2, 3, 4]) simplify to 3.

RMS(z1, z2, ..., zn) is the root mean square of z1, z2, ..., zn.  RMS(z1, z2, ..., zn) simplifies to the square-root of the sum of the squares of zi divided by n.  For example, RMS(3, 4, 5) simplifies to 5·SQRT(6)/3.

VARIANCE(z1, z2, ..., zn) is the unbiased sample variance of z1, z2, ..., zn.

STDEV(z1, z2, ..., zn) is the sample standard deviation of z1, z2, ..., zn.  STDEV(z1, z2, ..., zn) simplifies to the square-root of the variance of zn.

FIT(v, A) returns the least squares fit of a parameterized expression in label vector v to the set of points in the data matrix A.  A least squares fit minimizes the sum of the squares of the discrepancies at the points.

The elements of the label vector are the data variables followed by the parameterized expression.  The expression should depend on the data variables and one or more parametric variables.  The dependence on the parametric variables should be linear (i.e. if p is a parametric variable, the expression must be of the form  r·p+s,  where r and s are expressions independent of p).  The expression's dependence on the data variables need not be linear.

The elements of each row of the data matrix are the numeric values of the data variables and the corresponding numeric value of the expression given in the label vector.  The data values on each row must correspond one-to-one with the elements of the label vector.

When the number of data matrix rows equals the number of parametric variables, FIT returns an expression that exactly fits the data, to within roundoff error.  When the number of data matrix rows exceeds the number of parametric variables, FIT returns an expression that is a least squares fit to the data.

Note that the dependence on the data variables need not be linear even though the dependence on the parametric variables must be linear.

Even though the dependence on the parametric variables in a parameterized expression is nonlinear, it may be possible to transform the expression so the dependence is linear.

For example, to fit  a ê^(b x)  to a set of data points, first transform it to LN(a)+b x by taking its natural logarithm.  Then if LN(a) is replaced by a' in the transformed expression, FIT can be used to find the a' and b that give the best fit of the transformed expression to the natural logarithm of the original data points.  Finally, approximate ê^a' to find a.

Other Built-in Functions and Constants


Error and Zeta Functions

The error and Riemann zeta functions frequently occur in probability and statistics problems.

ERF(z) is the integral of the Gaussian distribution from 0 to z.

ERF(z, w) is the generalized error function.  ERF(z, w) is defined as the integral of the Gaussian distribution from z to w.  ERF(z, w) simplifies to ERF(w) - ERF(z).

ERFC(z) is the complementary error function.  ERFC(z) simplifies to 1-ERF(z).

NORMAL(z, m, s) is the normal distribution function of z with mean m and standard deviation s.  m defaults to 0 and s defaults to 1.  This makes NORMAL(z) equivalent to the cumulative distribution function.

ZETA(s) is the Riemann zeta function ζ(s).  If the real part of s is greater than 1, ζ(s) is defined as Σ(1/k^s, k, 1, ∞); otherwise, it is defined by analytic continuation over the rest of the complex plane.  The function can be entered by typing ZETA on the expression entry line, or by clicking on the lowercase Greek letter ζ (zeta) on the Greek symbol toolbar.  ζ(s) simplifies to an exact closed form value if one is known.  For example,

VECTOR(ZETA(s), s, -4, 4)

simplifies to

                                 2           4
     1           1      1       π           π
0, —————, 0, - ————, - ———, ∞, ————, ζ(3), ————
    120         12      2        6          90

If s is a real or complex number, ζ(s) approximates to a numerical value.

ZETA(s, z) is the Hurwitz or generalized zeta function ζ(s, z).  If the real part of s is greater than 1, ζ(s, z) is defined as Σ(1/(k+z)^s, k, 0, ∞); otherwise, it is defined by analytic continuation over the rest of the complex plane.  Note that ζ(s, 1) is equal to ζ(s) for all s.  ζ(s, z) simplifies to an exact closed form value if one is known.  For example,

VECTOR(ZETA(s, 1/2), s, -4, 4)

simplifies to

                             2             4
       7         1          π             π
0, - —————, 0, ————, 0, ∞, ————, 7·ζ(3), ————
      960       24           2             6

A function for approximating ζ(s, z) is defined in the ZETA.MTH utility file.

Other Built-in Functions and Constants


Financial Functions

An annuity is a loan, mortgage, or similar contract to make fixed payments of money at regular intervals over a certain period of time in exchange for a sum of money.  Interest is paid on the money at a fixed rate and is compounded each interval.

Derive 's financial functions are based on the equation

                            n
       n    p·(1+i·t)·((1+i)  - 1)
v·(1+i)  + ———————————————————————— + f = 0
                       i

that applies to an annuity with a present value v in which a fixed payment p is paid for n regular periods at a periodic interest rate of i with a future value of f.  Positive numbers represent money you receive; negative numbers represent money you pay out.

The financial functions have an optional fifth argument t, the time of payment.  Make this argument 0 if the payments are made at the end of each period, 1 if the payments are made at the beginning of each period, or a proportionate fraction between 0 and 1 if the payments are made within each period.  The default value of t is 0, indicating that payments are made at the end of each period.

Because of catastrophic cancellation in the above formula, it is advisable to use 10 or more significant digits of precision when using these functions (see the Precision field of the Declare > Simplification Settings command).

PVAL(i, n, p, f, t) is the present value of the contract.  The future value argument f defaults to 0.

FVAL(i, n, p, v, t) is the future value of the contract.  The present value argument v defaults to 0.

PMT(i, n, v, f, t) is the periodic payment of the contract.  The present value argument v and the future value argument f default to 0.

NPER(i, p, v, f, t) is the number of payment periods.  The present value argument v and the future value argument f default to 0.

RATE(n, p, v, f, t) is the periodic interest rate.  Note that RATE returns the interest rate per period, not necessarily the annual interest rate.  The present value argument v and the future value argument f default to 0.  If the interest rate is negative or greater than 1 (i.e. 100%), lower and upper bounds on the rate must be entered as the 6th and 7th argument of RATE, respectively.

For example, to compute the monthly payment on a 4 year car loan of $15,000 at a 10% annual interest rate, approximate

PMT(10%/12, 4*12, 15000)

using 10 significant digits of precision.  This gives a monthly payment of -380.4387515.  The amount is negative because it represents an outflow of money.

As another example, to compute the balance of a savings account in 5 years after making an initial deposit of $1,000, making monthly payments of $100 at the beginning of the month, and earning 5.5% annual interest compounded monthly, approximate

FVAL(5.5%/12, 5*12, -100, -1000, 1)

using 10 significant digits of precision.  This gives a future balance of 8235.356459.  The monthly payment and the initial deposit are negative because they represent an outflow of money.

Other Built-in Functions and Constants


Number Theory Functions

The built-in functions in this topic are useful for investigations in number theory.  Additional functions for this purpose are defined in the utility file NUMBER.MTH.

The functions GCD and LCM can take any number of arguments, a vector, or a matrix.  If given a vector (see Vectors and Matrices ), they are applied to the elements of the vector.  If given a matrix, they are applied to the rows of the matrix, and the results are returned as a vector.

GCD(m1, m2, ..., mn) simplifies to the greatest common divisor of the numbers m1, m2, ..., mn.  For example, GCD(6, 15) simplifies to 3.

LCM(m1, m2, ..., mn) simplifies to the least common multiple of the numbers m1, m2, ..., mn.  For example, LCM([6, 15, 14]) simplifies to 210.  If m or n are not numbers, LCM(m, n) simplifies to the equivalent expression ABS(m·n)/GCD(n, m).

INVERSE_MOD(a, m) simplifies to the inverse of a mod m if it exists, and a question mark otherwise.  For example, to determine the inverse of 37 mod 53, simplify the expression

INVERSE_MOD(37, 53)

POWER_MOD(a, n, m) returns a^n mod m.  For example, to raise 2 to the 500th power mod 100, simplify the expression

POWER_MOD(2, 500, 100)

PRIME?(m) simplifies to true if m is a prime; to false if m is a non-prime number; otherwise it does not simplify further.  A prime is an integer greater than 1 and divisible only by itself and 1.  The methods used to test primality include the prime number sieve, the Rabin-Miller primality test, and the Lucas primality test.  For example,

PRIME?(22564845703)

simplifies to false, since 22564845703 equals 106219 · 212437.

NEXT_PRIME(m) simplifies to the next prime larger than the number m.  It uses the same primality tests as the function PRIME?.  For example,

NEXT_PRIME(1000)

simplifies to 1009.

PREVIOUS_PRIME(m) simplifies to the first prime number smaller than the number m, if one exists; otherwise it simplifies to ?.  It uses the same primality tests as the function PRIME?.  For example,

PREVIOUS_PRIME(1000)

simplifies to 997.

Other Built-in Functions and Constants


Expression Type Functions

The functions in this topic are primarily used when writing Derive function definitions to determine the data type of expressions.  By convention, the function names includes a ? to emphasize that they are predicates that return a truth-value (i.e. true or false).

INTEGER?(u) simplifies to true if u is an integer; otherwise it simplifies to false.  For example, 5, 0, -1, and 3 are integers.

RATIONAL?(u) simplifies to true if u is rational number (including integers); otherwise it simplifies to false.  For example, 2/3, -7/2, 5, and 0 are rational numbers.

EVEN?(u) simplifies to true if u is an even number (including fractions whose numerator or denominator is even); otherwise it simplifies to false.  For example, 4, 0, -6, 2/3, and 3/2 are even numbers.

ODD?(u) simplifies to true if u is an odd number (including fractions whose numerator and denominator is odd); otherwise it simplifies to false.  For example, 1, -7, and 3/5 are odd numbers.

NUMBER?(u) simplifies to true if u is a real or complex number; otherwise it simplifies to false.  For example, 3, -2/3, 2·î, and 3-5·î are numbers.

VARIABLE?(u) simplifies to true if u is a variable; otherwise it simplifies to false.  For example, x, a, and Real are variables.

STRING?(u) simplifies to true if u is a string variable; otherwise it simplifies to false.  For example, "a=b" and "Derive" are string variables.

SUM?(u) simplifies to true if u is a sum; otherwise it simplifies to false.  For example, x+y and x-y are sums.

PRODUCT?(u) simplifies to true if u is a product; otherwise it simplifies to false.  For example, x·y and x/y are products.

POWER?(u) simplifies to true if u is a power having a numeric degree; otherwise it simplifies to false.  For example, x^2 and SQRT(x) are powers.

VECTOR?(u) simplifies to true if u is a vector (including matrices); otherwise it simplifies to false.  For example, [a, b, c] and [a, b; c, d] are vectors.

SET?(u) simplifies to true if u is a set; otherwise it simplifies to false.  For example, {a, b, c} and { } are sets.

LOGICAL?(u) simplifies to true if u is a logical truth-value; otherwise it simplifies to false.  true and false are the only two truth-values.

INTEGER_TYPE?(u) simplifies to true if the data type of u is an integer; otherwise it simplifies to false.  For example, the data type of 3, FLOOR(x), and SIGN(x) is integer.

REAL_TYPE?(u) simplifies to true if the data type of u is a real number; otherwise it simplifies to false.  For example, the data type of 3, -2/3, x+y, and SIN(x)  is real.

NUMBER_TYPE?(u) simplifies to true if the data type of u is a real or complex number; otherwise it simplifies to false.  For example, the data type of a-3·î, SQRT(x), and LN(x) is a real or complex number.

VECTOR_TYPE?(u) simplifies to true if the data type of u is a vector; otherwise it simplifies to false.  For example, the data type of [a, b, c] and [a, b; c, d] is vector.

SET_TYPE?(u) simplifies to true if the data type of u is a set; otherwise it simplifies to false.  For example, the data type of {a, b, c} and a UNION b is set.

LOGICAL_TYPE?(u) simplifies to true if the data type of u is a logical truth-value; otherwise it simplifies to false.  For example, the data type of true and p AND q is logical.

IDENTICAL?(u, v) simplifies to true if u is identical to v; otherwise it simplifies to false.

Other Built-in Functions and Constants


Expression Decomposition Functions

The built-in functions in this topic are useful for decomposing expressions into their component parts.  Some of the functions require that their arguments be polynomials or numbers.

NUMERATOR(u) returns the numerator of the numeric or symbolic expression u.  To put an expression over a common denominator before calling NUMERATOR, trivially factor it using the Simplify > Factor command or the FACTOR function.  For example,

NUMERATOR(FACTOR(a/b + c/d, Trivial, a))

simplifies to a·d + b·c.

DENOMINATOR(u) returns the denominator of the numeric or symbolic expression u.  To put an expression over a common denominator before calling DENOMINATOR, trivially factor it using the Simplify > Factor command or the FACTOR function.  For example,

DENOMINATOR(FACTOR(a/b + c/d, Trivial, a))

simplifies to b·d.

QUOTIENT(u, v) returns the polynomial quotient of u divided by v, where u and v are polynomials.  For example,

QUOTIENT(x^4 + 3·x^3 + 5·x + 6, x^2 - 5)

simplifies to x^2 + 3·x + 5.  QUOTIENT(u, v, x) returns the polynomial quotient of u divided by v, where u and v are polynomials in the variable x.  Use the FLOOR function to find quotients over the ring Z of integers (for details, see the Piecewise Continuous Functions).

REMAINDER(u, v) returns the polynomial remainder of u divided by v, where u and v are polynomials.  For example,

REMAINDER(x^4 + 3·x^3 + 5·x + 6, x^2 - 5)

simplifies to 20·x + 31.  REMAINDER(u, v, x) returns the polynomial remainder of u divided by v, where u and v are polynomials in the variable x.  Use the MOD function to find remainders over the ring Z of integers (for details, see the Piecewise Continuous Functions).

POLY_GCD(u, v) returns the polynomial greatest common divisor (gcd) of u and v, where u and v are polynomials.  For example,

POLY_GCD(x^3 + 3·x^2 + 5·x + 6, x^3 + 2·x - 3)

simplifies to x^2 + x + 3.  Use the GCD function to find gcds over the ring Z of integers (for details, see the Number Theory Functions).

TERMS(u) returns the terms of the expression u as a vector.  If v is a set or vector of expressions, TERMS(v) distributes over the elements of v.  TERMS(u, amount, x, y, ...) actively expands the polynomial or rational function u by amount with respect to the variables x, y, ... just like the EXPAND function (see the Simplify > Expand command), but TERMS returns the result as a vector of terms.  The amount can be Trivial, Squarefree, Rational, or raDical.  For example,

TERMS((x + y + z)^2, Trivial, x, y, z)

simplifies to

 2                 2          2
x , 2·x·y, 2·x·z, y , 2·y·z, z

If u is a Boolean expression, TERMS(u) returns the disjuncts of u as a vector (see the Boolean Functions for details).

FACTORS(n) returns the prime factorization of the integer or rational number n as a vector of pairs of primes and their powers.  The methods used to factor numbers include trial division, perfect power testing, Pollard/Brent's ρ (rho), Pollard's p-1, William's p+1, and Lenstra's elliptic curve method.  For example, to determine the prime factorization of 10 factorial, simplify the expression

FACTORS(10!)

FACTORS(u) returns the factors of the nonnumeric expression u as a vector of base-degree pairs.  If v is a set or vector of expressions, FACTORS(v) distributes over the elements of v.  FACTORS(u, amount, x, y, ...) actively factors the polynomial or rational function u by amount with respect to the variables x, y, ... just like the FACTOR function (see the Simplify > Factor command), but FACTORS returns the result as a vector of base-degree pairs.  The amount can be Trivial, Squarefree, Rational, raDical, or Complex.  For example,

FACTORS(4·x^3 - 8·x^2 - 11·x - 3, Rational, x)

simplifies to

 2·x + 1  2

  x - 3   1

If u is a Boolean expression, FACTORS(u) returns the conjuncts of u as a vector (see the Boolean Functions for details).

VARIABLES(u) returns a vector of the free variables of u ordered from most to least main.

LHS(u) returns the Left Hand Side (i.e. the left operand) of u if it is an equation, inequality, conjunction, disjunction, union, or intersection.  If u is a vector, LHS(u) returns a vector consisting of the Left Hand Sides of the elements of u.  For example,

LHS([2·x + y = 5, x < y - 3, NOT p AND q, a UNION b])

simplifies to

[2·x + y, x, ¬ p, a]

RHS(u) returns the Right Hand Side (i.e. the right operand) of u if it is an equation, inequality, conjunction, disjunction, union, or intersection.  If u is a vector, RHS(u) returns a vector consisting of the Right Hand Sides of the elements of u.  For example,

RHS([2·x + y = 5, x < y - 3, NOT p AND q, a UNION b])

simplifies to

[5, y - 3, q, b]

Other Built-in Functions and Constants


Numerical Operators

Use the standard symbols for entering the four basic mathematical operators:

•	+ (plus operator) is used to denote addition.

•	− (minus operator) is used to denote subtraction or negation.

•	∗ (times operator) is used to denote multiplication.  Derive normally uses a small centered dot to display a product.

•	/ (division operator) is used to denote division.  Derive normally uses a built-up fraction to display a quotient.

These binary infix operators are placed between their operands.  + and − can also be unary prefix operators and be placed before a single operand.

You can use parentheses, ( ), to control the order in which operators are applied.  Brackets, [ ], and braces, { }, are not equivalent to parentheses and can not be used to control the order of application of operators or to enclose the arguments of functions.  Instead, brackets are used for entering vectors and matrices.  Braces are used for entering sets.

∗ and / have a higher operator precedence than + and −.  In the absence of parentheses, operators with higher precedence are applied before operators with lower precedence.  For example, entering 3 + 4 ∗ 5 is equivalent to 3 + (4 ∗ 5) rather than (3 + 4) ∗ 5.

+ and − have equal precedence, as do ∗ and /.  In the absence of parentheses, operators with equal precedence are applied left to right.  For example, entering 1 / 2 ∗ 3 is equivalent to (1 / 2) ∗ 3 rather than 1 / (2 ∗ 3).

Instead of using ∗ to indicate multiplication, you can separate two expressions with one or more spaces and/or parentheses to implicitly indicate implicit multiplication.  For example, entering 2 (3 + 5) is equivalent to 2 ∗ (3 + 5).

Sometimes books print rational numbers as an integer followed by the fractional part.  For example, 3.5 is printed as 3 1/2.  This is short for 3 plus 1/2, not 3 times 1/2.  In Derive, use the + operator between the integer and fractional part of a number to prevent it from being interpreted as implicit multiplication.  For example, enter 3 1/2 − 2 1/4 as (3+1/2) − (2+1/4).

•	^ (exponentiation  operator) is used to denote exponentiation  (raising an expression to a power).  Derive normally uses a raised exponent to indicate exponentiation.

The exponentiation operator is a binary infix operator that is placed between its operands.  On most keyboards "^" is entered by pressing "6" while holding down the shift key.  For example, 3 squared (i.e. 3²) is entered as 3^2.

^ has a higher precedence than +, −, ∗, and /.  Thus operands of ^ that include these operators should be enclosed in parentheses.  For example, the cube root of 9 (i.e. 9 to the 1/3 power) must be entered as 9^(1/3) rather than 9^1/3.

Unlike other operators, ^ associates to the right.  Thus in the absence of parentheses, successive ^ operators are applied right to left.  For example, entering 4^3^2 is equivalent to 4^(3^2) rather than (4^3)^2.

The ^ operator can also be used to enter numbers in scientific notation.  For example, the number 6.02  times 10 to the 23rd can be entered as 6.02 ∗ 10^23.

•	% (percent operator) is used to denote percentage (one hundredth of an expression).

This postfix operator is placed after its operand.  For example, 22% + 36% is equal to 0.58.

The % operator has a higher precedence than any of the operators discussed above.

Other Built-in Functions and Constants


Relational Operators

Equations and inequalities are in a class of expressions called relations.  In Derive a relation consists of two expressions separated by a relational operator.  The following table summarizes the relational operators and the one or two characters required to type in the operator on the expression entry line.

=	=	equal operator

≠	/=	not equal operator

<	<	less than operator

≤	<=	less than or equal operator

>	>	greater than operator

≥	>=	greater than or equal operator

The relational operators can also be entered by clicking on them on the math symbol toolbar.  The relational operators are binary infix operators.  Thus to enter a relation, enter the left operand, the relational operator, and then the right operand.

Use the Simplify commands to independently simplify the two sides of a relation.  For example, the equation

x + 2·x = c + x·x

simplifies to

       2
3·x = x  + c

Use the Solve commands to solve individual or systems of equations and inequalities for one or more variables.  For example,

SOLVE(x + 2·x = c + x·x, x)

simplifies to

     3 - √(9 - 4·c)           √(9 - 4·c) + 3
x = ————————————————  ∨  x = ————————————————
            2                        2

Alternatively, you can solve equations and inequalities in a step-by-step manner for pedagogical reasons (see Step-by-Step Equation Solving).

Relations are not automatically regarded as simultaneous facts, and they are not automatically tested for truth or consistency.  Think of a Derive worksheet as a blackboard containing relatively independent expressions, including relations.  Some of these expressions may be derived from earlier ones.  However, others may have no relation to each other.  Variables may mean different things in different parts of a problem or a set of problems.  You can choose to combine subsets of these expressions (see Entering Mathematical Expressions), while ignoring other perhaps contradictory expressions.

Other Built-in Functions and Constants


Set Operators and Functions

Sets are entered as a list of elements separated by commas and enclosed in braces.  For example,  the empty set is entered as {}.  Ellipses can be used to shorten the entry of sets.  For example,

{1,...,10}

simplifies to

{1,2,3,4,5,6,7,8,9,10}

and

{1,3,...,10}

simplifies to

{1,3,5,7,9}

Set operators make it possible to combine sets.  The following set operators are built into Derive:

•	s` is the complement of s.  ` is a postfix operator.  The complement operator can be entered by clicking on the ` on the math symbol toolbar or by typing ` on the keyboard.  Derive just uses the complement operator for algebraically simplifying expressions involving sets, since the complement of a finite set is not representable.  For example,

s``

simplifies to s and

(s UNION t)`

simplifies to

s` ∩ t`

•	s ∩ t is the intersection of s and t.  ∩ is a binary infix set operator.  The intersection operator can be entered by clicking on the ∩ on the math symbol toolbar, by pressing Ctrl+N, or by typing INTERSECTION.  For example,

{1,3,5,7,9} INTERSECTION {2,3,5,8,13}

simplifies to

{3,5}

•	s ∪ t is the union of s and t.  ∪ is a binary infix set operator.  The union operator can be entered by clicking on the ∪ on the math symbol toolbar, by pressing Ctrl+U, or by typing UNION.  For example,

{1,3,5,7,9} UNION {2,3,5,8,13}

simplifies to

{1,2,3,5,7,8,9,13}

•	s \ t is the set difference of s and t (i.e. those elements of s not in t).  The difference operator can be entered by clicking on the \ on the math symbol toolbar or typing \ on the keyboard.  For example,

{1,...,10}\{2,3,5,7}

simplifies to

{1,4,6,8,9,10}

As with the Numerical Operators, you can use parentheses to control the order in which set operators are applied.  In the absence of parentheses, set operators with higher precedence are applied before those with lower precedence.  The set operators above are listed in order of decreasing precedence.  For example, entering

r` ∪ s ∩ t

is equivalent to entering

(r`) ∪ (s ∩ t)

Expressions involving set operators may have many logically equivalent forms.  Derive uses the laws of Boolean algebra to simplify expressions involving sets into simpler ones that are equivalent.  The following identities, valid for any sets r, s, and t, are among those used to simplify expressions involving ∩ and ∪:

r ∩ s  ⇐⇒  s ∩ r

r ∪ s  ⇐⇒  s ∪ r

r ∩ (s ∩ t)  ⇐⇒  (r ∩ s) ∩ t

r ∪ (s ∪ t)  ⇐⇒  (r ∪ s) ∪ t

(r ∩ s) ∪ (r ∩ t)  ⇐⇒  r ∩ (s ∪ t)

(r ∪ s) ∩ (r ∪ t)  ⇐⇒  r ∪ (s ∩ t)

The first two identities indicate that ∩ and ∪ are commutative.  The second two indicate that ∩ and ∪ are associative.  The last two indicate that ∩ distributes over ∪, and that ∪ distributes over ∩.  To simplify expressions involving sets, Derive applies the last two identities in the left-to-right direction.

The following identities are among those used to simplify expressions involving the ` complement operator:

s``  ⇐⇒  s

(s ∩ t)`  ⇐⇒  s` ∪ t`

(s ∪ t)`  ⇐⇒  s` ∩ t`

The last two identities, called De Morgan's laws, allow the complement operator to be distributed over the intersection and union operators.  To simplify expressions involving sets, Derive repeatedly applies the above rules to force the complement operator to the lowest level.

Use the function POWER_SET to generate the power set (i.e. all the subsets) of a set.  POWER_SET(s) simplifies to all the subsets of s.  For example,

POWER_SET({a, b, c})

simplifies to

{{}, {c}, {b}, {b, c}, {a}, {a, c}, {a, b}, {a, b, c}}

POWER_SET(s,n) simplifies to all the subsets of s having exactly n elements.  For example,

POWER_SET({a, b, c}, 2)

simplifies to

{{b, c}, {a, c}, {a, b}}

In Derive sets of ordered pairs can be considered to define a function.  In general, if u is a set of vectors and s equals the first element of one of the vectors, then u↓s simplifies to the second element of the vector.  The subscript operator can be entered by clicking on the ↓ on the math symbol toolbar or by typing SUB.  For example,

{[2, 3], [3, 5], [1, 7]} SUB 2

simplifies to 3.

The product of two sets simplifies to the Cartesian product (also called the outer product) of the sets.  For example,

{a, b}*{1, 2}

simplifies to

{[a, 1], [a, 2], [b, 1], [b, 2]}

Other Built-in Functions and Constants


Boolean Constants and Operators

Boolean (logical) constants and operators make it possible to logically combine relations and/or truth-valued variables into Boolean expressions.  The Boolean Functions also operate on such expressions.

The Boolean truth value constants are denoted by true and false.  The following are the Boolean operators:

•	NOT p (displayed as ¬p) is the negation of p.  NOT is a unary prefix Boolean operator.  If p is true, NOT p simplifies to false.  If p is false, NOT p simplifies to true.  For example, NOT x>5 is true if x is not greater than 5 (i.e. if x is less than or equal to 5).

•	p AND q (displayed as p ∧ q) is the conjunction of p and q.  AND is a binary infix Boolean operator.  If both p and q are true, p AND q simplifies to true.  If either p or q or both are false, p AND q simplifies to false.  For example, x<3 AND y=7 is true if both x is less than 3 and y is 7.

•	p OR q (displayed as p ∨ q) is the disjunction (inclusive or) of p and q.  OR is a binary infix Boolean operator.  If either p or q or both are true, p OR q simplifies to true.  If both p and q are false, p OR q simplifies to false.  For example, x<3 OR y=7 is true if either x is less than 3 or y is 7 or both are true.

•	p XOR q is the exclusive or of p and q.  XOR is a binary infix Boolean operator.  If either p or q but not both are true, p XOR q simplifies to true.  If both p and q are false or if both p and q are true, p XOR q simplifies to false.  If the truth values of p and q are unknown, p XOR q simplifies to the equivalent Boolean expression (NOT p AND q) OR (p AND NOT q).

•	p IMP q is a conditional (implication) with antecedent p and consequent q.  IMP is a binary infix Boolean operator.  If p is false or q is true, p IMP q simplifies to true.  If p is true and q is false, p IMP q simplifies to false.  If the truth values of p and q are unknown, p IMP q simplifies to the equivalent Boolean expression NOT p OR q.

•	p IFF q is the logical equivalence of p and q.  IFF (if-and-only-if) is a binary infix Boolean operator.   If both p and q are true or if both p and q are false, p IFF q simplifies to true.   If p is true and q is false or if p is false and q is true, p IFF q simplifies to false.  If the truth values of p and q are unknown, p IFF q simplifies to the equivalent Boolean expression (¬ p OR q) AND (p OR ¬ q).

As with the Numerical Operators, you can use parentheses to control the order in which Boolean operators are applied.  In the absence of parentheses, Boolean operators with higher precedence are applied before those with lower precedence.  The Boolean operators above are listed in order of decreasing precedence.  For example, entering

NOT p OR q AND r

is equivalent to entering

(NOT p) OR (q AND r)

Expressions involving Boolean operators may have many logically equivalent forms.  Derive uses the laws of Boolean algebra to simplify Boolean expressions into simpler ones having the same truth value.  The following identities, valid for any truth values p, q, and r, are among those used to simplify expressions involving AND and OR:

p AND q  ⇐⇒  q AND p

p OR q  ⇐⇒  q OR p

p AND (q AND r)  ⇐⇒  (p AND q) AND r

p OR (q OR r)  ⇐⇒  (p OR q) OR r

p AND q OR p AND r  ⇐⇒  p AND (q OR r)

(p OR q) AND (p OR r)  ⇐⇒  p OR q AND r

The first two identities indicate that AND and OR are commutative.  The second two indicate that AND and OR are associative.  The last two indicate that AND distributes over OR and that OR distributes over AND.  To simplify Boolean expressions, Derive applies the last two identities in the left-to-right direction.  For example,

(x>0 AND y=3) OR (x>0 AND z=5)

simplifies to

(y = 3 ∨ z = 5) ∧ x > 0

and

p AND ((p AND q) OR r)

simplifies to

p ∧ (q ∨ r)

The following transformations are among those used to simplify Boolean expressions involving NOT:

p OR NOT p ⇒ true

p AND NOT p ⇒ false

NOT NOT p  ⇒  p

NOT (p AND q)  ⇒  NOT p  OR  NOT q

NOT (p OR q)  ⇒  NOT p  AND NOT q

The last two identities, called De Morgan's laws, allow NOT to be distributed over conjunctions and disjunctions.  To simplify Boolean expressions, Derive repeatedly applies the above rules to force the NOT operator to the lowest level.

Relations combined by Boolean operators are also simplified when possible.  For example,

6 >= -2·x AND 3·x /= -9

simplifies to

x > -3

When given integer operands, the Boolean (logical) operators perform bit-wise logical operations on the integers.  The operations are performed as if integers are stored using a "half-infinite" two's-complement representation.  For example,

3 OR 5

simplifies to 7, and

NOT 5

simplifies to -6.

Other Built-in Functions and Constants


Boolean Functions

The Boolean functions perform various operations on Boolean expressions and/or return Boolean values.  The Boolean Operators also operate on such expressions.

Derive can expand Boolean expressions into disjunctive normal form or factor them into conjunctive normal form.

The Simplify > Expand command, the EXPAND function, and the TERMS function convert Boolean expressions to disjunctive normal form.  The Simplify > Expand command and the EXPAND function return the result as a Boolean expression.  For example,

EXPAND(p AND (q OR r))

simplifies to

(p ∧ q) ∨ (p ∧ r)

The TERMS function returns the result as a vector of disjuncts.  For example,

TERMS(p AND (q OR r))

simplifies to

[p ∧ q, p ∧ r]

The Simplify > Factor command, the FACTOR function, and the FACTORS function convert Boolean expressions to conjunctive normal form.  The Simplify > Factor command and the FACTOR function return the result as a Boolean expression.  For example,

FACTOR(p OR (q AND r))

simplifies to

(p ∨ q) ∧ (p ∨ r)

The FACTORS function returns the result as a vector of conjuncts.  For example,

FACTORS(p OR (q AND r))

simplifies to

[p ∨ q, p ∨ r]

All the above commands and functions distribute over the elements of sets and vectors.  Thus if v is a Boolean expression, the composition FACTORS(TERMS(v)) simplifies to a vector of vectors (i.e. a matrix) of the literal atoms of the disjunctive normal form of v.  Similarly, the composition TERMS(FACTORS(v)) simplifies to a vector of vectors of the literal atoms of the conjunctive normal form of v.  For example,

TERMS(FACTORS(NOT(NOT(a) OR b) OR NOT(c)))

simplifies to

  a   ¬ c

 ¬ b  ¬ c

If u is a Boolean expression, the predicate function EVERY(u,x,c) evaluates u(x) for x equal to each element of c until a result is false in which case EVERY immediately returns false.  If no result is false, EVERY returns true.  EVERY(u,k,m,n,s) evaluates u(k) for k=m to n in steps of size s until a result is false or all results are true.

Similarly, if u is a Boolean expression, the predicate function SOME(u,x,c) evaluates u(x) for x equal to each element of c until a result is true in which case SOME immediately returns true.  If no result is true, SOME returns false.  SOME(u,k,m,n,s) evaluates u(k) for k=m to n in steps of size s until a result is true or all results are false.

Other Built-in Functions and Constants


Truth Table Functions

A truth table shows each of the truth values of a Boolean expression when its variables are assigned all possible permutations of truth values.  Use the TRUTH_TABLE function to generate a truth table matrix for one or more Boolean expressions.  If p1, p2, ... are truth variables,

TRUTH_TABLE(p1, p2, ..., boolean1, boolean2, ...)

generates a truth table matrix for the Boolean expressions.  For example,

TRUTH_TABLE(p, q, p AND q, p OR q, p XOR q, p IMP q, p IFF q)

simplifies to

   p      q    p ∧ q  p ∨ q  p XOR q  p IMP q  p IFF q

 true   true   true   true    false    true     true

 true   false  false  true    true     false    false

 false  true   false  true    true     true     false

 false  false  false  false   false    true     true

Other Built-in Functions and Constants


Utility File Functions

The utility files distributed with Derive define functions and assign constants that supplement the built-in functions and constants.  When a function in any of the utility files listed below is first used, all the definitions and assignments in the file are automatically loaded.  Then the function is evaluated and returns a value, just like it normally would.

If Derive  needs to autoload a utility file, it looks for the file in the directory specified by the Options > Startup command.  If the file is not there, it looks for the file in the \Math subdirectory created when Derive is installed.  If the file is not there, it looks in the \Math subdirectory of the "Start in" directory (also called the working directory) specified by the properties of the desktop icon used to launch Derive.  To determine the "Start in" directory, right click on the Derive desktop icon and select the "Properties" option.

Utility file can be loaded manually using either the File > Load > Math File command or the File > Load > Utility File command.  If the latter load command is used, the file's function definitions and variable assignments are made, but expressions for the definitions and assignments are not added to the algebra window's worksheet.  However, the definitions and assignments can still be examined using the Declare commands.

ENGLISH.MTH - English Units Conversion

METRIC.MTH - Metric Units Conversion

PHYSICAL.MTH - Physical Constants

SOLVE.MTH - Solving Nonlinear Systems and Complex Solutions

VECTOR.MTH - Additional Vector and Matrix Functions

NUMERIC.MTH - Numerical Differentiation and Integration

DIF_APPS.MTH - Applications of Differentiation

INT_APPS.MTH - Applications of Integration

ODE1.MTH - First-order Ordinary Differential Equations

ODE2.MTH - Second-order Ordinary Differential Equations

ODE_APPR.MTH - Approximate Solution of ODEs

RECUREQN.MTH - Recurrence Equations

APPROX.MTH - Pade Rational Approximation

EXP_INT.MTH - Exponential, Log, Sine, and Cosine Integrals

PROBABIL.MTH - Probability Functions

FRESNEL.MTH - Fresnel Integrals

BESSEL.MTH - Bessel and Airy Functions

HYPERGEO.MTH - Hypergeometric Functions

ELLIPTIC.MTH - Elliptic Integrals

ORTH_POL.MTH - Orthogonal Polynomials

ZETA.MTH - Generalized Riemann Zeta Function

GRAPHICS.MTH - Plotting Space Curves & Complex Expressions

NUMBER.MTH - Number Theory Functions

COMBINAT.MTH - Combinatorial Functions

MISC.MTH - Miscellaneous Utility Functions

Other Help Contents


ENGLISH.MTH - English Units Conversion

The file ENGLISH.MTH assigns values to numerous English units so that expressions involving these units simplify to ones expressed in terms of feet, pounds, and seconds.  Use the File > Load > Math File command to load ENGLISH.MTH and see exactly which units are defined.  Use the File > Load > Utility File command to make the assignments in ENGLISH.MTH without adding expressions to the active worksheet.

For example, if ENGLISH.MTH is loaded,

5·furlong/fortnight

simplifies to

   11·foot
———————
 4032·second

and approximates to

 0.002728174603·foot
————————————
        second

If METRIC.MTH is loaded after ENGLISH.MTH, English units are converted to metric units.  Then, for example,

5·furlong/fortnight

approximates to

 0.0008315476190·meter
—————————————
         second

Other Utility File Functions


METRIC.MTH - Metric Units Conversion

The file METRIC.MTH assigns values to numerous metric units so that expressions involving these units simplify to ones expressed in terms of meters, grams, and seconds.  Use the File > Load > Math File command to load METRIC.MTH and see exactly which units are defined.  Use the File > Load > Utility File command to make the assignments in METRIC.MTH without adding expressions to the active worksheet.

For example, if METRIC.MTH is loaded,

5·milli·erg/century

simplifies to

                  2
        gram·meter
———————————————
                        3
 6311385216000000·second

and approximates to

               -16           2
 1.584438226·10   ·gram·meter
——————————————————
                  3
            second

If ENGLISH.MTH is loaded after METRIC.MTH, metric units are converted to English units.  Then, for example,

5·milli·erg/century

approximates to

               -18     2
 3.759929015·10   ·foot ·pound
——————————————————
                  3
            second

Other Utility File Functions


PHYSICAL.MTH - Physical Constants

The file PHYSICAL.MTH assigns highly accurate values to numerous fundamental physical constants.  Use the File > Load > Math File command to load PHYSICAL.MTH and see exactly which physical constants are defined.  Use the File > Load > Utility File command to make the assignments in PHYSICAL.MTH without adding expressions to the active worksheet.

Other Utility File Functions


SOLVE.MTH - Solving Nonlinear Systems and Complex Solutions

The Solve command and the built-in SOLVE and NSOLVE functions can find real or complex solutions to individual algebraic equations and to systems of polynomial equations using exact and/or approximate methods.  To supplement these capabilities, the file SOLVE.MTH defines functions useful for finding approximate solutions (real or complex) to individual algebraic equations and to systems of algebraic equations using iterative methods.  The function definitions in SOLVE.MTH are automatically loaded when any of its functions are first used.

Given a univariate expression u(x) and an initial guess of x0, Newton's method uses repeated applications of the update formula xnew ← x - u(x)/u(x)'  evaluated at the current value of x to find an x such that u(x) is arbitrarily close to zero.  Newton's method can be used to find an approximate solution of a univariate equation by taking the difference of the two sides of the equation.  Also, the method can be extended to solve a system of m equations dependent on m variables.   Note that Newton's method requires that Derive be able to differentiate the expressions with respect to each of the solution variables.

NEWTON(u, x, x0, n) approximates to a vector of n+1 approximations for the variable x resulting from n applications of Newton's method to the univariate expression u(x) beginning with an initial guess of x0.  NEWTON(u, x, x0) approximates to a vector of the approximations for x until they converge at the current digits of precision.  For example, at 10 digits of precision, the expression

NEWTON(x^2-3, x, 2)

approximates to

[2, 1.75, 1.732142857, 1.732050810, 1.732050810, 1.732050810]

Note that the last element is a good approximation to the square root of 3.

If u is a vector of m expressions, x is a vector of m variables, and x0 is a vector of m initial guesses, NEWTONS(u, x, x0, n) approximates to a matrix of n+1 rows of approximations for the variables of x from n applications of Newton's method to the expressions in u beginning with the initial guesses in x0.  To solve a system of m equations in m variables, call NEWTONS with a vector of the difference in the two sides of each equation, a vector of the m variables, and a vector of the m initial guesses.  For example, to solve the equations exp(x·y) = x + 2·y and atan(x·y) = 2·x+y, approximate the expression

NEWTONS([EXP(x·y)-x-2·y, ATAN(x·y)-2·x-y], [x, y], [-1, -1], 7)

This results in an 8-row by 2-column matrix whose last row is an approximate solution to the equations based on 7 applications of Newton's method.  This solution can be verified by substitution of these values for x and y into the original equations.

NEWTONS(u, x, x0) approximates to a matrix of approximations for the variables of x until all converge at the current digits of precision.  Note that different rational numbers may look the same when displayed in scientific or decimal notation.  For example, the expression

NEWTONS([EXP(x·y)-x-2·y, ATAN(x·y)-2·x-y], [x, y], [-1, -1])

approximates to a matrix having 10 rows at 6 digits of precision and a matrix having 39 rows at 10 digits of precision.

If you are interested in solutions containing complex numbers, use such numbers in the components of the initial guess.  When a complex solution is found, its complex conjugate is often a good guess for another solution since complex solutions often occur in conjugate pairs.

Even if there is a solution, Newton's method may not converge to it unless your initial guess is sufficiently close.  Also, divergence may generate large magnitude numbers that exhaust memory and/or take a long time to abort.  Thus, it is usually best to begin by limiting NEWTONS to a small number of iterations.  Then by examining the last few rows of the resulting matrix, you can determine whether Newton's method is converging.  If convergence does not begin within ten iterations or so, it is usually best to try a different initial guess rather than increasing the number of iterations.

If s is the last row of the resulting matrix, you can approximate the limit of u as x approaches s to determine if the residual is acceptably small.  If s has converged to within roundoff error at the current precision and you want more accuracy, increase the precision by a few digits and use s as your initial guess.  This is usually more efficient than doing the whole calculation at the higher precision.

If Newton's method is taking an unexpectedly long time, the iteration may be diverging.  Abort the computation, and retry using a smaller number of iterations or a better initial guess.

NEWTONS only finds one solution at a time.  To find additional solutions, you can use a different initial guess.  However, NEWTONS may still converge to the solution you already know.  To prevent this, the original system can be reduced to a deflated system of equations.  If the vector [s1, s2, ..., sm] is a solution to the system represented by the vector u, the vector for the deflated system is

u
————————————
(x1-s1) (x2-s2) ... (xm-sm)

If you find a solution to the deflated system, you can apply NEWTONS to the original system using this solution as an initial guess.  This eliminates roundoff error caused by deflation and gives a more accurate, purified solution.

The difficulty of finding sufficiently good initial guesses increases sharply with the number of variables.  Consequently, it is usually wise to eliminate as many variables as possible using the Solve > Expression command before resorting to NEWTONS.

Another way to solve a system of equations approximately is to convert the system to a vector fixed-point form x=g, with g=[g1, g2, ..., gm], where expressions g1 through gm may each depend on any or all of the variables in x=[x1, x2, ..., xm].  You can then substitute the initial guesses for x1 through xm into g to compute updated guesses for x.  You can continue to substitute the most recent set of components into g to compute a more recent set of guess components.

If there is a solution, the magnitudes of the partial derivatives of g1 through gm are small in the neighborhood of the solution, and the initial guess is close to the solution, then fixed-point iteration may converge to the solution and the convergence may occur in an acceptable amount of time.  To compensate for these discouraging provisos, fixed-point iteration does not require differentiability and does not require space to store derivatives, unlike Newton's method.

FIXED_POINT(g, x, x0, n) approximates to an n+1 by m matrix.  g is the vector of expressions [g1, g2, ..., gm].  The other arguments, the returned result, and the usage suggestions are similar to those described for NEWTONS.  For example, use complex numbers in the components of your initial guess if you are interested in complex solutions.

However, FIXED_POINT may diverge no matter how close the initial guess is to an exact solution:  The most important determinants of success are choosing a close enough initial guess and choosing a particular fixed-point form for which g1 through gm have small magnitude partial derivatives near the guess:  Ideally each equation has a portion that is invertible with respect to a distinct variable, and the magnitude of the partial derivative of this portion with respect to that variable is dominant near your guess.  You can then solve each equation for its dominant variable xk in its dominant portion in terms of the other portions to obtain the form xk=gk.  The same variable may occur on the right side too, but weakly.

Even if an equation cannot be solved exactly and extra parameters make it impossible to solve numerically, it may still be possible to find a truncated Taylor series solution.  The series solution can extend an exact or approximate solution at a particular point into a useful neighborhood around the point.  Of course, it is necessary that a truncated series solution exists at the point.

TAYLOR_SOLVE(u, x, y, x0, y0, n) simplifies to an nth degree truncated Taylor series solution y(x) of the equation u(x, y)=0, given u(x0, y0)=0.  For example, since y0=0 at x0=0 is a solution of the equation sin(y) + y + xê^x = 0,

TAYLOR_SOLVE(SIN(y)+y+x·ê^x, x, y, 0, 0, 3)

simplifies to

       3      2
   25·x      x      x
- ------- - ---- - ---
     96       2     2

This is the 3th degree truncated Taylor series solution of the equation expanded about the point y0=0 at x0=0.  Note that it is impossible to solve this transcendental equation exactly for y.  Also the extra parameter x makes it impossible to solve the equation numerically.

TAYLOR_INVERSE(u, x, y, x0, n) simplifies to an nth degree truncated Taylor series expansion of the inverse of the function defined by y=u(x), expanded about y0=u(x0).  This is useful when u(x) cannot be inverted exactly in closed form.  For example,

TAYLOR_INVERSE(x ê^x, x, y, 0, 3)

simplifies to

    3
 3·y      2
------ - y  + y
   2

Other Utility File Functions


VECTOR.MTH - Additional Vector and Matrix Functions

The file VECTOR.MTH defines functions that automate some of the operations commonly performed on vectors and matrices.  The function definitions in VECTOR.MTH are automatically loaded when any of its functions are first used.

Because matrices are just vectors of vectors, any function that operates on the elements of a vector operates similarly on the rows of a matrix.  Moreover, by transposing a matrix, then applying a function that operates on the elements of a vector, and finally transposing the result, you can perform the same operation on the columns of a matrix.

i_  simplifies to the vector [1, 0, 0].

j_  simplifies to the vector [0, 1, 0].

k_  simplifies to the vector [0, 0, 1].

These three assigned variables represent the unit vectors i, j, and k for the Cartesian coordinate system.  The underscore in their names is meant to suggest a vector and to distinguish them from the user variables i, j, and k.  Any Cartesian coordinate vector can be entered as a linear combination of unit vectors.  For example,

a·i_ + 3·j_ - k_

simplifies to

[a, 3, -1]

OUTER(v, w) simplifies to the outer product of vectors v and w.  For example,

OUTER([a, b], [2, 3, 4])

simplifies to

 2·a  3·a  4·a

 2·b  3·b  4·b

KRONECKER(i, j) simplifies to 1 if integer i equals integer j, otherwise it simplifies to 0.  The Kronecker delta function of i and j is often written as delta sub i, j .  KRONECKER is a useful utility function for implementing various vector and matrix operations.

The next several functions perform various operations on vectors and matrices:

APPEND_COLUMNS(A, B, ...) appends the columns of its arguments, which all must be matrices having the same number of rows.  It can be given any number of matrices or a vector of matrices.  For example,

APPEND_COLUMNS([a, b; c, d], [e; f], [g; h])

and

APPEND_COLUMNS([[a, b; c, d], [e; f], [g; h]])

both simplify to

 a  b  e  f

 c  d  g  h

PARTITION(v, n, d) simplifies to a partition of vector v into vectors of length n with an offset delta of d.  d defaults to n.  For example,

PARTITION([1, 2, 3, 4, 5], 3, 2)

simplifies to

 1  2  3

 3  4  5

MINOR(A, i, j) simplifies to a copy of matrix A in which row i and column j are omitted.  For example,

MINOR([a, b, c; d, e, f; g, h, i], 2, 3)

simplifies to

 a  b

 g  h

SWAP_ELEMENTS(v, i, j) simplifies to a copy of vector v with ith and jth elements interchanged.  Note that if v is a matrix, the ith and jth rows are interchanged.  For example,

SWAP_ELEMENTS([a, b, c; d, e, f; g, h, i], 1, 3)

simplifies to

 g  h  i

 d  e  f

 a  b  c

SCALE_ELEMENT(v, i, s) simplifies to a copy of vector v with the ith element is multiplied by the expression s.  Note that if v is a matrix, the ith row is multiplied by s.  For example,

SCALE_ELEMENT([a, b, c; d, e, f; g, h, i], 2, 5)

simplifies to

  a    b    c

 5·d  5·e  5·f

  g    h    I

SUBTRACT_ELEMENTS(v, i, j, s) simplifies to a copy of vector v in which element i is replaced with element i minus s times element j.  s defaults to 1.  SUBTRACT_ELEMENTS makes it possible to reduce a matrix to row echelon form using Gaussian or Gauss-Jordan elimination on a matrix one step at a time.  This is useful for educational purposes or because you can make a better choice of pivots than does the built-in function ROW_REDUCE (see Row Echelon Form).

FORCE0(A, i, j, p) simplifies to a copy of matrix A in which element i, j is forced to 0 by subtracting an appropriate multiple of pivot row p from row i.  FORCE0 combines scaling and subtraction to force an element of a matrix to 0 in a single step.

PIVOT(A, i, j) simplifies to a copy of matrix A in which column j below row i is forced to 0 by subtracting appropriate multiples of row i.

When a direct computation exhausts memory, it is often possible to compute a result in pieces.  For really large problems, these partial results can saved in separate files using the File > Save command and then deleted from the algebra window before computing the next partial result.  The parallelism inherent in many matrix operations makes this piecewise approach especially applicable to such operations.  The following two functions facilitate this approach:

MATPROD(A, B, i, j) simplifies to the element on the ith row and jth column of the dot product of matrices A and B.  The elements of the product of two matrices with nonnumeric elements are often much bulkier than the elements of the original matrices.  MATPROD allows you to compute a matrix product one element at a time.  Alternatively, a matrix product can be computed one row at a time by simplifying expressions of the form A SUB i · B, for i=1 to the dimension of A.

COFACTOR(A, i, j) simplifies to the numerator of the row j column i element of the inverse of square matrix A.  The corresponding element of the inverse is this numerator divided by the determinant of A, DET(A).  Element growth is severe when computing inverses of matrices having nonnumeric elements.  COFACTOR allows you to compute the matrix inverse one element at a time.  Alternatively, a matrix inverse can be computed one column at a time by simplifying expressions of the form  ROW_REDUCE(A, v),  where v is a column of the identity matrix for dimension A.

COFACTOR can also be used to compute the determinant of a square matrix A, if simplifying DET(A) exhausts memory.  If A is an n by n matrix, the determinant of A is the sum of expressions of the form ELEMENT(A, 1, i)·COFACTOR(A, 1, i), where i goes from 1 to n.  The determinant can also be computed by similarly expanding about any row or column of the matrix.

ADJOINT(A) simplifies to the adjoint or adjugate of square matrix A.  The adjoint of A is the transpose of the matrix of cofactors of A.  For example,

ADJOINT([2, x; 1, 3])

simplifies to

  3  -x

 -1   2

RANK(A) simplifies to the rank of matrix A.  The rank of a matrix is equal to the number of nonzero rows in the row echelon form of the matrix (see Row Echelon Form).  For example,

RANK([2, 3, 5; 4, 6, 10; 1, 2, 3])

simplifies to 2, since the second row is a multiple of the first.  Note that in approximate mode, RANK may return erroneous results due to roundoff errors.

If µ is an exact eigenvalue of the square matrix A, the corresponding eigenvector (characteristic vector) is the nonzero vector x that satisfies the singular homogeneous system (A - µ·I) x = 0.  The eigenvector generally contains m arbitrary parameters, where m is the multiplicity of the eigenvalue.  The built-in function EIGENVALUES can be used to compute the exact eigenvalues of a matrix (see Eigenvalues).

EXACT_EIGENVECTOR(A, µ) simplifies to the eigenvector of matrix A corresponding to exact eigenvalue µ.  If µ is only an approximate eigenvalue, the matrix A - µ·I is nonsingular.  In that case EXACT_EIGENVECTOR returns the zero vector since that is the only solution of (A - µ·I)·x = 0.  Exact irrational eigenvalues may also produce the zero vector if Derive is unable to determine that certain complicated irrational expressions are equivalent to 0.  Moreover, nonnumeric or irrational eigenvalues are likely to exhaust memory or yield extremely bulky eigenvector expressions.  For these reasons, EXACT_EIGENVECTOR is effectively limited to a maximum of 4 by 4 matrices.  APPROX_EIGENVECTOR is usually a better choice for numerical matrices larger than 3 by 3.

APPROX_EIGENVECTOR(A, µ) approximates to an eigenvector of numerical matrix A corresponding to the eigenvalue that µ approximates.  µ must be a number that is not an exact eigenvalue.  The result is normalized to unit magnitude, making it unique to within a factor of plus or minus one for eigenvalues of multiplicity one.  Multiply the result by a parameter such as @1 if you want a more general eigenvector.  To assess the accuracy of a result vector x, compare it to A · x / µ to see how closely they agree.  APPROX_EIGENVECTOR uses inverse iteration to approximate eigenvectors.

The file VECTOR.MTH makes the following assignments for polar-cylindrical and spherical coordinate geometry matrices for use with the built-in vector calculus functions (see Differential Vector Calculus and Integral Vector Calculus):

                r  θ  z
cylindrical :=
                1  r  1

and

              r      θ     Φ
spherical :=
              1  r·SIN(Φ)  r

The file also defines functions for finding other coordinate geometry matrices in orthogonal curvilinear coordinates.  First, compute the Jacobian matrix of the transformation from curvilinear to Cartesian coordinates.  Next, compute the covariant metric tensor from the Jacobian matrix.  If this matrix is diagonal, the coordinates are orthogonal, and you can proceed to compute the geometry matrix from the curvilinear coordinates and this diagonal:

Assume the transformation from curvilinear to some Cartesian coordinates is given by

x = u(θ1, θ2, ..., θm)

where x is a vector of n Cartesian coordinates, and u is a vector of n expressions depending on curvilinear coordinates θ1 through θm, with m ≤ n.  (m < n corresponds to a hyper-surface imbedded in a higher-dimensional space.)

JACOBIAN(u, θ) simplifies to the Jacobian matrix of the above transformation, where θ = [θ1, θ2, ..., θm].  The Jacobian is the n by m matrix of partial derivatives of u, with dui/dθj located at row i and column j.  For example, the transformation from parabolic to Cartesian coordinates is x = (w²-v²)/2 and y = w·v and

JACOBIAN([(w^2 - v^2)/2, w·v], [w, v])

simplifies to

 w  -v

 v   w

COVARIANT_METRIC_TENSOR(A) simplifies to the covariant metric tensor of the Jacobian matrix A.  Note that a coordinate system is orthogonal only if the elements off the main diagonal of the covariant metric tensor of its Jacobian matrix are 0.  For example, the parabolic coordinate system is orthogonal since

COVARIANT_METRIC_TENSOR([w, -v; v, w])

simplifies to

  2    2
 v  + w      0

           2    2
    0     v  + w

GEOMETRY_MATRIX(θ, G) simplifies to the geometry matrix for curvilinear coordinate vector θ having a covariant metric tensor G.  For example,

GEOMETRY_MATRIX([u, v], [v^2 + w^2, 0; 0, v^2 + w^2])

simplifies to

      u           v

    2    2      2    2
 √(v  + w )  √(v  + w )

Note that the second row of the geometry matrix is just the square roots of the diagonal elements of the covariant tensor.  In some cases, simplification of the square roots may lead to unwanted absolute values unless you use the Declare Variable Domain command to appropriately restrict the domain of some coordinate variables.  For example, with spherical coordinates r should be declared nonnegative and Φ should be declared between 0 and π.

Other Utility File Functions


NUMERIC.MTH - Numerical Differentiation and Integration

The file NUMERIC.MTH implements approximate numerical first and second derivatives of expressions along with smoothing, numerical differentiation, and integration of data arrays.  It is usually more appropriate to approximate, rather than simplify, these functions.  The function definitions in NUMERIC.MTH are automatically loaded when any of its functions are first used.

DIF_NUMERIC(y, x, x0, h, n) approximates to the nth partial derivative of expression y(x) with respect to variable x at value x0, using a centered finite difference with step size h.

SMOOTH_VECTOR(v) simplifies to a smoothed copy of vector v in which each internal component is the mean of the corresponding component and the two adjacent components in v.  The end components of the result are the same as in v.

SMOOTH_COLUMN(A, j) simplifies to a copy of matrix A in which column j is smoothed as described for the preceding SMOOTH_VECTOR function.  To smooth all of the columns, simplify the expression  SMOOTH_VECTOR(A`)`.

DIF_DATA(A) approximates to the first derivative of a numerical data matrix A.  A must have two columns and at least three rows, with each successive row being a successive [x, y] coordinate pair.  The result is an analogous data matrix wherein the second column is the approximate first derivative of y with respect to x at successive values of x.  The x values can be unequally spaced.  They can even be nonmonotonic, such as samples from a parametrically-defined curve.  The formula is based on the derivatives of parabolas that fit three successive points.  Such numerical differentiation tends to amplify roundoff or experimental errors, so it is often wise to apply the SMOOTH_COLUMN or SMOOTH_VECTOR function one or more times before applying DIF_DATA, as described in the preceding paragraph.

DIF2_DATA(A) is analogous to DIF_DATA(A), but it approximates the second derivative.  The formula tends to be less accurate at the end points than at the internal points.  The advice about possibly smoothing the data is even more relevant for DIF2_DATA.

INT_DATA(A) is analogous to DIF_DATA(A), but uses the trapezoidal rule to approximate an antiderivative having the value 0 at the first data point.  Such integration tends to smooth away roundoff and experimental errors, so it is usually not necessary to smooth data before applying INT_DATA.

Other Utility File Functions


DIF_APPS.MTH - Applications of Differentiation

The file DIF_APPS.MTH defines functions that automate some of the most common applications of differentiation.  These applications include parametric, polar and implicit derivatives, curvature, centers-of-curvature, tangent lines, perpendicular lines, osculating circles, tangent planes, and surface normals.  There are separate groups of functions for curves defined in Cartesian coordinates either explicitly, parametrically, or implicitly, and for curves explicitly defined in polar coordinates.  The function definitions in DIF_APPS.MTH are automatically loaded when any of its functions are first used.

The following functions are for curves explicitly defined in Cartesian coordinates by an abscissa and an ordinate, where the ordinate is the value of the expression y that depends on the abscissa variable x:

CURVATURE(y, x) simplifies to the curvature of expression y in terms of variable x.  If you want the curvature at a particular value of x, then substitute that value in the result or take the limit of the result as x approaches that value.

CENTER_OF_CURVATURE(y, x) simplifies to the Cartesian coordinate vector of the center of curvature of expression y in terms of its variable x.

TANGENT(y, x, x0) simplifies to the line tangent to expression y(x) at x=x0.  The result will be linear in variable x.  TANGENT(y, x, inf) simplifies to the asymptote of y(x) as x approaches infinity.

PERPENDICULAR(y, x, x0) simplifies to the line perpendicular to expression y at x=x0.  The result will be linear in variable x.

OSCULATING_CIRCLE(y, x, θ) simplifies to a parametric representation of the circle that osculates expression y at its variable x, using θ as the angular parameter.

The following functions are for curves parametrically defined in Cartesian coordinates by a vector of the form v = [x, y], where x and y are expressions that depend on the parameter t:

PARA_DIF(v, t, n) simplifies to the nth derivative of y with respect to x in terms of parametric variable t.  n must be a nonnegative integer, and it defaults to 1.  To learn how to program such defaults, inspect PARA_DIF's definition in the file DIF_APPS.

PARA_CURVATURE(v, t) similarly simplifies to the curvature of parametric curve v in terms of parametric variable t.

PARA_CENTER_OF_CURVATURE(v, t) similarly simplifies to a Cartesian coordinate vector of the center of curvature of v in terms of parametric variable t.

PARA_TANGENT(v, t, t0, x) simplifies to an expression linear in variable x.  This result is the y coordinate of the line tangent to parametric curve v at parameter value t=t0.

PARA_PERPENDICULAR(v, t, t0, x) similarly simplifies to the line perpendicular to parametric curve v at parameter value t=t0.

PARA_OSCULATING_CIRCLE(v, t, t0, Φ) simplifies to a parametric representation of the circle that osculates parametric curve v at parameter value t=t0.  Variable Φ is the angular parameter of this circle.

The following functions are for curves explicitly defined in polar coordinates by an expression r that depends on the angle θ:

POLAR_DIF(r, θ, n) simplifies to the nth derivative of y with respect to x in terms of variable θ.  n must be a nonnegative integer, and it defaults to 1.

POLAR_CURVATURE(r, θ) simplifies to the curvature of expression r in terms of variable θ.

POLAR_CENTER_OF_CURVATURE(r, θ) simplifies to the Cartesian coordinates of the center of curvature of expression r, in terms of variable θ.

POLAR_TANGENT(r, θ, θ0, x) simplifies to an expression linear in variable x.  This result is the y coordinate of the line tangent to expression r at angle θ=θ0.

POLAR_PERPENDICULAR(r, θ, θ0, x) similarly simplifies to the Cartesian line perpendicular to expression r at angle θ=θ0.

POLAR_OSCULATING_CIRCLE(r, θ, θ0, Φ) simplifies to the Cartesian parametric circle that osculates polar curve r at angle θ=θ0.  Variable Φ is used as the angular circle parameter.

The following functions are for curves implicitly defined in Cartesian coordinates by an equation of the form u=0, where u is an expression that depends on the variables x and y.  The values of the arguments for x and y must be unassigned variables.  Do not declare y to be a function.  The results are unique only modulo u(x,y)=0 or u(x0,y0)=0, so the symbolic results may differ from results derived by other methods.  However, the numerical results from substituting a pair of numbers that satisfy u(x,y)=0 or u(x0,y0)=0 should be the same, within roundoff error:

IMP_DIF(u, x, y, n) simplifies to the nth implicit derivative of y with respect to x.  n must be a positive integer, and it defaults to 1.  In most cases the result depends on both x and y rather than x or y alone.  This is acceptable for some applications.  If not, you can sometimes use the original equation u=0 to eliminate either y or x from the derivative.  Moreover, you can always substitute a particular value of x or of y into u, then solve for the other variable.  This may require approximate mode.  Either way, the resulting numerical values of x and y can then be substituted into the derived general implicit derivative.

IMP_CURVATURE(u, x, y) simplifies to the curvature of the curve implicitly defined by u=0.

IMP_CENTER_OF_CURVATURE(u, x, y) simplifies to the center of curvature of the curve implicitly defined by u=0.

IMP_TANGENT(u, x, y, x0, y0) simplifies to an expression linear in variable x.  The result is the y coordinate of the line tangent at x=x0 and y=y0 to the curve implicitly defined by u=0.

IMP_PERPENDICULAR(u, x, y, x0, y0) similarly simplifies to the line perpendicular at x=x0 and y=y0 to the curve implicitly defined by u=0.

IMP_OSCULATING_CIRCLE(u, x, y, x0, y0, θ) simplifies to the circle that osculates at x=x0 and y=y0 the curve implicitly defined by u=0.  The circle is defined parametrically in terms of variable θ.

The following functions implement applications of derivatives to surfaces defined implicitly by an equation of the form u=0, where u is an expression that depends on the three Cartesian coordinate variables comprising the vector v.  Typically v is the vector [x, y, z]:

TANGENT_PLANE(u, v, v0) simplifies to an expression that is linear in the three coordinate variables of v.  This result defines the plane tangent to the surface u=0 at v=v0:  When equated to zero, the result is a linear relationship between the variables in v, and you can solve this equation for any of its variables in terms of the others (see the Solve commands).  Given any two components of v0, you can substitute them into u, and then solve for the remaining component.  Solving it may require switching to approximate mode.

NORMAL_LINE(u, v, v0, t) simplifies to a Cartesian coordinate vector that is linear in variable t.  This result parametrically defines the line perpendicular to the surface u=0 at v=v0.  v is a vector of coordinate variables, and v0 is a corresponding vector of coordinate values on the surface.

Other Utility File Functions


INT_APPS.MTH - Applications of Integration

The file INT_APPS.MTH defines functions that automate various applications of integration.  These include Laplace transforms and Fourier series together with arc lengths, areas, volumes, centroids, and inertia tensors, in Cartesian, cylindrical, and spherical coordinates.  The function definitions in INT_APPS.MTH are automatically loaded when any of its functions are first used.

LAPLACE(y, t, s) simplifies to the Laplace transform of the expression y depending on the variable t, using the variable s as the independent variable in the transform domain.  Finding the transform depends on symbolically integrating an improper integral.  Convergence of this integral generally requires that s be declared positive.  For example,

LAPLACE(t^2, t, s)

simplifies to 2/s³, if s has been declared positive.  However if y has a factor of the form ê^kt, where k is a constant, s must be declared greater than k in order for the integral to converge.  For example,

LAPLACE(t^2·#e^(5·t), t, s)

simplifies to 2/(s - 5)³, if s has been declared greater than 5.

There may exist a closed-form Laplace transform even if LAPLACE is not able to find one.  So if LAPLACE fails, you may want to try looking in a table of Laplace transforms.  If you want to use Laplace transforms to solve ordinary differential equations, the utility files ODE1.MTH and ODE2.MTH define functions that more directly automate the process.

To determine the inverse Laplace transform of an expression u depending on the transform variable s, use the Simplify > Expand command to determine a partial fraction expansion of u with respect to s, and then look up the inverse transform of each term in a table.

FOURIER(y, t, t1, t2, n) simplifies to a Fourier series approximation of the expression y(t) as the variable t varies from t1 to t2, truncated to the nth harmonic.  The Fourier series has the form b0 plus the sum of

ak·SIN(2·π·k·t/(t2-t1)) + bk·COS(2·π·k·t/(t2-t1))

for k=1 to n, where b0 through bn and a1 through an are expressions independent of t.  If simplifying an expression involving the FOURIER function does not provide a closed form, you can try approximating it instead.  For example, to see a Fourier series approximation for a square wave truncated to the 12th harmonic, simplify and plot the expression

FOURIER(SQUARE_WAVE(t), t, 0, 2, 12)

Most of the remaining functions in this section involve an optional last parameter µ describing how a density varies throughout the region.  Examples of this density include mass, charge, and momentum.  The default value is µ=1.

ARC_LENGTH(y, x, x1, x2, µ) simplifies to the integral of µ(x) along the arc described by expression y depending on variable x varying from x1 to x2.  Omit µ to determine arc length.  Let µ = [x, y] to determine the first moment.  (The first moment divided by the arc length is the centroid.)  For example, to determine the arc length of x² from x=a to b, simplify the expression

ARC_LENGTH(x^2, x, a, b)

POLAR_ARC_LENGTH(r, θ, θ1, θ2, µ) simplifies to the integral of µ(θ) along the arc described by polar expression r depending on angular variable θ varying from θ1 to θ2.  Omit µ to determine the arc length.  For example, to determine the arc length of the polar cardiod 1-cos(θ) from θ =-π to π, simplify the expression

POLAR_ARC_LENGTH(1-COS(theta), theta, -pi, pi)

PARA_ARC_LENGTH(v, t, t1, t2, µ) simplifies to the integral of µ(t) over the curve parametrically defined by a Cartesian vector v depending on a variable t that varies from t1 to t2.  v may have any number of components, such as two for a plane curve or three for a space curve.  Omit µ to determine the arc length.  For example, to determine the arc length of the helix defined by the vector [r·cos(θ), r·sin(θ), h·θ] from θ =-π to π, simplify the expression

PARA_ARC_LENGTH([r*COS(theta), r*SIN(theta), h*theta], theta, -pi, pi)

The remaining functions defined in this section involve finding multiple definite integrals.  Derive may be unable to find an exact closed form for one or more integrals when one of these functions is simplified.  If this occurs, try approximating them using the Simplify Approximate command.

Also changing the order of integration or the coordinate system may enable a closed-form solution to be found.  This is important because successive symbolic integrations tend to reduce singularities and smooth the integrand, making any subsequent numerical integrations faster and more accurate.  Moreover, the computing time tends to increase by more than an order of magnitude for each nested integral that must be done numerically.

AREA(x, x1, x2, y, y1, y2, µ) simplifies to the integral of µ(x, y) over the region from x=x1 to x2 and y=y1(x) to y2(x).  You may have to partition a region into several regions and/or permute the roles of x and y to describe the region this way.  Omit the last argument if you merely want the area.  If y1 ever exceeds y2 in the interval x1 ≤ x ≤ x2, then subdivide the integral at such places and interchange y1 and y2 so that y1 ≤ y ≤ y2 throughout each interval.  However, in some such cases it may suffice to just let µ = sign(y2 - y1).  Consequently, you can try that first to see if it yields a closed-form result.  For example, to determine the area of the region 0 ≤ x ≤ b and sin(x) ≤ y ≤ 1+x², simplify the expression

AREA(x, 0, b, y, SIN(x), 1 + x^2)

AREA_CENTROID(x, x1, x2, y, y1, y2, µ) simplifies to the centroid of density µ(x, y).  Omit the last argument if you merely want the centroid of a planar region.  For example, to determine the centroid of the region 0 ≤ x ≤ b and sin(x) ≤ y ≤ 1+x², simplify the expression

AREA_CENTROID(x, 0, b, y, SIN(x), 1 + x^2)

AREA_INERTIA(x, x1, x2, y, y1, y2, µ) simplifies to the inertia tensor of density µ(x, y), represented as a symmetric matrix of the form:

|  Ixx  -Ixy  |
| -Ixy   Iyy  |

The off-diagonal elements are minus the product of inertia.  Omit the last argument if you merely want the inertia tensor of a planar region.  The polar moment of inertia is Ixx+Iyy.  The radius of gyration is the polar moment of inertia divided by the area.  For example, to determine the inertia tensor of the region 0 ≤ x ≤ b and sin(x) ≤ y ≤ 1+x², simplify the expression

AREA_INERTIA(x, 0, b, y, SIN(x), 1 + x^2)

POLAR_AREA(r, r1, r2, θ, θ1, θ2, µ) simplifies to the integral of µ(r, θ) over the region from θ=θ1 to θ2 and r=r1(θ) to r2(θ).  Omit the last argument if you merely want the area.  If r1 > r2 anywhere in θ1 ≤ θ ≤ θ2, read the discussion of function AREA above.  For example, to determine the area of the polar cardiod 1-cos(θ) from θ =-π to π, simplify the expression

POLAR_AREA(r, 0, 1-COS(theta), theta, -pi, pi)

SURFACE_AREA(z, x, x1, x2, y, y1, y2, µ) simplifies to the integral of µ(x, y) over the surface defined by z(x, y) for x=x1 to x2 and y=y1(x) to y2(x).  A region may have to be partitioned into several subregions and/or the roles of x, y, and z permuted in order to describe a region in this way.  Omit the last argument if you merely want the surface area.  Let µ = [x, y, z] to compute the centroid, and similarly adapt the definition of VOLUME_INERTIA below to determine the inertia tensor.  If y1 > y2 anywhere in x1 ≤ x ≤ x2, read the discussion of function AREA above.  For example, to determine the area of the surface z=1-x²+y over the region 0 ≤ x ≤ 1 and x-1 ≤ y ≤ 1-x, simplify the expression

SURFACE_AREA(1-x^2+y, x, 0, 1, y, x-1, 1-x)

VOLUME(x, x1, x2, y, y1, y2, z, z1, z2, µ) simplifies to the integral of µ(x, y, z) over the region from x=x1 to x2, y=y1(x) to y2(x), and z=z1(x, y) to z2(x, y).  You may have to partition a region into several regions and/or permute the roles of x, y, and z to describe a region this way.  Omit the last argument if you merely want the volume.  If y1 > y2 or z1 > z2 anywhere in x1 ≤ x ≤ x2, read the discussion of function AREA above.  For example, to determine the mass of the region 0 ≤ x ≤ 1, and x ≤ y ≤ exp(x), and 0 ≤ z ≤ x+y having the mass density = x+y+z, simplify the expression

VOLUME(x, 0, 1, y, x, #e^x, z, 0, x+y, x+y+z)

VOLUME_CENTROID(x, x1, x2, y, y1, y2, z, z1, z2, µ) similarly computes the centroid of density µ(x, y, z).  Omit the last parameter if you merely want the volumetric centroid.  For example, to determine the center of mass of the region 0 ≤ x ≤ 1, and x ≤ y ≤ exp(x), and 0 ≤ z ≤ x+y having the mass density µ = x+y+z, simplify the expression

VOLUME_CENTROID(x, 0, 1, y, x, #e^x, z, 0, x+y, x+y+z)

VOLUME_INERTIA(x, x1, x2, y, y1, y2, z, z1, x2, µ) similarly computes the inertia tensor of density µ(x, y, z), represented as a symmetric matrix of the form.

|  Ixx  -Ixy  -Ixz |
|                  |
| -Ixy   Iyy  -Iyz |
|                  |
| -Ixz  -Iyz   Izz |

The off-diagonal elements are minus the products of inertia.  Omit the last parameter if you merely want the volumetric inertia.  For example, to determine the inertia tensor of the region 0 ≤ x ≤ 1, and x ≤ y ≤ exp(x), and 0 ≤ z ≤ x+y having the mass density µ = x+y+z, simplify the expression

VOLUME_INERTIA(x, 0, 1, y, x, #e^x, z, 0, x+y, x+y+z)

SPHERICAL_VOLUME(r, r1, r2, θ, θ1, θ2, Φ, Φ1, Φ2, µ) simplifies to the integral of µ(r, θ,Φ) over the region from r=r1 to r2, θ=θ1(r) to θ2(r), and Φ=Φ1(r,θ) to Φ2(r,θ).  θ is the colongitude measured in radians counterclockwise in the x-y plane from the positive x-axis.  Φ is the colatitude measured in radians from the positive z-axis.   Beware that some texts define spherical coordinates differently, such as interchanging the definitions of θ and Φ.  For example, to determine the integral of r²θ+Φ over the region bounded by r=0 to 1, θ=0 to r, and Φ=0 to r+θ, simplify the expression

SPHERICAL_VOLUME (r,0,1,theta,0,r,phi,0,r+theta,r^2*theta+phi)

You must modify the order of integration in the definition of SPERICAL_VOLUME if r1 or r2 depend upon the angles or if θ1 or θ2 depends on Φ.  Omit the last argument if you merely want the volume of this region.  If θ1 > θ2 or Φ1 > Φ2 anywhere in r1 ≤ r ≤ r2, read the discussion of function AREA above.  Let µ equal [r·SIN(Φ)·COS(θ), r·SIN(Φ)·SIN(θ), r·COS(Φ)] to determine the centroid, or similarly adapt the definition of VOLUME_INERTIA to determine the inertia tensor.

CYLINDRICAL_VOLUME(r, r1, r2, θ, θ1, θ2, z, z1, z2, µ) simplifies to the integral of µ(r, θ, z) over the region from z=z1 to z2, θ=θ1(z) to θ2(z), and r=r1(θ, z) to r2(θ, z).  You must modify the order of integration in the definition if θ1 or θ2 depends on r or if z depends on r or θ.  Omit the last argument if you merely want the volume of this region.  If θ1 > θ2 or r1 > r2 anywhere in z1 ≤ z ≤ z2, read the discussion of function AREA above.  Let µ equal [r·COS(θ), r·SIN(θ), z] to determine the centroid, and similarly adapt the definition of VOLUME_INERTIA to determine the inertia tensor.

VOLUME_OF_REVOLUTION(y, x, x1, x2) simplifies to the volume of the area between the expression y(x) and the x-axis revolved about the x-axis from x=x1 to x2.  For example, to determine the volume of the Horn of Gabriel formed by revolving 1/x about the x-axis from x=1 to ∞, simplify the expression

VOLUME_OF_REVOLUTION(1/x,x,1,inf)

AREA_OF_REVOLUTION(y, x, x1, x2) simplifies to the surface area of the expression y(x) revolved about the x-axis from x=x1 to x2.  For example, to determine the surface area of x² revolved about the x-axis from x=0 to 1, simplify the expression

AREA_OF_REVOLUTION(x^2,x,0,1)

VOLUMEY_OF_REVOLUTION(y, x, x1, x2) simplifies to the volume of the area between the expression y(x) and the x-axis revolved about the y-axis from x=x1 to x2.  Note that the shell method is used to compute the volume.  For example, to determine the volume of 1/x revolved about the y-axis from x=0 to 1, simplify the expression

VOLUMEY_OF_REVOLUTION(1/x,x,0,1)

AREAY_OF_REVOLUTION(y, x, x1, x2) simplifies to the surface area of the expression y(x) revolved about the y-axis from x=x1 to x2.  For example, to determine the surface area of ln(x) revolved about the y-axis from x=1 to 2, simplify the expression

AREAY_OF_REVOLUTION(LN(x),x,1,2)

Other Utility File Functions


ODE1.MTH - First-order Ordinary Differential Equations

The file ODE1.MTH defines functions for finding exact solutions to first order ordinary differential equations.  The function definitions in ODE1.MTH are automatically loaded when any of its functions are first used.

The file begins with methods taught in second-year calculus and elementary differential equations courses.  Following the elementary methods are advanced methods that may succeed when the more elementary methods are inapplicable.

Functions with names having the suffix GEN return a general solution in terms of a symbolic constant.  Functions with names without the suffix GEN return a specific solution when given numeric initial conditions, or they return a general solution in terms of symbolic initial conditions when given unassigned variables for the initial conditions.

With either type of function, the result is usually an algebraic equation implicitly defining the dependent variable in terms of the independent variable.  This equation may contain integrals that Derive could not determine exactly.  However, such implicit solutions are still considered solutions of differential equations even if integrals remain.  If an implicit solution does not contain an integral involving the dependent variable, you can use the Solve > Expression command in an attempt to find one or more explicit solutions.

In this section as well as in ODE2.MTH and the corresponding utility files, the variable x denotes the independent variable, and the variable y denotes the dependent variable.  Also the variable x0 denotes the initial value of x, and the variable y0 denotes the corresponding initial value of y.  Do not use x or y as function names.  In this section and in ODE2.MTH, dy/dx is abbreviated as y' for descriptive purposes only.  In Derive the apostrophe or single-quote mark can not be used to denote derivatives.

If you want to find a specific solution for symbolic or numeric initial conditions, it is best to use a function that directly returns specific solutions.  Otherwise, after finding a general solution, you must substitute x0 and y0 into the general solution, solve for c, and then substitute that value of c back into the general solution.

Elementary Methods

DSOLVE1_GEN(p, q, x, y, c) simplifies to a general solution of an equation having the form

p(x, y) + q(x, y)·y' = 0

in terms of symbolic constant c.  Note that most first order differential equations can be put in the above form.

DSOLVE1_GEN can solve exact, linear, separable, homogeneous or generalized-homogeneous equations, and equations having an integrating factor that depends only on x or only on y.  In other words, DSOLVE1_GEN is a general-purpose function that can solve most first order equations that occur in second-year calculus or elementary differential equations courses.

If the equation is not one of the above forms, DSOLVE1_GEN returns the word "inapplicable".  In this case, consider seeing if one of the advanced methods described in the next subsection is applicable to the equation.

DSOLVE1(p, q, x, y, x0, y0) is similar to DSOLVE1_GEN, but simplifies to a specific solution for the initial condition y=y0 at x=x0.  These initial conditions can be numbers, variables, or general expressions.

For example, to solve the differential equation 2·x·y + (1 + x²)·y' = 0 for the initial condition y=1 at x=0, enter and simplify the expression

DSOLVE1(2·x·y, 1 + x^2, x, y, 0, 1)

to produce the implicit algebraic solution

x^2·y + y - 1 = 0

To verify that it satisfies the initial condition, substitute x=0 and y=1 into this implicit solution, and then see that it simplifies to 0=0.

The implicit differentiation function IMP_DIF in the utility file DIF_APPS.MTH may be helpful for verifying an implicit solution of a differential equation.  For example, to verify the above implicit solution, use the Transfer Load Utility command to load DIF_APPS.MTH, enter the expression

2·x·y + (1 + x^2)·IMP_DIF(x^2·y + y - 1, x, y) = 0

and then see that it simplifies to 0=0.

If it is necessary to obtain an explicit solution of a differential equation, use the Solve > Expression command to solve the implicit solution for y.  For example, solving the above implicit solution for y gives

        1
y = --------
      2
     x  + 1

To verify that this explicit solution satisfies the differential equation, substitute the solution for y in the unsimplified difference of the two sides of the differential equation and see that the result simplifies to 0.  For example, substituting 1/(x²+1) for y in

              2  d
2·x·y + (1 + x )·-- y
                 dx

and then simplifying the result gives 0.

The remaining functions in this subsection are for solving specific forms of differential equations.  They are included primarily for educational purposes.

SEPARABLE_GEN(p, q, x, y, c) simplifies to a general implicit solution of an equation having the form y' = p(x)·q(y), where p(x) is an expression free of y and q(y) is an expression free of x.  The right side may require factoring and/or applying various trigonometric, logarithmic, or exponential transformations to transform it to separable form.

SEPARABLE(p, q, x, y, x0, y0) is similar to SEPARABLE_GEN, but simplifies to a specific solution for the initial condition y=y0 at x=x0.

LINEAR1(p, q, x, y, x0, y0) simplifies to an explicit solution of the linear monic differential equation y' + p(x)·y = q(x).  A differential equation is monic if the coefficient of its highest order derivative is 1.  Note that this equation does not have to be linear in x: only linear in y and its derivative.

LINEAR1_GEN(p, q, x, y, c) is similar to LINEAR1, but simplifies to a general solution in terms of symbolic constant c.

HOMOGENEOUS(r, x, y, x0, y0) simplifies to an implicit solution of an equation having the form y' = r(x, y)  if r is homogeneous, otherwise it returns "inapplicable".  In this context, an expression is homogeneous if substituting k·x or x and k·y for y in the expression yields an equivalent expression.  Often homogeneous expressions consist of a ratio of two polynomials in x and y, with exponents of x and y totaling the same constant in every term.  The arguments of any irrational subexpressions must also be homogeneous.  For example,

r = (x²·y - x·y²)/(x³ - y³) + SIN(x/y)

is homogeneous.

HOMOGENEOUS_GEN(r, x, y, c) is similar to HOMOGENEOUS, but simplifies to a general solution in terms of symbolic constant c if r is homogeneous.

EXACT(p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form p(x, y) + q(x, y) y' = 0 if this differential equation is exact, otherwise it returns "inapplicable".  This equation is exact if and only if dp/dy - dq/dx is equivalent to 0.

EXACT_GEN(p, q, x, y, c) is similar to EXACT, but simplifies to a general solution in terms of symbolic constant c.

INTEGRATING_FACTOR(p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form p(x, y) + q(x, y)·y' = 0 if this equation is exact when multiplied by an integrating factor free of x or free of y, otherwise it returns "inapplicable".

INTEGRATING_FACTOR_GEN(p, q, x, y, c) is similar to INTEGRATING_FACTOR, but simplifies to a general solution in terms of symbolic constant c.

Advanced Methods

MONOMIAL_TEST(p, q, x, y) simplifies to an integrating factor of the form x^m·y^n to the equation p(x, y) + q(x, y)·y' = 0, otherwise it returns "inapplicable".  Thus if MONOMIAL_TEST returns a monomial, multiply the equation by this monomial and solve the resulting exact differential equation using EXACT or DSOLVE1.

BERNOULLI_ODE(p, q, k, x, y, x0, y0) simplifies to an implicit solution of the Bernoulli equation  y' + p(x)·y = q(x)·y^k,  where k is a constant.

BERNOULLI_ODE_GEN(p, q, k, x, y, c) is similar to BERNOULLI, but simplifies to a general solution in terms of symbolic constant c.

GEN_HOM(r, x, y, x0, y0) simplifies to an implicit solution of an equation of the form  y' = r(x, y)  if r is generalized homogenous, otherwise it returns "inapplicable".  r is a generalized homogeneous expression if and only if

t·d(t·r)/dx
—————
d(t·r)/dy

is free of x and y, where t=x/y.

GEN_HOM_GEN(r, x, y, c) is similar to GEN_HOM, but simplifies to a general solution in terms of symbolic constant c.

FUN_LIN_CCF(r, p, q, k, x, y, x0, y0) simplifies to an implicit solution of an equation of the form y' = r(u), where r is a function of linear constant coefficients:  u = p·x + q·y + k,  with p, q, and k independent of x and y.

FUN_LIN_CCF_GEN(r, p, q, k, x, y, c) is similar to FUN_LIN_CCF, but simplifies to a general solution in terms of symbolic constant c.

LIN_FRAC(r, a, b, d, p, q, k, x, y, x0, y0) simplifies to an implicit solution of a linear fractional equation  y' = r·((a·x+b·y+d)/(p·x+q·y+k)).  However if q·a-p·b=0, instead use FUN_LIN_CCF described above.

LIN_FRAC_GEN(r, a, b, d, p, q, k, x, y, c) is similar to LIN_FRAC, but simplifies to a general solution in terms of symbolic constant c.

ALMOST_LIN(r, b, p, q, x, y, x0, y0) simplifies to an implicit solution of an equation of the form  r(x, y)·y' + p(x)·b(y) = q(x), if the equation is almost-linear, otherwise it returns "inapplicable".  The differential equation is almost-linear if (db/dy)/r is free of y.

ALMOST_LIN_GEN (r, b, p, q, x, y, c) is similar to ALMOST_LIN, but simplifies to a general solution in terms of symbolic constant c.

The above functions are for quasi-linear equations, meaning linear in y'.  If an equation is not quasi-linear, represent y' by a variable v and try solving for v to transform the equation into one or more alternate quasi-linear equations.  Alternatively, the following method is directly applicable to some equations that are not quasi-linear, and this method may be preferable even if you can solve for v:

CLAIRAUT(p, q, x, y, v, c) solves the generalized Clairaut equation, which has the form p(x·v - y) = q(v), where p and q are any functions and v is a variable representing y'.  CLAIRAUT returns a vector:  The first component is a general solution containing an arbitrary constant c.  The second component is an equation that you can attempt to solve algebraically for v.  If you succeed, substitute this expression for v in the differential equation to obtain a singular solution.

For example, to solve the differential equation (x·y' - y)² = (y')² + 1, enter

CLAIRAUT((x·v - y)^2, v^2+1, x, y, v)

which simplifies to

  2  2              2    2                  2
[c ·x  - 2·c·x·y + y  - c  - 1 = 0,   2·(v·x  - x·y - v) = 0]

Solving the second component for v in terms of x and y gives

       x·y
v = --------
      2
     x  - 1

Substituting the right side of this result for y' in the original differential equation gives the implicit singular solution

      2           2  2
     y           x ·y
----------- = ----------- + 1
   2     2       2     2
 (x  - 1)      (x  - 1)

Other Utility File Functions


ODE2.MTH - Second-order Ordinary Differential Equations

The file ODE2.MTH defines functions for finding exact solutions of second order ordinary differential equations.  The function definitions in ODE2.MTH are automatically loaded when any of its functions are first used.

Sometimes more than one method may be applicable.  The most easily applied methods are described first, beginning with direct methods that produce an explicit solution and only require recognizing a pattern.  In contrast, later methods generally give implicit solutions or require more steps, such as solving a sequence of two first order differential equations.  The file ODE1.MTH can be used to help solve these first order equations.

The notation used here and in the file ODE2.MTH is the same as that described near the beginning of the help for ODE1.MTH.  Also y=y2 at x=x2 is used as a second boundary condition, and y'=v0 at x=x0 is used as a second initial condition.  d²y/dx² is abbreviated as y" for descriptive purposes only.  In Derive the double-quote mark can not be used to denote second derivatives.

DSOLVE2(p, q, r, x, c1, c2) simplifies to an explicit general solution of the linear second order ordinary differential equation

y" + p(x)·y' + q(x)·y = r(x)

in terms of arbitrary constants c1 and c2.  Note that the last two arguments can be omitted if they are variables and you are satisfied with the names c1 and c2.

If no method applies or the equation cannot be converted to an equivalent one having a p and a q that are independent of x, DSOLVE2 returns the word "inapplicable".

DSOLVE2 can easily find a solution if p and q are numeric constants.  When q is a symbolic constant, the result will often have a more appropriate form (sinusoidal versus exponential) if q has been declared positive or negative.

A solution may contain indefinite integrals involving r(x) for which Derive can not determine a closed-form antiderivative.  To verify such a result, substitute the solution for y into the unsimplified form

[d ]2         d
|--| y + p(x)·-- y + q(x)·y - r(x)
[dx]          dx

and then see that it simplifies to 0.

If you want to find a specific solution for symbolic or numeric initial or boundary conditions, it is best to use DSOLVE2_IV or DSOLVE2_BV that directly return specific solutions.  Otherwise, after finding a general solution using DSOLVE2, you must substitute these constraints into general solution, solve for c1 and c2, and then substitute those values back into the general solution.

DSOLVE2_BV(p, q, r, x, x0, y0, x2, y2) is similar to DSOLVE2, but simplifies to a specific solution that satisfies the boundary conditions y=y0 at x=x0 and y=y2 at x=x2.

DSOLVE2_IV(p, q, r, x, x0, y0, v0) is similar toDSOLVE2_BV, but simplifies to a specific solution that satisfies the initial conditions y=y0 and y'=v0 at x=x0.

AUTONOMOUS_CONSERVATIVE(q, x, y, x0, y0, v0) simplifies to an implicit algebraic solution of an equation of the form y"=q(y) having initial conditions y=y0 and y'=v0 at x=x0.  Equations of this form are autonomous because the variable x does not occur and conservative because y' does not occur.  If instead of the initial condition y'=v0 you have a second boundary condition y=y2 at x=x2, substitute x2 for x and y2 for y in the solution and solve for v0, which you can then eliminate in favor of x2 and y2.

LIOUVILLE(p, q, x, y, c1, c2) simplifies to an implicit algebraic solution of the Liouville differential equation

y" + p(x)·y' + q(y)·(y')² = 0

This solution is a linear combination of two arbitrary constants c1 and c2.  Consequently, you can substitute two sets of initial or boundary conditions, and then solve two simultaneous linear equations for c1 and c2.

To solve an equation missing the dependent variable y:  f(y", y', x) = 0, use a new variable v for y' and use v' for y" to obtain a first order equation for v.  If you can solve that first order equation to obtain an algebraic equation relating v, x, x0, and v0, then noting that v=y', you can attempt to solve this subsequent first order equation to obtain an algebraic equation relating y, x, x0, y0, and v0.  The file ODE1.MTH may help solve the two successive first order equations.

AUTONOMOUS(r, v) simplifies an expression for dv/dy, given an autonomous equation y" = r(y, v) with v representing y'.  Equations of this form are autonomous because the independent variable x doesn't occur.  If you can solve this resulting first order equation to obtain an algebraic equation relating v, y, v0, and y0, then noting that v=y', this result is another first order differential equation, which you can then attempt to solve to obtain an algebraic equation relating y, x, x0, v0, and y0.  The file ODE1.MTH may help solve the two successive first order equations.  If r is also independent of v, instead use the function AUTONOMOUS_CONSERVATIVE to solve the equation in one step.

EXACT2(p, q, x, y, v, c) simplifies to an algebraic equation relating the solution of the equation relating y, v, x, and an arbitrary symbolic constant c, provided the equation

p(x, y, v)·y" + q(x, y, v) = 0

is exact.  Note that here the variable v is used to represent y'.  You can then attempt to solve the resulting first order differential equation.  If the equation is inexact, EXACT2 returns "inapplicable".

Other Utility File Functions


ODE_APPR.MTH - Approximate Solution of ODEs

The help for ODE1.MTH and ODE2.MTH describes methods for finding exact solutions to ordinary differential equations.  Sometimes none of these methods is applicable to your equation or the results of these methods cannot be converted to an explicit form.  Perhaps your differential equation is unsolvable in terms of Derive's functions, or you need to solve a system of differential equations.  Don't give up if this happens!

The file ODE_APPR.MTH defines functions for solving most ordinary differential equations and systems of such equations using truncated series approximations and approximate numerical methods.  The function definitions in ODE_APPR.MTH are automatically loaded when any of its functions are first used.

Series Solutions to First Order Equations and Systems

TAYLOR_ODE1(r, x, y, x0, y0, n) simplifies to an nth order truncated Taylor series solution of the equation y' = r(x, y) given the initial condition y=y0 and x=x0.  For example,

TAYLOR_ODE1(ê^(x·y), x, y, 0, 1, 4)

simplifies to

    4      3      2
 5·x      x      x
------ + ---- + ---- + x + 1
  12       2      2

To verify that this is an approximate series solution to the differential equation, substitute this series solution for y in the unsimplified difference between the two sides of the equation.  Then use the Calculus Taylor Series command to verify that the third order Taylor series approximation of that difference is 0.  The reason for using a third rather than fourth order Taylor series approximation is that differentiation reduces the order of the truncated series by 1.

TAYLOR_ODE1 simplifies to ? if r is not sufficiently differentiable for an nth order truncated series.  Try a smaller value for n if this happens.

PICARD(r, p, x, y, x0, y0) expands to an improved approximate series solution of the equation y' = r(x, y), given the approximate series solution p(x).  Expanding with respect to x often gives a more useful form than just simplifying the expression.

The Picard method involves integrating r(x, p(x)).  If no integrals remain in the simplified result, you can try another iteration using the improved approximation for p, and so on.  If you have no better first approximation, use the constant y0.

For example, suppose y' = y²+SQRT(x) and y=1 at x=0.  Use of TAYLOR_ODE1 indicates that the right side of the equation is sufficiently differentiable only for a first order truncated Taylor-series solution x+1.  Consequently, using this as a first approximation,

PICARD(y^2+SQRT(x), x + 1, x, y, 0, 1)

expands to

  3             3/2
 x      2    2·x
---- + x  + -------- + x + 1
  3             3

You can then use this second approximation as the second argument of PICARD to obtain a third approximation, and so on.

Note that the highest order terms generated by the Picard method are often incorrect.  For example, the coefficient of the above x³ term should be 1.  Distrust terms whose coefficients are not the same for two successive iterates.  For this reason and for efficiency, it is wise to discard all but the next higher order term after each iteration.  For example, you should discard the above x³ and x² terms for the next iteration.

If any iterate yields a result containing an integral, you can try approximating r(x, p(x)) to make it integrable.

PICARD can also be used to find series solutions of systems of first order differential equations.  Given a monic quasi-linear system of first order equations of the form

y1' = r1(x, y1, y2, ..., ym)

y2' = r2(x, y1, y2, ..., ym)

...

ym' = rm(x, y1, y2, ..., ym)

let r=[r1, r2, ..., rm], y=[y1, y2, ..., ym], and y=y0=[y1,0, y2,0, ..., ym,0] at x=x0.  Then PICARD(r, p, x, y, x0, y0) expands to an improved series solution of the system, given the series solution p=[p1, p2, ..., pm].

TAYLOR_ODES(r, x, y, x0, y0, n) simplifies to the nth order truncated Taylor series solution of the above system of differential equations, provided vector r is sufficiently differentiable.

Series Solutions to Second Order Equations

TAYLOR_ODE2 (r, x, y, v, x0, y0, v0, n)  simplifies to an nth order truncated Taylor series solution of the equation y" = r(x, y, v).  Here v represents y', and v0 is the value of v at x = x0.  For example, TAYLOR_ODE2 (2·x·v + x²·y + 3·x, x, y, v, 0, 0, 1, 5) simplifies to

    5        3
 3·x      5·x
------ + ------ + x
  10        6

To verify that this is an approximate series solution to the differential equation, substitute this series solution for y and substitute the derivative of this expression for v into the unsimplified difference between the two sides of the equation.  Then use the Calculus Taylor Series command to verify that the third order Taylor series approximation of that difference is 0.  The reason for using a third rather than fifth order Taylor series approximation is that the second derivative of the truncated series reduces its order by 2.

TAYLOR_ODE2 simplifies to ? if r is not sufficiently differentiable for an nth order truncated series.  Try a smaller value for n if this happens.

Approximate Numerical Solutions to First Order Equations

EULER_ODE(r, x, y, x0, y0, h, n) approximates to a vector of n+1 solution points of the equation y' = r(x, y) with y=y0 at x=x0 beginning with x=x0 using a step size of h.  EULER uses Euler's method to produce a vector of n+1 coordinate pairs of the form

[[x0,  y0],  [x0+h,  y1],  [x0+2·h,  y2],  ...,  [x0+n·h,  yn]]

This vector plots as a set of points that approximates the solution curve of the equation.  For example, to generate five points of an approximate solution of the equation  y' = 26/(3+(x+y)²)  through x=2 from x=1 where y=-2, approximate

     [      26                      1    ]
EULER|--------------, x, y, 1, -2, ---, 4|
     |            2                 4    |
     [ 3 + (x + y)                       ]

giving

[   1      -2   ]
| 1.25   -0.375 |
|  1.5  1.35114 |
| 1.75  1.93520 |
[   2   2.32722 ]

Euler's method has educational value as the simplest numerical method for solving ordinary differential equations, but it typically has the largest error of any standard method.  In contrast, the more accurate Runge-Kutta method should be used for serious numerical solutions.

RK uses the classic fourth order Runge-Kutta method to solve a system of one or more simultaneous first order equations

RK(r, v, v0, h, n) approximates to the solution of the system of first order differential equations  yi' = ri(x, y).  r is the vector [r1, r2, ..., rm],  v is the vector [x, y1, y2, ..., ym],  v0 is the corresponding vector of initial values, h is the desired step size, and n is the desired number of steps.

RK returns a matrix of successive approximate solution points, each row being a vector of numbers representing a successive value of vector v.  To plot y1 versus x, delete all but the first two columns.  To plot y2 versus x, delete all but the first and third columns, etc.  Alternatively, to plot y2 versus y1 — a parametric phase-plane plot —  delete all but the second and third columns, etc.  The following function automates the selection of column pairs:

EXTRACT_2_COLUMNS(A, j, k) simplifies to a matrix composed of the jth then kth columns of matrix A.

DIRECTION_FIELD(r, x, x0, xm, m, y, y0, yn, n) approximates to a matrix of 2-component vectors that when plotted displays as a direction field for the equation y'=r(x,y).  x varies from x0 through xm in m steps, and y varies from y0 through yn in n steps.  Before plotting, use the 2D-plot window Options > Display > Points command to connect the endpoints of the tangent segments and to make their endpoints small dots.

For example,  to plot a direction field for the equation y’=y−x, approximate the expression

DIRECTION_FIELD(y - x, x, -3, 3, 6, y, -3, 3, 6)

and then plot the result in a 2D-plot window using connected segments and small dots.

Higher Order Differential Equations

A second or higher order ordinary differential equation can always be transformed into an equivalent system of first order differential equations as follows:

•	First, introduce a unique new variable for each derivative except the highest.

•	Next, replace the highest order derivative with the first derivative of the variable that represents the next-highest order derivative.

•	Finally, for each of the other variables, add to the system an equation that equates its first derivative to the variable that represents the next higher order derivative.

For example, this procedure transforms a second order equation of the form f (x, y", y', y) = 0 into the system of first order equations f (x, v', v, y) = 0 and y' = v.

This procedure can also be used to transform a system of higher order ordinary differential equations into an equivalent system of first order equations.  Simply transform each equation in turn, consistently using the same variable for a derivative everywhere it occurs.

After transforming a higher order equation or system of equations into a system of first order equations, the methods described earlier in this section can be used to solve the system.

Other Utility File Functions


RECUREQN.MTH - Recurrence Equations

The file RECUREQN.MTH defines functions for finding exact solutions of first and second order difference equations and of linear-geometric recurrence equations.  The function definitions in RECUREQN.MTH are automatically loaded when any of its functions are first used.

LIN1_DIFFERENCE(p, q, x, x0, y0) simplifies to a specific solution of a recurrence equation having the form

y(x+1) = p(x)·y(x) + q(x)

for the initial condition y=y0 at x=x0.  Note that linear first order difference equations can always be put in this form.  For a general instead of a specific solution, make x0 and y0 unassigned variables.  A convenient way to do this is to give LIN1_DIFFERENCE only three arguments.

For example, to solve the difference equation  y(m+1) = m·y(m) + (m+1)!  for the initial condition y=2 at x=1, enter and simplify the expression

LIN1_DIFFERENCE(m, (m+1)!, m, 1, 2)

to produce the algebraic solution

[  2           ]
| m      m     |
|---- + --- + 1|·(m - 1)!
[  2     2     ]

To verify that it satisfies the initial condition, substitute m=1 into the solution, and see that it simplifies to 2.  To verify that it satisfies the difference equation  y(m+1) = m·y(m) + (m+1)! , substitute m+1 for m in the above solution, and see that that result equals m times the solution plus (m+1)! .  Note that the best way to check that two dissimilar looking expressions are actually equal is to subtract one from the other and see if the result is 0.

The result of LIN1_DIFFERENCE may contain products or sums that Derive could not simplify to a closed-form.  A closed-form solution for all x > x0 may not even exist in terms of Derive's built-in defined functions.  However:

RECURRENCE1(r, x, y, x0, y0, n) simplifies to the matrix

[[x0,  y0],  [x0+1,  y(x0+1)],  ...,  [x0+n,  y(x0+n)]]

where y satisfies the (perhaps nonlinear) first order difference equation  y(x+1) = r(x, y(x)).  Here y(x) should be represented by a variable y rather than a function in expression r.  Depending on r and your goal, it may be more appropriate to approximate rather than simplify when using RECURRENCE1.  Either way, you can then plot the resulting two-column matrix.

GEOMETRIC1(k, p, q, x, x0, y0) simplifies to a solution of the first order linear-geometric recurrence equation y(k·x) = p(x)·y(x) + q(x), where k is a particular number, such as 2 or 3.  The complexity analysis of "divide and conquer" algorithms often entails a linear-geometric recurrence equation.

CLAIRAUT_DIF(p, q, d, x, y, c) simplifies to an implicit algebraic general solution of the equation p(y-x·d) = q(d), where variable y represents y(x) and variable d represents the forward first difference y(x+1) - y(x).  This solution is in terms of x and a symbolic arbitrary constant c.  For example, to find a general solution of the difference equation

(y(x+1) - x·(y(x+1) - y(x)))² = (y(x+1) - y(x))²

enter and simplify the expression

CLAIRAUT_DIF((y - x·d)^2, d^2)

to give

 2  2              2    2
c ·x  - 2·c·x·y + y  - c  = 0

LIN2_CCF(p, q, r, x, c1, c2) simplifies to a general solution of the constant coefficient second order linear difference equation y(x+2) + p·y(x+1) + q·y(x) = r(x), in terms of two symbolic constants c1 and c2.  Note that the result may contain one or more sums for which Derive can not find a closed-form.

LIN2_CCF_BV(p, q, r, x, x0, y0, x2, y2,) is similar to LIN2_CCF, but simplifies to a specific solution that satisfies the boundary conditions y=y0 at x=x0 and y=y2 at x=x2.

Other Utility File Functions


APPROX.MTH - Pade Rational Approximation

The file APPROX.MTH defines a function that computes Pade rational approximations to an expression.  The function definitions in APPROX.MTH are automatically loaded when any of its functions are first used.

PADE(y, x, x0, n, d) simplifies to the Pade rational approximation to expression y depending on variable x, centered at x0, requesting a numerator of degree n and a denominator of degree d.  y must be differentiable through order n+d.  You must have either n=d or n=d-1.  If a different degree difference between the numerator and denominator is appropriate, approximate y·x^k for the appropriate specific k, then divide the result by x^k.

Pade approximations are often more efficient and have a larger region of convergence than Taylor series — particularly in the neighborhood of non-polynomial behavior in y, such as asymptotes.  For example,

PADE(ê^x, x, 0, 3, 3)

simplifies to the following cubic over cubic rational approximation of e^x centered on x=0:

    3       2
   x  + 12·x  + 60·x + 120
- ——————————————
    3       2
   x  - 12·x  + 60·x - 120

CHEBYSHEV_T_SERIES(u, x, a, b, k, n) simplifies to the Chebyshev series approximation of u(x) over the interval [a, b] up to x^k using the nth order Maclaurin series approximation for u(x).  The integer k must be less than or equal to n.  If k=n, CHEBYSHEV_T_SERIES simplifies to the nth order Maclaurin series approximation for u(x).  For example,

CHEBYSHEV_T_SERIES(ê^x, x, -1/2, 1/2, 4, 5)

simplifies to the following 4th degree Chebyshev series approximation of e^x over the interval -1/2 to 1/2:

  4         3      2
 x      65·x      x      6143·x
---- + ------- + ---- + -------- + 1
 24      384       2      6144

Other Utility File Functions


EXP_INT.MTH - Exponential, Log, Sine, and Cosine Integrals

The file EXP_INT.MTH defines functions for approximating exponential, logarithmic, sine, and cosine integrals.  The definitions, nomenclature, and organization in this section follow Abramowitz and Stegun's Handbook of Mathematical Functions, Dover Publications, Inc. [1965].  The function definitions in EXP_INT.MTH are automatically loaded when any of its functions are first used.

Many of the functions in this file are defined in terms of definite integrals for which you must use the Simplify Approximate command to determine an approximate numerical result for numerical values of the arguments.  In such cases the accuracy is usually close to the current working precision if you receive no  Dubious accuracy  warning message.  As a check you can temporarily increase the precision by five digits and compare the values.

In other cases these definitions are truncated series for which you must choose a particular number of terms.  Asymptotic series generally diverge but have an error less than the first omitted term, so you can start with one term and keep increasing the number of terms while the change is diminishing in magnitude.  In contrast, for a convergent series you can keep increasing the number of terms until there is no change in the displayed approximation.

In some cases you can determine other truncated series by expanding an integrand into an integrable truncated series, then integrating symbolically.

This section lists classic integral and series definitions for ease of identification.  However, some of the integrals or series are transformed in the files into mathematically equivalent ones that are faster and more accurate to approximate.

EI(x, m) approximates to m terms of a series for the exponential integral Ei(x) defined for x>0 as the Cauchy principal value of the integral of ê^-t / t from t=-x to infinity.

LI(x, m) approximates to m terms of a series for the logarithmic integral li(x) defined for x>1 as the Cauchy principal value of the integral of 1 / LN(t) from t=0 to x.

EN(n, z) approximates to the nth exponential integral En(z) defined for the real part of z>0 and n a nonnegative integer as the integral of ê^(-z·t) / t^n from t=1 to infinity.

EN_ASYMP(n, z, m) approximates to m+1 terms of an asymptotic series that approximates the above nth exponential integral for large magnitude z.

EI1(z, m) approximates to m terms of a series for the 1st exponential integral E1(z) with |phase z| < π.

SI(z) approximates to the sine integral Si(z) defined as the integral of SIN(t) / t from t=0 to z.

CI(z) approximates to the cosine integral Ci(z) with |phase z| < π defined as the integral of (COS(t)-1) / t from t=0 to z plus Euler's gamma constant plus LN(z).

Other Utility File Functions


PROBABIL.MTH - Probability Functions

The file PROBABIL.MTH defines the incomplete gamma function and its relatives, including various probability densities and cumulative distributions.  Gamma and probability functions are described in Chapters 6 and 26 respectively of Abramowitz and Stegun [1965].  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in PROBABIL.MTH are automatically loaded when any of its functions are first used.

POCHHAMMER(a, x) simplifies to (a)x, the Pochhammer's symbol function.  (a)x is defined by the identity (a)x  =  Γ(a+x) / Γ(a).

DIGAMMA_PSI(z) approximates to the digamma function Ψ(z), provided the real part of z is positive (i.e. the phase of z is less than π/2).  Ψ(z) is defined by the identity Ψ(z) = d/dz ln Γ(z) =  d/dz Γ(z) / Γ(z).  The built-in DIGAMMA function is described in Probability Functions.

POLYGAMMA(n, z, m) simplifies to m+1 terms of a series approximation for Ψ(n)(z), the nth polygamma function, provided z is not zero or a negative integer.  Ψ(1)(z), Ψ(2)(z), Ψ(3)(z), Ψ(4)(z) are called the trigamma, tetragamma, pentagamma, and hexagamma functions respectively.  Ψ(n)(z) is defined by the identity Ψ(n)(z) = (d/dz)^n Ψ(z) = (d/dz)^(n+1) ln Γ(z).

INCOMPLETE_GAMMA(z, w) approximates to P(z, w), the incomplete gamma function, provided the real part of z is positive.

INCOMPLETE_GAMMA_SERIES(z, w, m) simplifies to m+1 terms of a series approximation for P(z, w), the incomplete gamma function.

EULER_BETA(z, w) simplifies to B(z, w), the Euler beta function.  B(z, w) is defined by the identity B(z, w) = Γ(z)·Γ(w) / Γ(z+w).

INCOMPLETE_BETA(x, z, w) simplifies to Bx(z, w), the incomplete beta function.

POISSON_DENSITY(k, t) simplifies to the Poisson probability density defined as ê^-t·t^k / k!.

POISSON_DISTRIBUTION(k, t) simplifies to the cumulative probability Poisson distribution function defined as the sum of ê^-t·t^j / j! from j=0 to k.

BINOMIAL_DENSITY(k, n, p) simplifies to the binomial probability density defined as

            k        n - k
COMB(n, k)·p ·(1 - p)

BINOMIAL_DISTRIBUTION(k, n, p) simplifies to the cumulative probability binomial distribution function defined as

MIN(k,n)
  Σ     BINOMIAL_DENSITY(j, n, p)
  j=0

HYPERGEOMETRIC_DENSITY(k, n, m, j) simplifies to the hypergeometric probability density defined as

COMB(m, k)·COMB(j - m, n - k)
-----------------------------
          COMB(j, n)

HYPERGEOMETRIC_DISTRIBUTION(k, n, m, j) simplifies to the cumulative probability hypergeometric distribution function defined as

  MIN(k,n,m)
      Σ         HYPERGEOMETRIC_DENSITY(α, n, m, j)
α=MAX(0,n-j+m)

STUDENT(t, ν) approximates to A(t|ν), the cumulative probability student's t-distribution function.

F_DISTRIBUTION(F, ν1, ν2) approximates to P(F|ν1, ν2), the cumulative probability F-distribution function.  P(F|ν1, ν2) is also called the variance-ratio distribution function.

CHI_SQUARE(u, v) approximates to P(χ²|v), the cumulative probability chi-square distribution function, where u=χ².

Other Utility File Functions


FRESNEL.MTH - Fresnel Integrals

The file FRESNEL.MTH defines functions for approximating Fresnel integral and related integrals.  These integrals are described in Chapter 7 of Abramowitz and Stegun [1965].  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in FRESNEL.MTH are automatically loaded when any of its functions are first used.

DAWSON(x) simplifies to Dawson’s integral F(x) defined in terms of the complex error function (see Error and Zeta Functions) as -√π/2·î·ê^(-x^2)·ERF(î·x).

FRESNEL_SIN(z) approximates to the Fresnel sine integral S(z) defined as the integral of SIN(π·t²/2) from t=0 to z.

FRESNEL_SIN_SERIES(z, m) approximates to m+1 terms of a series for the above Fresnel sine integral.

FRESNEL_SIN_J(z, m) approximates to the Fresnel sine integral S(z) based on the sum of m+1 spherical Bessel functions of the first kind using formula 7.3.16 of the Handbook of Mathematical Functions by Milton Abramowitz and Irene A. Stegun.  Larger values of m give more accurate results.

FRESNEL_SIN_ASYMP(z) simplifies to a five-term asymptotic approximation of the above Fresnel sine integral for large magnitude z.

FRESNEL_COS(z) approximates to the Fresnel cosine integral C(z) defined as the integral of COS(π·t²/2) from t=0 to z.

FRESNEL_COS_SERIES(z, m) approximates m+1 terms of a series for the above Fresnel cosine integral.

FRESNEL_COS_J(z, m) approximates to the Fresnel cosine integral C(z) based on the sum of m+1 spherical Bessel functions of the first kind using formula 7.3.15 of the Handbook of Mathematical Functions by Milton Abramowitz and Irene A. Stegun.  Larger values of m give more accurate results.

FRESNEL_COS_ASYMP(z) simplifies to a five-term asymptotic approximation of the above Fresnel cosine integral for large magnitude z.

Other Utility File Functions


BESSEL.MTH - Bessel and Airy Functions

The file BESSEL.MTH defines functions for approximating Bessel and Airy functions.  These functions are described in Chapters 9 and 10 of Abramowitz and Stegun [1965].  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in BESSEL.MTH are automatically loaded when any of its functions are first used.

BESSEL_J(n, z) approximates to the Bessel function of the first kind Jn(z) for integer or fractional n.

BESSEL_J_LIST(n, z) simplifies to a vector of Bessel functions of the first kind J0(z) through Jn(z) for integer n.  It uses a recurrence relationship, so the values become less accurate for Ji(z) as i approaches n.

BESSEL_J_SERIES(n, z, m) approximates to m+1 terms of a series approximation for the Bessel function of the first kind Jn(z).

BESSEL_J_ASYMP(n, z) simplifies to a one-term asymptotic approximation for the Bessel function of the first kind Jn(z) for large magnitude z.

BESSEL_Y(n, z) approximates to the Bessel function of the second kind Yn(z) for noninteger n.

BESSEL_Y_SERIES(n, z, m) approximates to m+1 terms of a series approximation for the Bessel function of the second kind Yn(z) for integer n.

BESSEL_Y_ASYMP(n, z) simplifies to a one-term asymptotic approximation for the Bessel function of the second kind Yn(z) for large magnitude z.

BESSEL_I(n, z) approximates to the modified Bessel function of the first kind In(z) for integer n.

BESSEL_I_SERIES(n, z, m) approximates to m+1 terms of a series approximation for the modified Bessel function of the first kind In(z) for complex n.

BESSEL_I_ASYMP(n, z) simplifies to a two-term asymptotic approximation for the modified Bessel function of the first kind In(z) for complex n and large magnitude z.

BESSEL_K(n, z) approximates to the modified Bessel function Kn(z) for complex n and |phase z| < π/2.

BESSEL_K_ASYMP(n, z) simplifies to a two-term asymptotic approximation for the modified Bessel function Kn(z) for complex n and large magnitude z.

SPHERICAL_BESSEL_J(n, z) simplifies to a closed form for the spherical Bessel function of the first kind jn(z) for integer n.

SPHERICAL_BESSEL_J_LIST(n, z) simplifies to a vector of spherical Bessel functions of the first kind j0(z) through jn(z) for integer n.  It uses a recurrence relationship, so the values become less accurate for ji(z) as i approaches n.

SPHERICAL_BESSEL_Y(n, z) simplifies to a closed form for the spherical Bessel function of the second kind, yn(z) for integer n.

AI_SERIES(z, m) approximates to m+1 terms of a series approximation for the Airy function Ai(z).

BI_SERIES(z, m) approximates to m+1 terms of a series approximation for the Airy function Bi(z).

Other Utility File Functions


HYPERGEO.MTH - Hypergeometric Functions

The file HYPERGEO.MTH defines functions for approximating hypergeometric functions.  These functions are described in Chapters 13 and 15 of Abramowitz and Stegun [1965].  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in HYPERGEO.MTH are automatically loaded when any of its functions are first used.

HYPERGEOMETRIC_SERIES(plist, qlist, z, m) simplifies to m+1 terms of the hypergeometirc series for the generalized hypergeometric function pFq(a1,...,ap;b1,...,bq;z) where plist equals [a1,...,ap] and qlist equals [b1,...,bq].

KUMMER(a, b, z) approximates to Kummer's function M(a, b, z) which is the solution of Kummer’s second order differential equation z·w’’ + (b−z)·w’ − a·w = 0.  M(a, b, z) equals the confluent hypergeometric function 1F1(a; b; z).

KUMMER_SERIES(a, b, z, m) simplifies to m+1 terms of the hypergeometric series for Kummer’s function.

GAUSS(a, b, c, z) approximates to the Gauss function F(a, b; c; z) which equals the hypergeometric function 2F1(a, b; c; z).

GAUSS_SERIES(a, b, c, z, m) simplifies to m+1 terms of the hypergeometric series for the Gauss function.

Other Utility File Functions


ELLIPTIC.MTH - Elliptic Integrals

The file ELLIPTIC.MTH defines functions for approximating elliptic integrals.  These integrals are described in Chapter 17 of Abramowitz and Stegun [1965].  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in ELLIPTIC.MTH are automatically loaded when any of its functions are first used.

ELLIPTIC_F(Φ, m) approximates to the elliptic integral of the first kind F(Φ|m).

ELLIPTIC_E(Φ, m) approximates to the elliptic integral of the second kind E(Φ|m).

ELLIPTIC_PI(Φ, m, n) approximates to the elliptic integral of the third kind II(n;Φ|m).

JACOBI_AM(u,m,n) is the Jacobi elliptic amplitude function needed to generate all the Jacobi elliptic functions.

KI(m,n) is the complete elliptic integral of the first kind.

EIF(Φ,m,n) is the elliptic integral of the first kind.

Other Utility File Functions


ORTH_POL.MTH - Orthogonal Polynomials

The file ORTH_POL.MTH defines functions for generating orthogonal polynomials.  These polynomials are described in Chapter 22 of Abramowitz and Stegun [1965].  The function definitions in ORTH_POL.MTH are automatically loaded when any of its functions are first used.

CHEBYCHEV_T(n, x) simplifies to the nth Chebychev polynomial of the first kind Tn(x) based on the recursion

T0(x) = 1

T1(x) = x

T(n+1)(x) = 2·x·Tn(x) - T(n-1)(x)

For example,

CHEBYCHEV_T(6, x)

simplifies to T6(x)

    6       4       2
32·x  - 48·x  + 18·x  - 1

CHEBYCHEV_T_LIST(n, x) simplifies to a vector of the first n Chebychev polynomials of the first kind.  For example,

CHEBYCHEV_T_LIST(7, x)

simplifies to a vector of T0(x) through T6(x).

CHEBYCHEV_U(n, x) simplifies to the nth Chebychev polynomial of the second kind Un(x) based on the recursion

U0(x) = 1

U1(x) = 2·x

U(n+1)(x) = 2·x·Un(x) - U(n-1)(x)

For example,

CHEBYCHEV_U(6, x)

simplifies to U6(x)

    6       4       2
64·x  - 80·x  + 24·x  - 1

CHEBYCHEV_U_LIST(n, x) simplifies to a vector of the first n Chebychev polynomials of the second kind.  For example,

CHEBYCHEV_U_LIST(7, x)

simplifies to a vector of U0(x) through U6(x).

LEGENDRE_P(n, x) simplifies to the nth Legendre polynomial Pn(x) based on the recursion

P0(x) = 1

P1(x) = x

(n+1)·P(n+1)(x) = (2·n+1)·x·Pn(x) - n·P(n-1)(x)

For example,

LEGENDRE_P(6, x)

simplifies to P6(x)

      6        4        2
 231·x  - 315·x  + 105·x  - 5
—————————————————
              16

LEGENDRE_P_LIST(n, x) simplifies to a vector of the first n Legendre polynomials.  For example,

LEGENDRE_P_LIST(7, x)

simplifies to a vector of P0(x) through P6(x).

ASSOCIATED_LEGENDRE_P(n, m, x) simplifies to the nth associated Legendre polynomial Pnm(x).  For example,

ASSOCIATED_LEGENDRE_P(4, 2, x)

simplifies to P4(2)(x)

          2      2
 15·(1 - x )·(7·x  - 1)
—————————————
            2

HERMITE_H(n, x) simplifies to the nth Hermite polynomial Hn(x) based on the recursion

H0(x) = 1

H1(x) = 2·x

H(n+1)(x) = 2·x·Hn(x) - 2·n·H(n-1)(x)

For example,

HERMITE_H(6, x)

simplifies to H6(x)

    6        4        2
64·x  - 480·x  + 720·x  - 120

HERMITE_H_LIST(n, x) simplifies to a vector of the first n Hermite polynomials.  For example,

HERMITE_H_LIST(7, x)

simplifies to a vector of H0(x) through H6(x).

HERMITE_HE(n, x) simplifies to the nth associated Hermite polynomial Hen(x) based on the recursion

He0(x) = 1

He1(x) = x

He(n+1)(x) = x·Hen(x) - n·He(n-1)(x)

For example,

HERMITE_HE(6, x)

simplifies to He6(x)

 6       4       2
x  - 15·x  + 45·x  - 15

HERMITE_HE_LIST(n, x) simplifies to a vector of the first n associated Hermite polynomials.  For example,

HERMITE_HE_LIST(7, x)

simplifies to a vector of He0(x) through He6(x).

WEBER_D(n, x) simplifies to Weber's nth parabolic cylinder function Dn(x).  For example,

WEBER_D(6, x)

simplifies to

    2
 - x /4   6       4       2
ê      ·(x  - 15·x  + 45·x  - 15)

LAGUERRE_L(n, x) simplifies to the nth Laguerre polynomial Ln(x) based on the recursion

L0(x) = 1

L1(x) = -x + 1

(n+1)·L(n+1)(x) = (2·n+1-x)·Ln(x) - n·L(n-1)(x)

For example,

LAGUERRE_L(4, x)

simplifies to L4(x)

  4        3
 x      2·x        2
---- - ------ + 3·x  - 4·x + 1
 24       3

LAGUERRE_L_LIST(n, x) simplifies to a vector of the first n Laguerre polynomials.  For example,

LAGUERRE_L_LIST(5, x)

simplifies to a vector of L0(x) through L4(x).

GENERALIZED_LAGUERRE(n, α, x) simplifies to the nth generalized Laguerre polynomial Ln(α)(x) based on the recursion

L0(α)(x) = 1

L1(α)(x) = -x + α + 1

(n+1)·L(n+1)(α)(x) = (2·n+α+1-x)·Ln(α)(x) - (n+α)·L(n-1)(α)(x)

For example,

GENERALIZED_LAGUERRE(4, 2, x)

simplifies to L4(2)(x)

  4              2
 x      3    15·x
---- - x  + ------- - 20·x + 15
 24            2

GENERALIZED_LAGUERRE_LIST(n, α, x) simplifies to a vector of the first n generalized α Laguerre polynomials.  For example,

GENERALIZED_LAGUERRE_LIST(5, 2, x)

simplifies to a vector of L0(2)(x) through L4(2)(x).

JACOBI_P(n, α, β, x) simplifies to the nth Jacobi polynomial Pn(α, β)(x).  For example,

JACOBI_P(4, 2, 1, x)

simplifies to P4(2,1)(x)

        4       3       2
 5·(33·x  + 12·x  - 18·x  - 4·x + 1)
—————————————————————
                  8

JACOBI_P_LIST(n, α, β, x) simplifies to a vector of the first n Jacobi (α, β) polynomials.  For example,

JACOBI_P_LIST(5, 2, 1, x)

simplifies to a vector of P0(2,1)(x) through P4(2,1)(x).

GEGENBAUER_C(n, α, x) simplifies to the nth Gegenbauer ultraspherical polynomial Cnα(x).  For example,

GEGENBAUER_C(4, 2, x)

simplifies to C4(2)(x)

    4       2
80·x  - 48·x  + 3

GEGENBAUER_C_LIST(n, α, x) simplifies to a vector of the first n Gegenbauer ultraspherical α polynomials.  For example,

GEGENBAUER_C_LIST(5, 2, x)

simplifies to a vector of C0(2)(x) through C4(2)(x).

Other Utility File Functions


ZETA.MTH - Generalized Zeta Functions

The Riemann zeta function ζ(s) and the Hurwitz zeta function ζ(s, z) are built-in Derive functions (see Error and Zeta Functions).  The file ZETA.MTH defines functions for approximating several functions related to the zeta function.  See the introduction to EXP_INT.MTH for a discussion of accuracy.  The function definitions in ZETA.MTH are automatically loaded when any of its functions are first used.

HURWITZ_ZETA(s, z, m) approximates to m+1 terms of a series for the Hurwitz or generalized zeta function ζ(s, z).  If the real part of s is greater than 1, ζ(s, z) is defined as Σ(1/(k+z)^s, k, 0, ∞); otherwise, it is defined by analytic extension over the rest of the complex plane.

POLYLOG(n, z, m) approximates to m terms of a series for Jonquière's polylogarithm function Lin(z) defined as the sum of z^k/k^n from k=1 to infinity.

LERCH_PHI(z, s, a, m) approximates to m terms of a series for the Lerch transcendent function Φ(z, s, a) defined as the sum of z^k/(a+k)^s from k=0 to infinity.

DILOG(x) approximates to the dilogarithm function defined as the integral of LN(t)/(1-t) from t=1 to x.

Other Utility File Functions


GRAPHICS.MTH - Plotting Space Curves & Complex Functions

The utility file GRAPHICS.MTH defines functions and constants that aid in plotting areas and integrals, space curves and parametric surfaces, and expressions having complex values.  The function definitions in GRAPHICS.MTH are automatically loaded when any of its functions are first used.

Plotting Areas and Integrals

Use the following functions to plot areas associated with graphs of functions of a single variable in a 2D-plot window.  Note that by interchanging the roles of x and y in these functions, the area plots can be carried out with respect to the y-axis as the basis, instead of the x-axis.

AreaUnderCurve(u, x, a, b, y) plots the area under the graph of the function y = u(x) and above the x-axis from x = a to b (a < b).  For example, to plot the area under the function y = x + cos(x) from x = 0 to 3, plot the expression

AreaUnderCurve(x + COS(x), x, 0, 3, y)

AreaUnderCurve(u, y, a, b, x) plots the area to the left of the graph of the function x = u(y) and to the right of the y-axis from y = a to b (a < b).  For example, to plot the area to the left of the function x = y + cos(y) from y = 0 to 3, plot the expression

AreaUnderCurve(y + COS(y), y, 0, 3, x)

AreaOverCurve(u, x, a, b, y) plots the area over the graph of the function y = u(x) and under the x-axis from x = a to b (a < b).  For example, to plot the area over the function y = sin(x) - x from x = 1 to 3, plot the expression

AreaOverCurve(SIN(x) - x, x, 1, 3, y)

AreaOverCurve(u, y, a, b, x) plots the area to the right of the graph of the function x = u(y) and to the left of the y-axis from y = a to b (a < b).  For example, to plot the area to the right of the function x = sin(y) - y from y = 1 to 3, plot the expression

AreaOverCurve(SIN(y) - y, y, 1, 3, x)

AreaBetweenCurves(u, v, x, a, b, y) plots the area between the graphs of the functions y = u(x) and y = v(x) from x = a to b (a < b).  For example, to plot the area between the functions y = sin(2·x) and y = cos(3·x) from x = -π to π, plot the expression

AreaBetweenCurves(SIN(2·x), COS(3·x), x, -pi, pi, y)

AreaBetweenCurves(u, v, y, a, b, x) plots the area between the graphs of the functions x = u(y) and x = v(y) from y = a to b (a < b).  For example, to plot the area between the functions x = sin(2y) and x = cos(3·y) from y = -π to π, plot the expression

AreaBetweenCurves(SIN(2·y), COS(3·y), y, -pi, pi, x)

By letting v = 0, AreaBetweenCurves can also be used to plot the area associated with the definite integral of y = u(x)  from x = a to b (a < b) in a single color.  For example, to plot the integral of the function y = sin(2·x) + cos(3·x) from x = -π to π, plot the expression

AreaBetweenCurves(SIN(2·x) + COS(3·x), 0, x, -pi, pi, y)

PlotInt(u, x, a, b, y) plots the area associated with the definite integral of the function y = u(x) from x = a to b.  For PlotInt to work, the 2D-plot window's Options > Simplify Before Plotting command option must be turned on.  For example, to plot the integral of the function y = x + sin(2·x)  from x = -3 to 3, plot the expression

PlotInt(x + SIN(2·x), x, -3, 3, y)

PlotInt(u, y, a ,b, x) plots the area associated with the definite integral of the function x = u(y) from y = a to b.  For example, to plot the integral of the function x = y + sin(2·y)  from y = -3 to 3, plot the expression

PlotInt(y + SIN(2·y), y, -3, 3, x)

If the Options > Change Plot Colors command option is turned on, the positive part of the integral is plotted in one color, then the negative part is plotted in a contrasting color.  For example, compare the previous plot with a plot of the expression

PlotInt(x + SIN(2·x), x, 3, -3, y)

Many other examples of plotting and filling the areas of curves can be constructed directly using Boolean plots.  For example, to plot and fill a circle of radius 2 with center at (1,2), plot the expression

(x-1)^2 + (y-2)^2 = 4 OR (x-1)^2 + (y-2)^2 <= 4

If the plot looks like an ellipse, use the Set > Aspect Ratio command to make it a true circle.  As another example, to plot the area between x = y² and x = sin(y) for y = -2 to 2, plot the expression

x=y^2 OR x=SIN(y) OR ((x-y^2)·(SIN(y)-x) >= 0 AND -2 <= y <= 2)

Plotting Space Curves and Parametric Surfaces

Space curves and parametric surfaces can be plotted in a 2D-plot window using an isometric projection, also called a trimetric projection:  3D images are projected perpendicular to the screen as if viewed from a great distance through a telephoto lens.  For example, the isometric projection of the front surface of a cube does not appear larger (or smaller) than the back surface.

The 2D and 3D origins coincide.  The positive 3D x-axis points down to the left and out of the screen.  The positive 3D y-axis points symmetrically down to the right and out of the screen.  The positive 3D z-axis points symmetrically up and out of the screen.  This orientation is close to the default orientation in a 3D-plot window.  However, hidden lines on parametric surfaces are not removed, so the effect is a wire frame rather than a scored opaque surface.

axes  is assigned to a 3 x 2 matrix that parametrically specifies the isometric projections of the x, y, and z axes of the 3D Cartesian coordinate system.  When axes is plotted in a 2D-plot window, you are successively prompted for the minimum and maximum values of the x-axis, the y-axis, and then the z-axis.  These axes are drawn in that order from these minimum to maximum values.  For example, use 0 as a minimum value if you only want to see the positive axis.  Press Ctrl-Enter or Ctrl-J instead of Enter to make the same minimum and maximum values apply to the remaining axes.

A 3D coordinate vector can represent a point, a space curve, or a parametric surface.  The three elements of the vector respectively give the x, y, and z coordinates of the point, curve, or surface.  If the coordinates are constants, the coordinate vector represents a point.  If the coordinates depend on one parameter, the vector represents a space curve.  If the coordinates depend on two parameters, the vector represents a parametric surface.

ISOMETRIC(v) simplifies to the 2D isometric projection of the 3D coordinate vector v representing a space curve.

ROTATE_X(α) simplifies to a matrix A such that A · v rotates the 3D coordinate vector v through an angle of α radians about the x-axis, counterclockwise when viewed from the positive x-axis toward the origin.

ROTATE_Y(α) simplifies to a matrix A such that A · v rotates the 3D coordinate vector v through an angle of α radians about the y-axis, counterclockwise when viewed from the positive y-axis toward the origin.

ROTATE_Z(α) simplifies to a matrix A such that A · v rotates the 3D coordinate vector v through an angle of α radians about the z-axis, counterclockwise when viewed from the positive z-axis toward the origin.

ISOMETRICS(v, s, s0, sm, m, t, t0, tn, n) approximates to a vector of n+1 two-column matrices that plots in a 2D-plot window as the isometric projection of the parametric surface specified by 3D coordinate vector v which is defined in terms of parameters s and t.  This vector is evaluated on a grid of points with s varying from s0 through sm in m equal increments and t varying from t0 through tn in n equal increments.

To produce a plot of line segments along lines of constant t, use the 2D-plot window Set > Coordinate System command to select the rectangular coordinate system and the Options > Display > Points command to select connected points that are medium or large in size.

To make the dots and lines in such plots all the same color, use the Options Color Auto command to select No automatic color change.

COPROJECTION(A) approximates to the coprojection of A.  The coprojection of a projection matrix produced by ISOMETRICS is a vector of m+1 two-column matrices that plots as the isometric projection of the same parametric surface, but with lines of constant s instead of constant t.  Superimposing a plot of the coprojection onto a plot of the projection often helps visualize a 3-dimensional surface.  Note that the coprojection can also be generated by approximating ISOMETRICS(v, t, t0, tn, n, s, s0, sm, m).

Note that in contrast to 3D-plot window plots, hidden lines are not removed from parametric surface plots.  However, the parametric surfaces are not restricted to a Cartesian parameterization or to a single value of z for each pair of x-y coordinates.

SPHERE(r, θ, Φ) simplifies to a 3D coordinate vector specifying the Cartesian coordinates of a point having spherical coordinates given by radius r, co-longitude θ, and colatitude Φ.  θ is measured in radians counterclockwise in the x-y plane from the positive x-axis.  Φ is measured in radians toward the x-y plane from the positive z-axis.

Beware that some authors define spherical coordinates differently, such as interchanging these definitions of θ and Φ.  To rotate or tilt the sphere, add appropriate constants to the angular parameters before simplifying.  To shift the sphere away from the origin, add an appropriate 3D Cartesian coordinate vector to the result.

TORUS(rc, rs, θ, Φ) simplifies to a 3D coordinate vector specifying the Cartesian coordinates of a point having toroidal coordinates rs, θ, and Φ, with rc being the radius from the origin to the center of the tube.  The circle that is the center of the tube lies in the x-y plane, centered at the origin.  rs is the radius perpendicular to the center of the tube.  θ measures the angle projected onto the x-y plane, counterclockwise from the positive x-axis.  Φ measures the angle around the tube, up from the ray pointing from the center of the tube toward the origin.

CYLINDER(r, θ, z) simplifies to a 3D coordinate vector specifying the Cartesian coordinates of a circular cylinder of radius r from the z-axis.

CONE(α, θ, z) simplifies to a 3D coordinate vector specifying the Cartesian coordinates of a circular cone having a surface at angle α from the z-axis, centered at the origin.

Plotting Complex-valued Expressions

There are several ways to plot expressions having complex values:

To superimpose plots of the real and imaginary parts of an expression w that depends on a single real-valued variable, issue the Options > Plot Real and Imaginary Parts command in a 2D-plot window, and then plot w.  For example, turn plot real and imaginary parts mode on, and then plot the expression

ASIN(x)

To superimpose plots of the absolute value (magnitude) and phase angle of an expression w that depends on a single real-valued variable, plot the expressions ABS(w) and PHASE(w) in a 2D-plot window.  For example, plot the expressions

ABS(ASIN(x))

PHASE(ASIN(x))

To parametrically plot the real and imaginary parts of an expression w that depends on a single real-valued variable, issue the Options > Trace Plots command or press the F3 key in a 2D-plot window, and plot the vector [RE(w), IM(w)].  Then as the cross is moved along the curve, the cross coordinates displayed on the status bar show the real and imaginary parts of w as a function of the parameter values displayed on the title bar of the 2D-plot window.  For example, to plot the sine of z = t·(1+i) for t = -2·π to 2·π, turn trace mode on and plot the expression

[RE(SIN(t·(1 + î))), IM(SIN(t·(1 + î)))]

To superimpose surface plots of the real and imaginary parts of an expression w that depends on a single complex-valued variable, substitute the expression x + î·y for the variable in the expressions RE(w) and IM(w), and then plot the resulting expressions in a 3D-plot window.  In order to distinguish between the plots, use the Insert > Plot command to plot the imaginary surface and select a different color scheme than that used for the real surface.  For example, plot the expressions

RE(EXP(x + î·y)/5)

IM(EXP(x + î·y)/5)

To superimpose surface plots of the absolute value (magnitude) and phase angle of an expression w that depends on a single complex-valued variable, substitute the expression x + î·y for the variable in the expressions ABS(w) and PHASE(w), and then plot the resulting expressions in a 3D-plot window.  In order to distinguish between the plots, use the Insert > Plot command to plot the phase surface and select a different color scheme than that used for the absolute value surface.  For example, plot the expression

ABS(EXP(x + î·y)/5)

PHASE(EXP(x + î·y)/5)

To plot rays in a 2D-plot window whose length and direction represent the absolute value (magnitude) and phase angle of an expression w that depends on a single complex-valued variable at a rectangular array of points in the complex plane, use the RAYS function as described below.  The length and direction of rays between array points can be estimated using mental interpolation.  Also, the real and imaginary parts of w can be estimated from the length and direction of rays using mental conversion.

RAYS(w, z, z00, zmn, m, n) approximates to a matrix that plots in a 2D-plot window as a rectangular array of rays (i.e. line segments) whose length and direction represent the absolute value and phase angle of the expression w that depends on the variable z.  z varies from z00 at one corner of the array through zmn at the diagonally opposite corner, with m panels in the x direction and n panels in the y direction.  Before plotting an expression involving the RAYS function, use the 2D-plot window’s Options > Display > Points command to select connected small size points, and use the Options > Approximate Before Plotting command to approximate expressions before plotting them.  If the rays are too short to discern accurately or so long that they confusingly cross each other, multiply w by a suitable numerical scale factor.  For example, to see how EXP(z) varies exponentially with the real part of z and sinusoidally with the imaginary part of z, issue the above Options commands and then plot the expression

RAYS(EXP(z)/10, z, -1 - 2·pi·î, 1 + 2·pi·î, 12, 24)

To show in a 2D-plot window how a rectangular array of values in the z-plane maps into a distorted grid in the w-plane of a complex-valued expression w that depends on a complex-valued variable z, use the HORIZONTALS function as described below.  The grid points in the w-plane can be joined by line segments to help visualize the underlying grid topology.  By noting the order in which grid points are drawn and counting them, each grid point in the w-plane can be associated with a coordinate value in the z-plane.  Also, the values of w between grid points can be estimated using mental interpolation.

HORIZONTALS(w, z, z00, zmn, m, n) approximates to a matrix that plots in a 2D-plot window as an array of dots, with each row of w values joined by segments.  z varies from z00 at one corner of the grid through zmn at the diagonally opposite corner, with m panels in the x direction and n panels in the y direction.  Before plotting an expression involving the HORIZONTALS function, use the 2D-plot window’s Options > Display > Points command to select connected medium size points, and use the Options > Approximate Before Plotting command to approximate expressions before plotting them.  To join the dot columns by segments, approximate and plot the coprojection of the matrix (i.e. plot COPROJECTION(HORIZONTALS(w, z, z00, zmn, m, n)) ).  For example, issue the above Options commands and then plot the expressions

HORIZONTALS(EXP(z), z, -1-pi·î, 1+pi·î, 12, 24)

COPROJECTION(HORIZONTALS(EXP(z), z, -1-pi·î, 1+pi·î, 12, 24))

To show in a 2D-plot window how a regular polar array of values in the z-plane maps into a distorted grid in the w-plane of a complex-valued expression w that depends on a complex-valued variable z, use the ARCS function as described below.  The grid points in the w-plane can be joined by line segments along lines of constant radius and/or lines of constant phase in the z-plane to help visualize the underlying grid topology.  By noting the order in which grid points are drawn and counting them, each grid point in the w-plane can be associated with a coordinate value in the z-plane.  Also, the values of w between grid points can be estimated using mental interpolation.

ARCS(w, z, r0, rm, m, θ0, θn, n) approximates to a matrix that plots in a 2D-plot window as an array of dots, with each row of w values joined by segments.  z=r·EXP(i·θ) varies from r=r0 through rm and θ=θ0 through θn, with m panels in the r direction and n panels in the θ direction.  Before plotting an expression involving the ARCS function, use the 2D-plot window’s Options > Display > Points command to select connected medium size points, and use the Options > Approximate Before Plotting command to approximate expressions before plotting them.  To join the dots in the radial direction by segments, approximate and plot the coprojection of the matrix (i.e. plot COPROJECTION(ARCS(w, z, r0, rm, m, θ0, θn, n)) ).  For example, issue the above Options commands and then plot the expressions

ARCS(EXP(z), z, 0, pi, 4, -pi, pi, 24)

COPROJECTION(ARCS(EXP(z), z, 0, pi, 4, -pi, pi, 24))

Other Utility File Functions


NUMBER.MTH - Number Theory Functions

The exact precision integer and rational arithmetic provided by Derive make it ideal for explorations into the theory of numbers.  The built-in Piecewise Continuous Functions and Probability Functions are especially useful for this purpose.  The file NUMBER.MTH defines additional number theory functions in terms of the built-in functions.  The function definitions in NUMBER.MTH are automatically loaded when any of its functions are first used.

EXTENDED_GCD(a, b) simplifies for integers a and b to a vector [d, [x, y]] of integers such that

d = gcd(a, b) = x·a + y·b

using the extended Euclidean gcd algorithm.  For example, to find the extended gcd of 20580 and 85176, simplify the expression

EXTENDED_GCD(20580, 85176)

SOLVE_MOD(u, x, m) simplifies to a vector of solutions of the linear congruence equation u(x) mod m.  For example, to solve the equation 3·x = 30 mod 9, simplify either of the expressions

SOLVE_MOD(3·x = 30, x, 9)

SOLVE_MOD(3·x - 30, x, 9)

CRT(a, m) simplifies to the solution of the system of linear congruence equations x = ai mod mi, where the elements of m must be pairwise coprime, using the Chinese Remainder Theorem (CRT).  For example, to solve the congruences x = 1 mod 4, x = 2 mod 5, and x = 3 mod 11, simplify the expression

CRT([1, 2, 3], [4, 5, 11])

NTH_PRIME(n) simplifies to the nth prime number.  For example, to make a table of the first 50 primes, simplify the expression

VECTOR(VECTOR(NTH_PRIME(n+m), m, 0, 40, 10), n, 1, 10)

PRIMEPI(x, d, a) simplifies to the number of primes p ≤ x, where x is a positive real number, such that p is of the form p = k·d + a for some k ≥ 0.  d and a must be coprime natural numbers.  PRIMEPI(x) simplifies to the number of primes up to x.  For example,

[PRIMEPI(10000, 6, 1), PRIMEPI(10000, 6, 5) + 2, PRIMEPI(10000)]

simplifies to [611, 618, 1229].

FAREY(n) simplifies to a vector of Farey fractions of order n (i.e. all the fractions in the interval (0,1] whose denominator is not greater than n).  For example, to determine the Farey fractions of order 6, simplify the expression

FAREY(6)

DIVISORS(n) simplifies to the ordered vector of all the positive divisors of n.  For example, to determine the divisors of 28, simplify the expression

DIVISORS(28)

DIVISOR_SIGMA(k, n) simplifies to the sum of the kth powers of the positive divisors of n where k is a nonnegative integer.  For example, to determine the sum of the cubes of the divisors of 1000, simplify the expression

DIVISOR_SIGMA(3, 1000)

DIVISOR_TAU(n) simplifies to the number of divisors of n (i.e. it is equivalent to DIVISOR_SIGMA(0, n) ).  For example, to determine the number of divisors of 28, simplify the expression

DIVISOR_TAU(28)

EULER_PHI(n) simplifies to the Euler's totient function φ(n) (i.e. the number of positive integers not greater than n that are relatively prime to n).  For example, to determine φ(100), simplify the expression

EULER_PHI(100)

PRIME_POWER?(n) simplifies to true, if n is a power of a prime; otherwise it simplifies to false.  For example, to determine all prime powers not greater than 100, simplify the expression

SELECT(PRIME_POWER?(n), n, 1, 100)

PRIMITIVE_ROOT(n) simplifies to the smallest primitive root modulo n, if one exists; otherwise it simplifies to a question mark.  For example, to determine the primitive root modulo 54, simplify the expression

PRIMITIVE_ROOT(54)

MOEBIUS_MU(n) simplifies to the Moebius mu function of n.  For example, to determine the Moebius mu function of 100, simplify the expression

MOEBIUS_MU(100)

SQUAREFREE(n) simplifies to true, if n is square free (i.e. not divisible by the square of a prime); otherwise it simplifies to false.  For example, to determine if 837 is square free, simplify the expression

SQUAREFREE(837)

CYCLOTOMIC(n, x) simplifies to the nth cyclotomic polynomial in x.  For example, to determine the first 6 cyclotomic polynomials, simplify the expression

VECTOR([n, CYCLOTOMIC(n,x)], n, 1, 6)

GEN_LUCAS(n, p, q, L0, L1) simplifies to the nth term of the generalized Lucas sequence L(n) where L(0) = L0, L(1) = L1, and L(n+2) = p·L(n+1) - q·L(n).

U_LUCAS(n, p, q) simplifies to the nth term of the Lucas sequence U(n) where U(0)=0, U(1)=1, and U(n+2)=p·U(n+1)-q·U(n).  For example, to determine U(30) with p=1 and q=-1, simplify the expression

U_LUCAS(30, 1, -1)

V_LUCAS(n, p, q) simplifies to the nth term of the Lucas sequence V(n) where V(0)=2, V(1)=p, and V(n+2)=p·V(n+1)-q·V(n).  For example, to determine V(30) with p=1 and q=-1, simplify the expression

V_LUCAS(31, 1, -1)

U_MOD(n, p, q, m) simplifies to U_LUCAS(n, p, q) mod m, but is much more efficient.  If the discriminant p²-4·q is 0 mod m, a question mark is returned.  For example, to show that U(30) is divisible by 31 with p=1 and q=-1, simplify the expression

U_MOD(30, 1, -1, 31)

V_MOD(n, p, q, m) simplifies to V_LUCAS(n, p, q) mod m, but is much more efficient.  For example, to find V(31) mod 31 with p=1 and q=-1, simplify the expression

V_MOD(31, 1, -1, 31)

LUCAS(n) simplifies to the nth Lucas number (i.e. it is equivalent to V_LUCAS(n,1,-1)).  For example, to determine the first 11 Lucas numbers, simplify the expression

VECTOR(LUCAS(n), n, 0, 10)

FIBONACCI(n) simplifies to the nth Fibonacci number.  For example, to determine the first 11 Fibonacci numbers, simplify the expression

VECTOR(FIBONACCI(n), n, 0, 10)

PELL(n) simplifies to the nth Pell number.  For example, to determine the first 11 Pell numbers, simplify the expression

VECTOR(PELL(n), n, 0, 10)

LUCAS_LEHMER(p) simplifies to true, if the Mersenne number 2^p-1, where p is an odd prime, is prime, otherwise it simplifies to false.  For example, to determine if 2^31-1 is prime, simplify the expression

LUCAS_LEHMER(31)

NEXT_MERSENNE_DEGREE(n) simplifies to the smallest prime p > n such that the Mersenne number 2^p - 1 is prime.  For example, to determine the first prime p > 31 such that 2^p - 1 is prime, simplify the expression

NEXT_MERSENNE_DEGREE(31)

MERSENNE_LIST(n) simplifies to the first n primes p for which the corresponding Mersenne number 2^p - 1 is prime.  For example, to find the 12 smallest exponents of this kind, simplify the expression

MERSENNE_LIST(12)

MERSENNE_DEGREE(n) is the nth exponent (ordered by size) for which the corresponding Mersenne number is known to be prime.  For example, to determine the exponent of the largest known Mersenne prime as of 13 August 1999, simplify the expression

MERSENNE_DEGREE(38)

MERSENNE(n) simplifies to the nth Mersenne prime.  For example, to determine the first 12 Mersenne primes, simplify the expression

VECTOR(MERSENNE(n), n, 1, 12)

PERFECT(n) simplifies to the nth perfect number (i.e. numbers that are equal to the sum of their divisors).  For example, to determine the first 10 perfect numbers, simplify the expression

VECTOR(PERFECT(n), n, 1, 10)

CONTINUED_FRACTION(u, n) approximates to a vector of n+1 partial quotients of the continued fraction of u.  If ?s appear in the result, use the Precision field of the Declare > Simplification Settings command to increase the precision.  For example, to determine the first 8 partial quotients of the continued fraction for the base of the natural logarithms e, simplify the expression

CONTINUED_FRACTION(#e, 8)

CONVERGENT(x, k) simplifies to the kth convergent of x based on the continued fraction of x.  For example, to approximate √2 using the 10th convergent, simplify the expression

CONVERGENT(SQRT(2), 10)

CONVERGENTS(x, k) simplifies to a vector of the 0 through kth convergents of x based on the continued fraction for x.  For example, to generate a vector of the first 11 convergents of √2, simplify the expression

CONVERGENTS(SQRT(2), 10)

JACOBI(a, b) simplifies to the Jacobi symbol (a/b), where a is assumed to be an integer and b an odd natural number.  Jacobi symbols play an important role in number theory.  In particular, if b is an odd prime, then 1 + (a/b) is the number of mod b incongruent solutions of the congruence x^2 = a mod b.  For example, to see whether 2 is a square mod 23 or not, simplify the expression

JACOBI(2, 23)

SQUARE_ROOT(a, p) simplifies to a square root of a mod p, where a is an integer and p a prime, if one exists and a question mark otherwise.  For example, to determine a square root of 2 mod 23, simplify the expression

SQUARE_ROOT(2,23)

Other Utility File Functions


COMBINAT.MTH - Combinatorial Functions

The COMBINAT.MTH defines various combinatorial functions.  The function definitions in COMBINAT.MTH are automatically loaded when any of its functions are first used.

CATALAN(n) simplifies to the nth Catalan number.  For example, to determine the first 10 Catalan numbers, simplify the expression

VECTOR(CATALAN(n), n, 1, 10)

STIRLING1(n, k) and STIRLING_CYCLE(n, k) simplify to Stirling numbers of the first kind.  For example, to determine the first 10 Stirling numbers of the first kind with k=5, simplify either of the expressions

VECTOR(STIRLING1(n,5), n, 1, 10)

VECTOR(STIRLING_CYCLE(n,5), n, 1, 10)

STIRLING2(n, k) and STIRLING_SUBSET(n, k) simplify to Stirling numbers of the second kind.  For example, to determine the first 10 Stirling numbers of the second kind with k=5, simplify the expression

VECTOR(STIRLING2(n,5), n, 1, 10)

VECTOR(STIRLING_SUBSET(n,5), n, 1, 10)

BERNOULLI(n) simplifies to the nth Bernoulli number.  For example, to determine the first 10 Bernoulli numbers, simplify the expression

VECTOR(BERNOULLI(n), n, 1, 10)

BERNOULLI_POLY(n, x) simplifies to the nth Bernoulli polynomial evaluated at x.  For example, to make a table of the first 6 Bernoulli polynomials, simplify the expression

TABLE(BERNOULLI_POLY(n,x), n, 1, 6)

EULER(n) simplifies to the nth Euler number.  For example, to determine the first 10 Euler numbers, simplify the expression

VECTOR(EULER(n), n, 1, 10)

EULER_POLY(n, x) simplifies to the nth Euler polynomial evaluated at x.  For example, to make a table of the first 6 Euler polynomials, simplify the expression

TABLE(EULER_POLY(n,x), n, 1, 6)

PARTS(n) simplifies to the number of decompositions of n into integer summands without regard to order.  For example, to verify that the number of parts of 4 = 1+3 = 2+2 = 1+1+2 = 1+1+1 is 5, simplify the expression

PARTS(4)

PARTS_LIST(n) simplifies to an n+1-element vector of the number of decompositions of 0 through n into integer summands without regard to order.  For example, to determine the number of parts of 0 through 4, simplify the expression

PARTS_LIST(4)

DISTINCT_PARTS(n) simplifies to the number of decompositions of n into distinct integer summands without regard to order.  For example, to verify that the number of distinct parts of 4 = 1+3 is 2, simplify the expression,

DISTINCT_PARTS(4)

BELL(n) simplifies to the nth Bell or exponential number.  For example, to determine the first 11 Bell numbers, simplify the expression

VECTOR(BELL(n), n, 0, 10)

RECURRENCE(u, v , v0, m) simplifies to a vector of m elements of the recurrence u where v0 is a vector of the first elements and v is a variable.  For example, to determine the first 8 Fibonacci numbers, simplify the expression

RECURRENCE(v SUB 1 + v SUB 2, v, [1,1], 8)

TRIANGULAR(n) simplifies to the nth triangular number.  For example, to determine the first 10 triangular numbers, simplify the expression

VECTOR(TRIANGULAR(n), n, 1, 10)

TETRAHEDRAL(n) simplifies to the nth tetrahedral number.  For example, to determine the first 10 tetrahedral numbers, simplify the expression

VECTOR(TETRAHEDRAL(n), n, 1, 10)

PENTATOPE(n) simplifies to the nth pentatope number.  For example, to determine the first 10 pentatope numbers, simplify the expression

VECTOR(PENTATOPE(n), n, 1, 10)

POLYGONAL(n, p) simplifies to the nth p-sided polygonal number, p≥2.  For example, to determine the first 10 4-sided polygonal numbers, simplify the expression

VECTOR(POLYGONAL(n, 4), n, 1, 10)

POLYGONAL_PYRAMID(n, p, d) simplifies to the nth p-sided d-dimensional polygonal pyramid number, p≥2.  For example, to determine the first 10 4-sided 4th dimensional polygonal pyramid numbers, simplify the expression

VECTOR(POLYGONAL_PYRAMID(n, 4, 4), n, 1, 10)

HEX(n) simplifies to the nth hex (i.e. 6-sided centered) number.  For example, to determine the first 10 hex numbers, simplify the expression

VECTOR(HEX(n), n, 1, 10)

STAR(n) simplifies to the nth star (i.e. 12-sided centered) number.  For example, to determine the first 10 star numbers, simplify the expression

VECTOR(STAR(n), n, 1, 10)

CENTERED(n, p) simplifies to the nth p-sided centered number.  For example, to determine the first 10 8-sided centered numbers, simplify the expression

VECTOR(CENTERED(n,8), n, 1, 10)

OCTAHEDRAL(n) simplifies to the nth octahedral number.  For example, to determine the first 10 octahedral numbers, simplify the expression

VECTOR(OCTAHEDRAL(n), n, 1, 10)

CENTERED_PYRAMID(n, p, d) simplifies to the nth p-sided d-dimensional centered pyramid number, p≥2.  For example, to determine the first 10 6-sided 3-dimensional numbers, simplify the expression

VECTOR(CENTERED_PYRAMID(n, 6, 3), n, 1, 10)

CENTERED_CUBE(n, d) simplifies to the nth d-dimensional centered cube number.  For example, to determine the first 10 3-dimensional centered cube numbers, simplify the expression

VECTOR(CENTERED_CUBE(n, 3), n, 1, 10)

RHOMBIC_DODECAHEDRAL(n) simplifies to the nth rhombic dodecahedral number.  For example, to determine the first 10 rhombic dodecahedral numbers, simplify the expression

VECTOR(RHOMBIC_DODECAHEDRAL(n), n, 1, 10)

CENTERED_HEX(n, d) simplifies to the nth d-dimensional centered hex number.  For example, to determine the first 10 4-dimensional centered hex numbers, simplify the expression

VECTOR(CENTERED_HEX(n, 4), n, 1, 10)

Other Utility File Functions


MISC.MTH - Miscellaneous Utility Functions

The file MISC.MTH contains functions for miscellaneous tasks that do not fit the categories of the other utility files.  The function definitions in MISC.MTH are automatically loaded when any of its functions are first used.

SQUARE_WAVE(n) simplifies to 1 if n mod 2 is less than 1, otherwise it simplifies to -1.

Consider the sum of t from n=a to infinity where t is an expression dependent on index variable n.  To determine if the series converges or diverges for a given t, first enter the above sum and see if it simplifies to a closed form of finite or infinite magnitude.  Success in finding a closed form sum may require restricting the domains of variables in t (other than the index variable n) to appropriate intervals (see the Declare Variable Domain command).

If Derive does not return a closed form sum, there are many tests you can use to determine if a series converges or diverges.  For example, Leibniz's alternating series test states that a series converges if

•	t alternates in sign beyond a certain n,

•	the limit of t as n approaches infinity is 0, and

•	|t| is nonincreasing beyond a certain n.

Convergence tests for non-alternating series are given in Calculus textbooks.  Most of these tests are easy to apply directly using Derive's Calculus Limit or  Calculus Integrate commands.  However, the particularly useful ratio test requires a substitution followed by a limit, so the following function is defined in MISC.MTH to facilitate performing this test:

RATIO_TEST(t, n) simplifies to the limit of the absolute value of the ratio of the n+1th term of the series to the nth term, as n approaches infinity.  If the result is greater than 1, the series diverges.  If the result is less than 1, the series converges.  If the result equals 1, the test is inconclusive.

If u(x,y) is an expression dependent on the variables x and y, Derive simplifies LIM(u, [x, y], [x0, y0]) by first computing the limit with respect to x, then with respect to y.  This result may be different than LIM(u, [y, x], [y0, x0]).  In contrast, the following function returns the multivariate limit:

LIM2(u, x, y, x0, y0) simplifies to the limit of u as [x, y] approaches [x0, y0] along a straight straight line of slope @1.  If the result is independent of @1, the limit is independent of the direction of approach.

The adaptive Simpson's Rule method Derive uses to numerically approximate definite integrals is fast, robust, and accurate (see the Calculus Integrate command).  However, simpler numerical integration methods are useful for educational purposes; for obtaining rigorous bounds on the integrals of monotonic, concave, or convex integrands; and for approximating definite integrals when the integrands depend on parameters other than the integration variable.

LEFT_RIEMANN(u, x, a, b, n) approximates to the left Riemann sum for the integral of expression u from x=a through b, using n equal-width rectangular strips.  If Derive can determine a closed form for the sum for symbolic n, then you may prefer to use the  Simplify Basic Command rather than the Simplify Approximate Command so that you can simplify the limit of that closed-form sum as n approaches infinity.  Otherwise you should use numeric n and the Simplify Approximate command.

There may be expressions for which Derive is unable to find a closed form antiderivative, even though one exists.  You may be able to help Derive integrate such expressions by using one of the following functions to explicitly integrate by parts or to make a change of variable.

INT_PARTS(u, v, x) uses integration by parts to find the antiderivative of the expression u·v with respect to x.

INT_SUBST(y, x, u) finds the antiderivative of the expression y(x) with respect to x by substituting the inverse of u(x) for x in y, integrating, and then substituting u(x) for x in the result.  This technique is called integration by substitution.  For example,

INT_SUBST(t·SIN(t^2), t, t^2)

simplifies to

        2
   COS(t )
- ---------
      2

DEF_INT_SUBST(y, x, u, a, b) finds the definite integral of the expression y(x) from x=a to x=b by substituting the inverse of u(x) for x in y and integrating the result from u(a) to u(b).

INVERSE(u, x) simplifies to the inverse of expression u(x) with respect to x.  For example, INVERSE(SIN(x/b), x) simplifies to b ASIN(x).  Note that making appropriate domain declarations (see the Declare Variable Domain command) of variables that occur in u will help INVERSE produce the desired result.

Derive can assist with many proofs, including inductive ones.  The classic example of an inductive proof is showing that the sum of t(k) from k=a to n equals s(n).  This can be done by proving that t(a) - s(a) = 0 and proving that

s(n) + t(n+1) - s(n+1) = 0

This is just substitution followed by algebraic simplification, seeking two expressions equivalent to zero.  Consequently, it is easily automated using the LIM function to do the substitutions:

PROVE_SUM(t, k, a, n, s) simplifies to a vector of two expressions.  If both expressions are equivalent to 0, the sum formula above is proved.  If either expression is not equivalent to 0, the sum formula is disproved.  The technique used in PROVE_SUM can be adapted to many other broad categories of inductive proofs.

The following two functions are for extracting components of polynomials:

POLY_COEFF(u, x, n) simplifies to the coefficient of the x^n term(s) of the polynomial u(x).

POLY_DEGREE(u, x) simplifies to the degree of x in the polynomial u(x).  Note that it returns -1 as the degree of 0, the zero polynomial.  If desired, the definition of POLY_DEGREE can be modified using an IF expression to return 0 if u=0.  Others may prefer that it be modified to return minus infinity if u=0.

The following functions and variable show how the pseudo-random number generator function (see the Probability Functions) can be used:

random_sign simplifies to either 1 or -1 randomly with equal probability.

RANDOM_POLY(x, d, s) simplifies to a polynomial of degree d in the variable x with random number coefficients between -s and s exclusive.

RANDOM_VECTOR(n, s) simplifies to an n element vector with random number elements between -s and s exclusive.

RANDOM_MATRIX(m, n, s) simplifies to an m by n element matrix with random number elements between -s and s exclusive.

RANDOM_NORMAL(s,m) simplifies to a random value with a normal distribution having a standard deviation of s and a mean value of m.

The following function indicates how well an expression approximates a set of data points:

GOODNESS_OF_FIT(u, x, A) returns the standard deviation of expression u(x) from the values given in data matrix A.  u(x) can be the expression returned by the built-in function FIT, provided u(x) is dependent on only one data variable (see the Statistical Functions).  For numerical data, GOODNESS_OF_FIT should be approximated rather than simplified.

POLY_INTERPOLATE(A, x)  simplifies to the polynomial in variable x that interpolates the  [x, y]  coordinate pairs given by the rows of the two-column matrix A.  When applicable, POLY_INTERPOLATE is generally preferable to the built-in FIT function (see the Statistical Functions).  For example,

POLY_INTERPOLATE([[0,0], [1,1], [2,2], [3,0]], x)

simplifies to

  2
 x ·(3 - x)
------------
      2

POLY_INTERPOLATE_EXPRESSION(u, x, a)  simplifies to the polynomial in variable x that interpolates the expression u given the one dimensional vector of supporting points a.

Other Utility File Functions


Programming in Derive

In Derive, a program is just a MTH file of related function definitions and variable assignments.  The utility files distributed with Derive are examples of such programs.  To use a program, load the MTH file into an algebra window using the File Load Utility command.  Once loaded, the functions and variables defined in the MTH file can be used in mathematical expressions in the same way that the built-in functions and constants are used.

See the Declare Variable Value command for a description of how to assign values to variables.  See the Declare Function Definition command for a description of how to define functions.

These topics describe how to write your own programs using the various tools provided by Derive:

The ITERATES Function

The ITERATE Function

IF Expressions

Nested IF Expressions

Boolean Test Clauses

Recursive Functions

Mutual Recursion

Procedural Programming

Epilogue

Other Help Contents


The ITERATES Function

In most programming languages numerical operations are usually done by iteration (i.e. loops and jumps) and/or by recursion (i.e. recursive function calls).  Many of these operations can easily be done in Derive using its built-in calculus and vector functions (see Calculus commands and Vectors and Matrices).  For example, SUM and PRODUCT can be used to add or multiply a sequence of expressions.  VECTOR can be used to generate a table of data.  The SUB operator can be used to extract data from a vector or table.

In addition to these specialized functions, Derive provides two built-in functions for general-purpose iteration:  ITERATE and ITERATES.  Simplifying or approximating an expression of the form

ITERATES (u, x, x0)

causes the update formula

x  ←  u(x)

to be repeatedly applied, starting with x=x0, until x is equal to one of its earlier values.  The result is a vector of these values, starting with x0.

The fixed-point iteration method for solving an equation provides a good illustration of the use of ITERATES.  For example, to solve the transcendental equation x = exp(-x/20) plot the difference in the two sides of the equation

x - EXP(-x/20)

and note that a solution exists in the neighborhood of x=1.  To refine this initial guess, substitute the guess into the right side of the equation, and then approximate the result to determine a second approximation for x.  Then substitute this second approximation for x in the right side to determine a third approximation, and so on.

The function ITERATES can be used to automate this process.  For example, using the Simplify > Approximate command at 6 digits of precision,

solns := ITERATES(EXP(-x/20), x, 1)

approximates to the vector

[1, 0.951229, 0.953551, 0.953441, 0.953446, 0.953446, 0.953446, 0.953446]

of successively better approximations to x = exp(-x/20).

If the above expression involving ITERATES is simplified rather than approximated, no iterate would ever equal an earlier one and the iteration would never terminate.  Therefore, approximation is the appropriate operation to apply for this particular application of ITERATES.

Note that displayed in decimal notation the last four approximations in the above vector appear equal.  However if solns is simplified, the approximations are displayed in rational notation as

    4681    349    8437    19559    21013    18412    18412
1, ——————, —————, ——————, ———————, ———————, ———————, ———————
    4921    366    8849    20514    22039    19311    19311

and it becomes apparent that only the last two values are actually equal.  The decimal notation only makes it appear that ITERATES did more iterations than necessary.

ITERATES takes an optional fourth argument giving exactly how many iterations to perform.  For example, at 6 digits of precision

ITERATES(EXP(-x/20), x, 1, 5)

approximates to the six element vector

[1, 0.951229, 0.953551, 0.953441, 0.953446, 0.953446]

If the fourth argument of ITERATES is a negative integer, the inverse of the first argument is iterated upon.  For example,

ITERATES(TAN(x), x, x, -1)

simplifies to [x, ATAN(x)].  This feature is used to define INVERSE in MISC.MTH.

The fixed-point iteration method often diverges since the magnitudes of successive iterates get bigger and bigger until memory is exhausted.  Thus, it is usually a good idea to make the fourth argument of ITERATES a small positive integer.  See SOLVE.MTH for more detailed discussion of fixed-point iteration.

Newton's method for solving an equation provides another good illustration of the use of ITERATES.  For example, if the function NEWTON is defined as

NEWTON(u, x, x0, n) := ITERATES(x - u/DIF(u, x), x, x0, n)

NEWTON can be used to solve equations of the form u=0 with an initial guess of x=x0.  It repeatedly applies the update formula

x ← x - u/u’

to correct the current approximation for x by subtracting u divided by the derivative of u and evaluating the result at x.  If n is a positive integer, the iteration is repeated n times; otherwise, it is repeated until x is equal to one of its earlier values.  For example,

NEWTON(x^2-3, x, 2)

approximates to a vector of successively better approximations to the square root of 3.  See SOLVE.MTH for a more detailed discussion of Newton's method.

As another example of the use of ITERATES, consider the continued fraction

              a
b + —————————————————————
                a
    b + —————————————————
               ...
                     a
              b + ———————
                       a
                  b + ———
                       x

where there are n divisions.  Entering such expressions on the expression entry line would be tedious, especially for large n.  However, using ITERATES it is possible to generate the continued fraction by applying the update formula

r  ←  b+ a/r

to itself n times, starting with r=x.  For example, if the function CF is defined as

CF(b, a, x, n) := ITERATES(b + a/r, r, x, n)

trivially factoring

CF(1, 1, x, 6)

yields a vector that allows you to guess the general form of the continued fraction a=1 and b=1 for n divisions.

Other Programming in DERIVE


The ITERATE Function

In many cases only the last iterate is of interest, particularly when the fourth argument is omitted or the Simplify Basic command is used so that convergence is less of an issue.  ITERATE is identical to ITERATES, except that ITERATE returns only the last iterate.  ITERATE returns ? if the iteration does not converge to a single unique value (i.e. if the cycle length is not 1).

For example, to compute the nth power of x, define the function

POWER(x, n) := ITERATE(a·x, a, 1, n)

Here the update formula  a <-- a·x  is being applied n times, starting the accumulator a with the initial value 1.  This iteration multiplies n copies of x, giving x^n.  Although Derive has a built-in ^ operator for raising an expression to a power, POWER is a good elementary application demonstrating the use of ITERATE.

When an iteration depends on two or more of the previous iterates, you can use a vector with ITERATE to store the previous iterates.  For example, the Fibonacci numbers are defined by the recurrence

FIB(n) = 0	if n = 0,
FIB(n) = 1	if n = 1, and
FIB(n) = FIB(n-1) + FIB(n-2)	if n > 1.

where n is a nonnegative integer.  Use a two-element vector v to store the value of FIB(n-2) and FIB(n-1).  Then by letting n=2 the above recurrence specifies that the initial value of v is [0, 1].  Also it specifies that to update v, make its new first component its previous second component and make its new second component the sum of the two previous components.  This initialization and update are accomplished using ITERATE as follows:

FIB(n) := ITERATE([v SUB 2, v SUB 1 + v SUB 2], v, [0, 1], n)

If FIB is defined as shown and n is a nonnegative integer, FIB(n) will simplify to a vector whose first element is the nth Fibonacci number and whose second is the n+1th Fibonacci number.  For example, FIB(100) simplifies to

[354224848179261915075, 573147844013817084101]

and 354224848179261915075 is the 100th Fibonacci number.

Instead of a variable, the second argument of ITERATE and ITERATES can be a vector of variables and the third argument a vector of values for those variables.  This can simplify definitions using these functions by eliminating the need to use subscripts.  For example, this simplifes the definition for FIB given earlier to

FIB (n) := ITERATE([k, j+k], [j, k], [0, 1], n)

For additional examples of iteration, inspect the definitions of the functions

•	FIXED_POINT and NEWTONS in the file SOLVE.MTH,

•	IMP_DIF and PARA_DIF in the file DIF_APPS.MTH, and

•	PICARD, EULER, TAYLOR_ODE1, TAYLOR_ODES and RK in the file ODE_APPR.MTH.

Other Programming in DERIVE


IF Expressions

Often functions are defined in a piecewise manner using one or more conditions.  For example, a job may pay $10 per hour for the first 40 hours per week and $15 per hour for any additional hours.

IF expressions are a convenient way to express such conditions in Derive.  For example, if h hours are worked during a week, the above pay schedule can be entered as

IF(h <= 40, 10h, 400 + 15·(h - 40))

When this IF expression is simplified and if Derive determines that the condition h <=40 is true using the current value or domain declaration of h, the second argument 10·h is simplified and returned.  If Derive determines that the condition is false, the third argument 400 + 15·(h - 40) is simplified and returned.  For example, if h is assigned a value of 50, this IF expression simplifies to 550.  Or if h is not assigned a value but is declared less than 30, it simplifies to 10h.

If Derive cannot determine whether the condition is true or false, the entire IF expression is returned.

Note that an IF expression can be used as a subexpression within another expression.  For example, adding a $100 bonus to the above pay schedule can be entered as

100 + IF(h <= 40, 10h, 400 + 15·(h - 40))

A pair of expressions separated by one of the relational operators (=, /=, <, <=, >, or >=) is a relation (see Entering Equations and Relations).  When a relation is simplified, its two sides are simplified independently and Derive makes no attempt to determine the truth or falsehood of the relation.  However, when a relation appears as the first clause of an IF expression and the IF expression is simplified, Derive treats the relation as a condition and actively tries to determine its truth value.

The general form of the IF expression is

IF (test, then, else, unknown)

where the test clause is a condition, and the then, else, and unknown clauses are expressions.  If the test clause is not a relation or a logical combination of relations (see Boolean Test Clauses), it is treated as the condition test=0.

When an IF expression is simplified, Derive evaluates the test clause to determine its truth value.  If true, the then clause is simplified and returned as the value of the IF expression.  If false, the else clause is simplified and returned.  If the truth value cannot be determined, the unknown clause is simplified and returned.  Note that whichever clause is returned, the other two clauses are not simplified.

If the unknown clause is omitted and the truth value of the test clause cannot be determined, the entire IF expression is returned.  This is often informative, and subsequent assignments or domain declarations might enable you to resimplify the IF expression to a decisive result.  Alternatively, ? is often used as the unknown clause since it yields a more compact result when the truth value of the test clause cannot be determined.  ? is the expression signifying a quantity of unknown phase and magnitude.

If the else clause is also omitted from the IF expression, a default value of ? is assumed for it.  Finally, if the then clause is also omitted, IF returns 1 if the argument evaluates to true, otherwise it returns 0.  When used in conjunction with the SUM function, this is useful for counting the elements of a vector or sequence that satisfy some condition.  For example,

SUM(IF(PRIME(n)), n, 1, 100)

simplifies to 25, the number of primes between 1 and 100.

An expression of the form

ITERATE (IF (test, x, u), x, x0)

can be used to search for a number or expression that satisfies the search condition test.  Given x, u generates the next number or expression to test.  For example,

ITERATE(IF(PRIME(n) AND PRIME(n+2), n, n+2), n, 100001)

simplifies to 100151, the leading element of the first prime pair larger than 100000.  (Prime pairs are consecutive primes that differ by 2.)

IF expressions can be used on the right side of a function definition.  For example, most Derive functions are defined for complex as well as real values of their arguments, and many functions return complex results for some real values of their arguments.  However, in an educational setting devoted to the real domain, some instructors may prefer that functions return ? when an argument or a result is not real.  Using the following filter function, more restrictive variants can be defined that impose this constraint:

REAL_ONLY(x) := IF(IM(x) = 0, x)

Note that the else clause of the IF expression is omitted so that ? is automatically returned if Derive can determine that IM(x) is not 0.

As examples of using REAL_ONLY, you can define:

REAL_LN(x) := REAL_ONLY(LN(x))

REAL_ABS(x) := ABS(REAL_ONLY(x))

LN(x) is not real-valued if x is negative.  ABS(x) is real-valued even if x is not real.  These two facts account for the different placement of REAL_ONLY in the above definitions.

Since zero can be approached from either the positive or negative direction, or for that matter any direction in the complex plane, zero does not have a definite sign.  Thus, SIGN(0) simplifies to plus-or-minus 1 (see Complex Variable Functions).

For additional examples of IF expressions, inspect the definitions in the files VECTOR.MTH and NUMERIC.MTH.

Other Programming in DERIVE


Nested IF Expressions

Sometimes multiple conditions are required to define a function.  For example, a job may pay $10 per hour for the first 40 hours per week, $15 per hour for additional hours through 50 per week, and $20 per hour for hours exceeding 50 per week.

Nested IF expressions are a convenient way to express multiple conditions.  Any clause of an IF expression can itself be an IF expression.  For example, the above pay schedule can be entered as

IF(h <= 40, 10h, IF(h <= 50, 400 + 15(h - 40), 550 + 20(h - 50)))

IF expressions can be nested arbitrarily deep; however, it is usually better to subdivide complicated IF expressions into more comprehensible components by defining auxiliary helper functions.

Other Programming in DERIVE


Boolean Test Clauses

The Boolean AND operator makes it possible to express the conjunction of two conditions (see the Boolean Constants and Operators).  When used in the test clause of IF Expressions, this makes it possible to define functions that depend on both of two conditions being true.

For example, a job may pay a flat $10 per hour for any number of hours per week.  Obviously, at least 0 hours will be worked and at most 168 hours can be worked (i.e. the number of hours in a week).  Any number of hours outside that range must be a mistake.  If h hours are worked during a week, the following IF expression returns the correct pay when h is a valid number of hours, and it returns ? when h is not valid:

IF(0 <= h AND h <= 168, 10h, ?)

When an IF expression is simplified and AND is the top-level operator of the test clause, the truth value of the test clause is determined as follows:  The left operand of the AND is evaluated and

•	If its truth value is false, the value of the test clause is also false.  Note that in this case the right operand of the AND is not evaluated.

•	If its truth value is true, the right operand of the AND is evaluated and returned as the value of the test clause.

•	If its truth value cannot be determined, the right operand of the AND is evaluated and if it is false, the value of the test clause is also false.  Otherwise, the truth value of the test clause cannot be determined.

The Boolean OR operator makes it possible to express the disjunction of two conditions (see the Boolean Constants and Operators).  When used in the test clause of IF Expressions, this makes it possible to define functions that depend on either of two conditions being true.

For example, a triangle is isosceles if any two of its angles are equal.  CATEGORY is a function that returns "Isosceles" or "Scalene" depending on the three angles a, b and c:

CATEGORY(a,b,c) :=
IF(a=b OR a=c OR b=c, "Isosceles", "Scalene")

Note that the OR operator corresponds to the phrase "and/or" in English.  Thus, CATEGORY returns "Isosceles" even if all three angles are equal.

When an IF expression is simplified and OR is the top-level operator of the test clause, the truth value of the test clause is determined as follows:  The left operand of the OR is evaluated and

•	If its truth value is true, the value of the test clause is also true.  Note that in this case the right operand of the OR is not evaluated.

•	If its truth value is false, the right operand of the OR is evaluated and returned as the value of the test clause.

•	If its truth value cannot be determined, the right operand of the OR is evaluated and if it is true, the value of the test clause is also true.  Otherwise, the truth value of the test clause cannot be determined.

Each operand of AND or OR can itself be an expression involving AND or OR.  For example, three values a, b, and c are a monotonic sequence if  a<=b<=c  or  a>=b>=c.  The following IF expression tests for monotonicity:

IF(a<=b AND b<=c OR a>=b AND b>=c,
"Monotonic", "Nonmonotonic")

AND has a higher precedence than OR (see the Boolean Constants and Operators), so the above test clause is interpreted as if it were parenthesized

(a <= b AND b <= c) OR (a >= b AND b >= c)

rather than

a <= b AND (b <= c OR a >= b) AND b >= c

Each relational operator (see the Relational Operators) has a complementary operator equivalent to its negation.  Thus, the negation of a test clause can be transformed into a more readable and efficient one using the complementary operator.  For example, NOT(x>5) is equivalent to x<=5, and NOT(x=5) is equivalent to x/=5.

To avoid errors and save time and space, it is worth using Derive to find the simplest possible Boolean expression for use as the test clause of IF expressions (see the Boolean Constants and Operators).

Other Programming in DERIVE


Recursive Functions

A function definition is recursive if the right side of the definition calls the function being defined.  For example, if n is a nonnegative integer, the factorial of n can be computed recursively by the rules

n! = 1	if n = 0, and
n! = n(n-1)!	if n > 0.

The first rule is the terminal case for this definition.  The second rule is the recursive case.  The Derive definition corresponding to the above rules is

FACT(n) := IF(n = 0, 1, n·FACT(n - 1))

To be computable, recursive definitions must have one or more terminal case rules, and the recursive case rules must make finite progress toward the terminal cases.  The above definition for computing factorials is computable because

•	When the terminal case rule is applicable (i.e. when n=0), the recursion is terminated.

•	When the recursive case rule is applicable (i.e. when n>0), the problem is reduced to one closer to the terminal case.

•	The terminal case is reached after a finite number of applications of the recursive case rule.

If x is an expression and n is a nonnegative integer, raising x to the n power can be computed recursively by the rules

RAISE(x, n) = 1	if n = 0, and
RAISE(x, n) = x RAISE(x, n-1)	if n > 0.

If m and n are integers, the greatest common divisor (gcd) of m and n can be computed recursively by the rules

GCD(m, n) = |m|	if n = 0, and
GCD(m, n) = GCD(n, |m-n|)	if n /= 0.

The recursion terminates because both arguments must become nonnegative after two recursions, and thereafter the second argument decreases toward the terminal case by at least 1 for each recursion.  It is also true that any integer that evenly divides m and n, also evenly divides n and |m - n|, including the greatest common divisor.  It is also true that the greatest common divisor of m and 0 is |m|.

The speeds of FACT and ! are approximately proportional for large n, as are the speeds of RAISE, POWER, and ^.  Although built-in operators or functions are faster, recursively defined functions can be reasonably efficient as well.  The next example illustrates the importance of writing efficient definitions.

If n is a nonnegative integer, the nth Fibonacci number can be computed recursively by the rules

FIB(n) = 0	if n = 0,
FIB(n) = 1	if n = 1, and
FIB(n) = FIB(n-1) + FIB(n-2)	if n > 1.

An iterative definition of FIB that implemented these rules was discussed using the ITERATE Function.  The following recursive definition of FIB_SLOW is another way to implement this recurrence:

FIB_SLOW(n) :=
IF(n < 2, n, FIB_SLOW(n - 1) + FIB_SLOW(n - 2))

The reason FIB_SLOW is so slow is because to compute FIB_SLOW(n), FIB_SLOW(n-2) is computed twice: once for FIB_SLOW(n) and once for FIB_SLOW(n-1).  Similarly, FIB_SLOW(n-3) is computed three times: once for FIB_SLOW(n-1) and once for each of the two computations of FIB_SLOW(n-2).  In general, FIB_SLOW(n-i) must be computed the ith Fibonacci number of times.  Thus the number of redundant calculations, and hence the time required to compute the nth Fibonacci number using FIB_SLOW increases rapidly (i.e. Fibonaccially!) with n.

Such redundant computation is typical for recursive definitions that naively implement recurrences, like Fibonacci, that are doubly recursive.  Note that the recurrences for factorial, raising to a power, and gcd were just singly recursive and so did not suffer such redundancy.

In the case of Fibonacci this inefficiency is easy to overcome:  Just define an auxiliary helper function that has extra accumulation arguments to retain previously computed values so that they do not have to be recomputed.  The main function then invokes this helper function with the appropriate starting arguments.

FIB_AUX(n, f1, f0) :=
IF(n=0, f0, FIB_AUX(n - 1, f1 + f0, f1))

FIB_FAST(n) := FIB_AUX(n, 1, 0)

For additional examples of recursive functions, see the definition of POLY_DEGREE in the file MISC.MTH or the definitions of SPHERICAL_BESSEL_J and SPHERICAL_BESSEL_Y in the file BESSEL.MTH.

Other Programming in DERIVE


Mutual Recursion

Sometimes a function invokes itself recursively via one or more intermediate functions rather than directly.  This is all right provided at least one of the mutually recursive functions has an IF expression that eventually terminates the recursion.  The F and G series from celestial mechanics provide an interesting example.  This series can be used to predict a conic trajectory of a comet given its position and velocity at one time.  The series is defined by

F(0) = 1

G(0) = 0

         d            d            d
F(n) = m·--F(n-1) + s·--F(n-1) + e·--F(n-1) - μ·G(n-1)
         dμ           dσ           dε

          d            d            d
 G(n) = m·--G(n-1) + s·--G(n-1) + e·--G(n-1) + F(n-1)
          dμ           dσ           dε

for n>0, where

m := -3·μ·σ

s := ε - 2·σ²

and

e := -σ·(μ + 2·ε)

To define a pair of mutually recursive functions F and G for computing the series, first make G an arbitrary function by the assignment

G(n) :=

then define F and G as follows:

F(n) := IF(n=0, 1,

  d            d            d
m·--F(n-1) + s·--F(n-1) + e·--F(n-1) - μ·G(n-1))
  dμ           dσ           dε

and

G(n) := IF(n=0, 0,

        d            d            d
m·--G(n-1) + s·--G(n-1) + e·--G(n-1) + F(n-1))
        dμ           dσ           dε

Making G an arbitrary function is necessary, so that the G that occurs in the definition of F is interpreted as a function rather than a variable.  G is assigned its actual definition by the final assignment above.

The above definition causes exponential recomputation of the same formulas:  F(n) requires F(n-1) and G(n-1), both of which redundantly compute F(n-2) and G(n-2), etc.  Thus it is worth redefining the recursion to use an auxiliary helper function that carries forward F(n-1) and G(n-1) in auxiliary variables.  The two final values F(n) and G(n) can be bundled together in a two-element vector and returned as the value of the function.  First, clear the definition of F and G and make them variables again by the assignments

f :=

g :=

Then define

FG_AUX(n, f, g) := IF(n=0, [f, g], FG_AUX(n-1,

  d       d       d            d       d       d
m·--f + s·--f + e·--f - μ·g, m·--g + s·--g + e·--g + f))
  dμ      dσ      dε           dμ      dσ      dε

and

FG(n) := FG_AUX(n, 1, 0)

Then for example, FG(4) simplifies to the vector

[μ·(3·ε + μ - 15·σ²), 6·μ·σ]

As a final matter of style in the preceding example, it would be better to use multiple-character names for the variables m, s and e to reduce the chance of a name conflict with any unassigned variables.  For example, use m_, s_ and e_.

In this topic an example of inefficient mutual recursion was given, and then an efficient direct recursion alternative.  Do not conclude from this that all mutual recursion is inefficient.  In fact, Derive itself is a large collection of mutually recursive functions!

Other Programming in DERIVE


Procedural Programming

The block and loop program control constructs in user-defined functions make it possible to write multi-line, procedural programs in Derive.  The arguments of the PROG program control construct are sequentially evaluated and the value of the last one evaluated is returned as the value of the call on PROG.  The arguments of the LOOP program control construct are repeatedly sequentially evaluated until an EXIT or RETURN statement terminates the loop.  An example using the PROG and LOOP control constructs is given at the end of these Release Notes.

If a call on the function RETURN is encountered at any point in the evaluation of a user-defined function, evaluation of the function terminates and the value of RETURN's argument is returned as the value of the function.  If an EXIT is encountered in the body of a PROG or LOOP control construct, evaluation of the PROG or LOOP immediately terminates and evaluation continues with the next expression in the user-defined function.

The evaluation of expressions in function definitions can be suppressed using the quote operator.  The single quote mark is used for the quote operator.  For example, '(2+3) simplifies to 2+3 instead of 5.

The quote operator is useful for quoting expressions in calls on functions that you do not want evaluated before being passed.  For example,

TERMS('(x + x + x))

simplifies to the [x, x, x]; whereas

TERMS((x + x + x))

simplifies to [3·x].

User-defined functions can be defined so they can accept any number of arguments.  If the single formal argument of a user-defined function is not enclosed in parentheses, then all the arguments in calls on the function are passed to the function as a vector.  This allows user-defined function to accept any number of arguments.  For example, after making the definition

FOO v := SUM(v)

then

FOO(2, 3, 5)

simplifies to 10 and

FOO(2, 3, 5, 7, 11)

simplifies to 28.

The default initial value of local variables in user-defined functions can be specified.  If a user-defined function is called with fewer actual arguments than the number of formal arguments given in its definition, the initial value of these extra formal arguments (i.e. local variables) can be specified by including assignments in the function's formal argument list.  For example, if SUMSQ is defined as

SUMSQ(x, y := 0, z := 0) := x^2 + y^2 + z^2

then

[SUMSQ(5), SUMSQ(5, 3), SUMSQ(5, 3, 2)]

simplifies to [25, 34, 38].  Whereas, if SUMSQ is defined as

SUMSQ(x, y, z) := x^2 + y^2 + z^2

then

[SUMSQ(5), SUMSQ(5, 3), SUMSQ(5, 3, 2)]

simplifies to

 2    2        2
y  + z  + 25, z  + 34, 38

Note that if FOO is defined as an arbitrary function by

FOO(x, y:=3, z):=

then the call FOO(5) simplifies to FOO(5,3,z).  The definition of REV at the end of this section provides a good example of the use of an initialized local variable in a user-defined function.

Use the MAP and MAP_LIST functions to map functions over the elements of vectors and sets.  If u is an expression involving the variable x and c is a set or a vector, MAP_LIST(u, x, c) evaluates u(x) for x equal to each element of c and returns the results as a set or vector (depending on the type of c).  MAP_LIST(u,k,m,n,s) evaluates u(k) for k=m to n in steps of size s.  s defaults to 1.  The function MAP evaluates u identical to MAP_LIST, but it just returns the truth-value "true".

Use the functions FIRST, REST, and ADJOIN to perform operations on vectors analogous to the way lists are processed in LISP.  FIRST(v) returns the first element of the vector v.  REST(v) returns a vector of all but the first element of v.  ADJOIN(u,v) returns a vector whose first element if u and whose remaining elements are the same as v.

Use the ASSIGN function to assign values to variables generated by programs.  The := assignment operator (see the Declare > Variable Value command) and the ASSIGN function are both used to assign values to variables.  The left operand of the := assignment operator must be a variable, since it is not simplified.  Whereas, the first argument of the ASSIGN function can be any expression, so long as it simplifies to a variable.  Therefore, use ASSIGN when it is necessary to generate a variable and then assign it a value.  For example, simplifying the expression

ASSIGN(APPEND("a", 1), 25)

generates the string variable "a1" and assigns it the value 25.

Use the :+, :-, :*, and :/ update operators to increment variables makes functions faster and easier to read.  :+, :-, :*, and :/ respectively increment, decrement, multiply, and divide the variable on their left by the amount on their right.  For example, x :+ 1 is equivalent, but faster, to x := x+1.  Similarly, x :* 2 is equivalent to x := 2*x.

User-defined function definitions are displayed in a more readable, multi-line indented format.  For example, if the definition for Rev

Rev(x,y) := PROG(y:=[], LOOP(IF(x=[], RETURN y), y:=ADJOIN(FIRST(x),y), x:=REST(x)))

is entered on the expression entry line, it displays and print as

Rev(x, y) :=
  Prog
    y := []
    Loop
      If x = []
         RETURN y
      y := ADJOIN(FIRST(x), y)
      x := REST(x)


Epilogue

Programming is like chess.  Learning the rules of the game is easy, but it takes a great deal of practice and diligence to become proficient.  Mathematical experience will Derive's built-in capabilities relatively easy and straightforward to use.  However, if you are not experienced at programming, be prepared to write lots of simple Derive programs before attempting more ambitious ones.  And most important: test your programs thoroughly!

Other Programming in DERIVE


User Contributed Math Packages

The \Users directory on the Derive diskette includes math packages contributed free of charge by various Derive users.  Some of the packages are distributed as a MTH file with accompanying DOC (documentation) and DMO (demonstration) files, having the same name as the MTH file.  Others packages are distributed as a DFW file, containing its own documentation and examples.  If you have any questions about a package, contact the author of the package directly.  The author's name and address should be included in the documentation for each package.

The following provides the name and a short description of each package:

Arrows.dfw   Provides tools for drawing vector arrows in both the 2D and 3D-plot windows. The arrows can be drawn with both proportional and fixed length barbs. The user can set a scale for the barbs in relation to the shaft of each arrow, and set a scale for sliding the barbs down the shaft of each arrow. There are also instructions to draw position vector arrows, and chains of vector arrows, using either point coordinates or column vectors.

Carlson.mth   Defines efficient, high precision functions for numerically approximating the Carlson elliptic integrals RF(x,y,z), RJ(x,y,z,p), RC(x,y), RD(x,y,z), and RG(x,y,z), and the Legendre elliptic integrals ELLIPTIC_F(phi,m), ELLIPTIC_E(phi,m), and ELLIPTIC_PI(phi,m,n) with real or complex arguments.  The algorithms are based on Numerical Algorithms 10(1995)13-26, B.C. Carlson, Numerical computation of real or complex elliptic integrals.

Codes5.dfw   This file contains utilities and demonstrations of a set of tools for generating and displaying some of the large matrices and tables involved in an introduction to a study of error-correcting codes.  Examples of how this can be carried out are given for:  standard form generator and parity-check matrices; codewords and minimum weights; syndrome look-up tables; cyclic codes; Hamming codes; Reed-Muller codes.  Some basic understanding of error-correcting codes is assumed.  This can be found in any good introduction to the topic, including: Hill, R. A First Course in Coding Theory. Oxford University Press (reprinted 1997); Baylis, J. Error Correcting Codes; A Mathematical Introduction. Chapman & Hall (1998); Open University. MT365 Graphs, Networks and Designs (Design 3: Design of Codes). OU (1995).

Eigenvals.dfw   Defines functions for finding approximate eigenvalues of large square matrices using the QR method, and for converting square matrices into upper Hessenberg form.

Eulermac.mth   Defines function for approximating finite or infinite sums using an asymptotic expansions based on the Euler-Maclaurin series approximation formula.  The formula is described on page 806, Section 23.1.30 of the Handbook of Mathematical Functions by Milton Abramowitz and Irene A. Stegun.

Int_misc.mth   Defines three functions which can be used to enhance the integration process in Derive.

Linear Recurrence Equations.dfw   Defines a function for finding the general solution of constant coefficient m-th order linear difference equations.

Logic_mu.mth   Defines functions for constructing truth tables and for comparing propositions in a max/min multi-valued (w-valued) modal logic.  Modal multi-valued logics are described in Chapter 3 of R. Turner's Logics for Artificial Intelligence, Ellis Horwood Ltd., 1984.

LogisticRegression.dfw   Defines functions for analysis of binary dependent data using logistic regression.

Ngraphs5.dfw   Provides a set of tools (together with demonstrations) for drawing a wide selection of network graphs.  Standard graph drawings include:  complete and complete bipartite graphs; Platonic graphs; the Petersen graph; the hypercube graph q4; a knight’s tour.  Graphs with bow edges, multiple edges, loops, directed edges and directed loops can also be drawn.  By combining basic concepts of network graphs with Derive’s powerful and algebraic 2D-plotting facilities a surprisingly powerful set of network graph drawing tools can be produced.

NonlinearRegression.dfw   Defines functions for both the Gauss_Newton and Marquardt methods of solving nonlinear regression problems.  The programs fit data to an arbitrary function that is not necessarily linear in its parameters.

Number.dfw   Extends Derive's built-in number theory functions with efficient functions for computing extended gcds, solving systems of linear congruence equations, computing partial quotients of continued fractions, and finding the nth prime number, perfect number, Lucas number, Fibonnaci number, Pell number, Mersenne prime, etc.

Patts2D.dfw   Provides a set of tools (together with demonstrations) for generating a variety of 2D-plot patterns.  The patterns are drawn using Boolean area plots and line plots.  They include:  cyclic and dihedral symmetry group patterns; strip-repeating and plane-filling symmetry group patterns; border and wallpaper patterns; linear and non-linear tiling and patchwork patterns.

Simplex.mth   Defines functions that perform the minimization and maximization of linear functions, under linear constraints.

Solve_plus.dfw   Extends Derive's built-in equation solving capabilities using advanced techniques.  These include the Gradient Descent (or Steepest Descent) Method for finding local mimina of multi-variate functions, and a damped version of Newton's Method that generally prevents it from diverging when a poor initial value is chosen.

Subst.mth   Solves simple systems of nonlinear equations in symbolic form. Such systems are widely used in college mathematics and especially in physics.  Dynamics for example, can not do without such systems with at least one nonlinear (quadratic) equation.

TaylorODE.dfw   Defines the function TaylorODE(f, o, t, h, n, init_vals, header?, xy_only?) that solves initial value Ordinary Differential Equations of any order using Taylor’s method.

Tensor.mth   Defines functions for tensor algebra and analysis.  From the algebraic point-of-view tensors are an extension of the vector/matrix concept to higher order arrays.

Volume Of Revolution.dfw   Shows how to produce 3D-plots of expressions revolved about either the horizontal or vertical axes.

Z Transforms.dfw   Defines functions for finding the Z transform and inverse Z transform of many types of expressions.


Glossary

Bivariate expression

Polar coordinates

Polar form

Rectangular coordinates

Rectangular form

Sufficiently simple form

Univariate expression


Bivariate expression

A bivariate expression involves exactly two variables.


Polar coordinates

In polar coordinates, a point in a plane is specified by (r, θ), where r is its distance from the origin and θ is the angle measured counterclockwise from the positive x-axis to the point.


Polar form

A complex expression is in polar form if it is in the form r·ê^(î·θ) where r is the modulus and θ is phase angle.  For example, 2·ê^(3·î) is in polar form.

If a 2D-plot window is in polar plot mode, expressions are plotted in polar coordinates, and the position of the cross is displayed in polar coordinates.  Polar plot mode is indicated by the radial axes icon [image] in the first pane of the 2D-plot window status bar.


Rectangular coordinates

In rectangular coordinates, a point in a plane is specified by (x, y), where x is its distance from the y-axis and y is its distance from the x-axis.


Rectangular form

A complex expression is in rectangular form if it is of the form a + b·î where a and b are real-valued expressions.  For example, 2 + 3·î is in rectangular form but (2 + 3·î)² is not.

If a 2D-plot window is in rectangular plot mode, expressions are plotted in rectangular coordinates, and the position of the cross is displayed in rectangular coordinates.  Rectangular plot mode is indicated by the rectangular axes icon [image] in the first pane of the 2D-plot window status bar.


Sufficiently simple form

An expression in sufficiently simple form has no superfluous variables, roots, or functions, and no reducible polynomial degrees.  An expression not in sufficiently simple form may mislead you about the dependence and qualitative behavior of the expression.  For example, a result would be highly misleading if it appeared to be quadratic in a variable when it was actually linear.


Univariate expression

A univariate expression involves only a single variable.


Frequently Asked Questions and Answers

This section answers some of the questions commonly asked by users of Derive.  The questions and answers are divided into the following categories:

User Interface Questions

Simplification Questions

Plotting Questions

Printing Questions

System Requirement Questions

Network Installation Questions

Other Help Contents


User Interface Questions

Q:	How do I highlight a subexpression of an expression or the elements of a vector or matrix?

A:	To highlight a subexpression of an expression or an element of a vector or matrix, move the mouse pointer to the desired subexpression or element, and then click the left mouse button until only the subexpression or element is highlighted.  If you double click, the smallest subexpression containing the mouse pointer is highlighted.  Alternatively, you can press Shift+Right, Shift+Left, Shift+Up or Shift+Down arrow key combinations to highlight the desired subexpression.  For a more detailed discussion, see Selecting Objects and Subexpressions.

Q.	How do I edit a highlighted expression?

A.	Press the Return key or use the Edit > Object command to edit the highlighted expression.  Or, you can press F3 to copy the highlighted expression or press F4 to copy the highlighted expression with parentheses around it into the expression entry line.  Alternatively, if you copy the expression to the Windows Clipboard using the Edit > Copy command, you can paste it onto the editing line by pressing Ctrl+V.  Note that you can click the right mouse button to select either of these copying methods from a popup menu.

Q.	How do I copy Derive expressions into a word processing document?

A.	Highlight the expressions to be copied and issue the Edit > Copy command to copy the expressions to the Windows Clipboard in text format.  Then switch to your word processor and use its Paste command (usually found in the Edit menu) to paste the expressions from the clipboard into your document.  (Note that in Microsoft Word the "Use Smart Cut and Paste" option in the Tools Options Edit dialog should be turned off before you paste the Derive expressions.  If this option is on, multi-line expressions will be improperly displayed.)  After pasting, select the expressions and reformat them using the DfW5 Printer font if it is not the default font.

Q.	Why don’t the Derive expressions display nicely in my word processing document?

A.	The only font that will display all kinds of Derive expressions properly in a word processing document is the DfW5 Printer font.  The reasons are twofold: 1) the DfW5 Printer font correctly maps all the Greek and mathematical characters displayed in a Derive Algebra window; and 2) the DfW5 Printer font is a fixed-width font.

Q.	How do I copy an image of a Derive plot window into a document in another Windows application?

A.	Using the plot window’s Edit > Copy Plot Window command or press Ctrl+C to copy an image of the plot window to the clipboard in bitmap format.  Then, switch to your Windows application and use the Paste command (usually found in the Edit menu) to paste the image into your document.  Note that the application you paste the image into must support the bitmap format.

Q.	When resizing a plot or algebra window using the sizing handles, how do I prevent the window from being redrawn before I let go of the mouse?

A.	If it takes too long to continuously display a window’s contents while resizing it, turn off the Show Window Contents While Dragging feature of Windows.  When this feature is off, only an outline of a window is displayed while it is moved or resized.  To turn it off, run the Window’s Control Panel Display program.  If running Windows 98, click on the Effects tab of the dialog box.  If running Windows NT or Windows 95 with Microsoft Plus!, click on the Plus! tab.  Finally click on the Show Window Contents While Dragging check box to turn the feature off.

Q.	Can I change the size of the characters used to display mathematical expressions on the screen?

A.	Yes!  Use the Options > Display > Font of All Expressions command to select the font size (large or small) used to display expressions in the Algebra window.  You can also control the font size used for printing and previewing expressions using the Options > Printing > Expression Layout command.

Other Frequently Asked Questions and Answers


Simplification Questions

Q:	Why does LN(e) not simplify to 1?

A:	In Derive, e is a simple variable, not the base of the natural logarithms (2.71828...).  The base of the natural logarithms is displayed as ê, and can be entered by clicking on the ê on the math symbol toolbar, by pressing Ctrl+E, or by typing #e.

Q:	Why does i^2 not simplify to -1?

A:	In Derive, i is a simple variable, not the imaginary unit (the square-root of -1).  The imaginary unit is displayed as î, and can be entered by clicking on the î on the math symbol toolbar, by pressing Ctrl+I, or by typing #i.

Q:	Why does LN(x^2-x)-LN(x) not simplify to LN(x-1)?

A:	This transformation is invalid if x is negative.  However, if you use the Declare Variable Domain command to declare x nonnegative, Derive will simplify the expression.  In general, Derive will not use a transformation unless it can determine that the transformation is valid.

Q:	How do I turn the name of a function I defined back into a variable name?

A:	Use the Declare Variable Domain command to declare the name a real-valued variable.

Q:	When I use square brackets when entering expressions like 3·[x+y], why does the result not behave correctly?

A:	In Derive, square brackets are used exclusively for entering vectors and matrices.  Thus the above expression is interpreted as 3 times the one element vector [x+y].  Parentheses rather than brackets should be used to control the order in which operators are applied (see Entering Mathematical Expressions).

Q:	When I integrate the derivative of x/(x+1), why do I get -1/(x+1) instead of the original expression?

A:	Antiderivatives are not unique and may differ by a constant.  In this case x/(x+1) and -1/(x+1) differ by the constant 1, and both are valid antiderivatives.

Other Frequently Asked Questions and Answers


Plotting Questions

Q:	Why does x^(1/3) not plot for negative x?

A:	The principal cube root of a negative number is complex and cannot be plotted directly.  Use the Branch field of the algebra window’s Declare > Simplification Settings command to make Derive select the real branch instead of the principal branch while plotting.

Q:	When I try to plot a vector of two expressions the 2D-plot window, why does Derive not plot them correctly?

A:	Derive plots a vector of two univariate expressions parametrically (see Parametric Plots).  However, you can add ? as a dummy third element to the vector so Derive produces the multiple plot you desire.

Q:	In the 2D-plot window, how do I make x²+y² = 4 plot like a circle instead of an ellipse?

A:	Issue the Set > Aspect Ratio command, and click on the Reset button and then the OK button to make the physical distance between horizontal and vertical tick marks the same.

Q:	How can I make a 3D plot of two intersecting surfaces?

A:	Highlight and plot the expression defining the first surface in the 3D-plot window.  Then return to the algebra window, and highlight and plot the expression defining the second surface.  Rotating the plots will help you visualize the intersection better.  Also increasing the number of grid intervals of both plots makes the intersection clearer.

Other Frequently Asked Questions and Answers


Printing Questions

Q.	How do I print color plots?

A.	Turn off the "black and white only" printing option using the plot window’s Options > Printing > Black and White Only command and select a color printer using the Options > Printing > Printer Setup command.

Q.	Why are some text lines cut-off when previewing the worksheet?

A.	Derive uses commercial software to print preview text objects.  The vendor of this software has confirmed a problem that causes the right end of text lines in Derive text objects to be truncated.  However, if you zoom the print preview all the way in, all the text will be displayed correctly.  Note that the text lines will be printed correctly, even if they are appear cut-off while previewing the worksheet.

Other Frequently Asked Questions and Answers


System Requirement Questions

Q.	What are the system requirements to run Derive 5?

A. 	You need a computer running Windows 95, 98, 2000, Me, or NT or compatible operating system, a CD ROM drive, and approximately 3 megabytes of hard disk space to store the program.  The minimum amount of physical RAM memory required to run Derive 5 is less than that of Windows.  So, if you have enough memory to run Windows, you have enough memory to run Derive 5.

Q.	Will Derive 5 work on computers running Windows 3.1?

A. 	No.  Derive 5 is a 32-bit application program that requires a 32-bit operating system like Windows 95, 98 or NT to run.  It will not run on a 16-bit operating systems like Windows 3.1.

Q.	Does Derive make use of all the memory in my computer?

A.	Yes.  Derive takes full advantage of the physical (RAM) memory installed on your computer.  However, that does not mean taking all available memory for itself.  In a Windows environment in which other programs, including Windows itself, are running, Derive should not and does not take all the memory.

Thus, when Derive starts up, it determines how much physical memory is available, and then makes a request to Windows to allocate some percentage of that memory for itself.  By default Derive requests 50% of the memory, but you can change that percentage using the Derive Startup Options dialog box.  The percentage chosen should be a compromise between allowing the maximum amount of memory for Derive to store mathematical expressions, and leaving sufficient memory for other programs to run.  Of course, in the event Windows needs more physical memory for other programs, it automatically swaps Derive out of physical memory into virtual memory on the hard disk.

Other Frequently Asked Questions and Answers


Network Installation Questions

Q.	Why don’t the Greek letters and mathematical symbols display correctly when Derive runs on network workstations other than the one from which Derive was installed?

A.	The Derive screen and printer fonts need to be installed on each network workstation.  Using the fonts program included with Windows, install the four Derive fonts: DfW5, DfW5 Large, DfW5 Printer (TrueType), and DfW5 Printer Bold (TrueType).  These fonts are defined in the files DfW5.FON, DfW5L.FON, DfW5.TTF, and DfW5Bold.TTF, respectively.  The Derive installation program puts a copy of these files into the \DfW5 directory where DfW.EXE resides.

Q.	How do I install Derive on a computer network?

A.	If you have a network license for Derive 5, you are authorized to install the software on a network server so it can be run by workstations on the network.  Use the following procedure to install and configure Derive on a network:

1.	Install Derive on the network server.  From any workstation, login as a network supervisor with all rights.  Install Derive in a directory named \DfW5 on the network server. Grant at least read and execute rights to the DfW5 directory to all workstations requiring access to Derive.  Grant execute rights only to the file \DfW5\DfW.exe to prevent illegal duplication of the Derive program.

2.	Install and register Derive fonts.  In order for Derive to properly display and print mathematical expressions, the DfW5, DfW5 Large, DfW5 Printer (TrueType), and DfW5 Printer Bold (TrueType) fonts must be registered for each workstation on the network.  The Derive setup program automatically installs and registers these fonts in the Windows Fonts directory of the workstations on which the setup program is run.  Thus, the Derive fonts will automatically be installed and registered on workstations running Windows off the network server that share a common Windows Fonts directory.

However, for those workstations running Windows off a local hard drive or not sharing a common Windows Fonts directory, you will need to manually install the four Derive fonts. From each workstation requiring access to Derive run the Fonts program in the Windows Control Panel and install the four Derive font files.  These font files can be found in the \DfW5 directory on the network server.  The Fonts program will automatically register the Derive fonts.

Alternatively, the fonts can be installed on each workstation by running the Derive setup program from each workstation and installing Derive to the same \DfW5 directory on the network server.

3.	Create Derive shortcut icons for each workstation.  The Derive setup program automatically creates a shortcut icon for launching Derive on the desktop of the workstation from which the setup program is run.  For other workstations, you can manually create a shortcut icon for launching Derive.

4.	Configure Derive for each workstation on the network.  The Derive working directory is the directory displayed by the File > Open command.  Since the example files distributed with Derive are stored in the \DfW5\Users directory, it is the default Derive working directory.

The DERIVE Initialization file stores the settings used to initialize Derive when it starts.  These settings include the path to the current working directory.  The initialization file, named DFW.INI, is normally stored in the \DfW5 directory.

If Derive is launched by clicking a shortcut icon on the Windows desktop, Derive searches for the initialization file in the "Start in" directory specified by the properties of the shortcut icon.  To examine and/or change the "Start in" directory, right click on the Derive desktop icon and select the "Properties" option.

Although Derive is loaded from the network server, it actually runs in the physical memory of each workstation.  In order to run Derive along with several Windows applications on workstations with a limited amount of physical memory, you may want to use Derive's Options > Startup command to reduce the amount of memory it uses.

There are two popular configurations for running Derive on a network.  One is to have all the workstations use a common read-only initialization file and a common working directory, so Derive starts in the same exact state for all users.  Use the following procedure to set up Derive for this configuration:

a)	Launch Derive from a workstation having read, write, and execute access to the \DfW5 directory on the network server.

b)	Use the File > Open command to open a DFW or MTH file in the directory on the network server that you want to be the Derive working directory (e.g. you can use the \DfW5\Users directory).  The path to this directory will automatically be saved as the working directory in the Derive initialization file.  At this time you can also make any other changes to Derive that you want saved in the initialization file (for example, you may want to use the Options > Startup command to change the percentage of workstation memory Derive uses when it runs).  Naturally, such changes must be done before the initialization file is made read-only in the next step.

c)	Make the Derive initialization file on the network server be read-only.

d)	On each workstation on the network right click on the Derive shortcut icon and select the "Properties" option.  Then in the "Start in" directory field, enter the full path name of the \DfW5 directory on the network server.  This will cause Derive to use the same read-only initialization file no matter which workstation it is launched from.

The other configuration is for each workstation to have its own copy of the Derive initialization file (with read and write access) and its own working directory.  Use the following procedure on each workstation on the network to set up Derive for this configuration:

a)	Create a working directory for Derive.  The working directory can be on the network server or on the respective workstation.

b)	Copy the files in \DfW5\Users directory on the network server to the newly created working directory.

c)	Right click on the Derive shortcut icon and select the "Properties" option.  Then in the "Start in" directory field, enter the full path name of the newly created working directory.  This will cause Derive to create and use an initialization file in this working directory.

d)	Launch Derive and use the File > Open command to open a file in the newly created directory to make it the initial working directory.  At this time you can also make any other changes to Derive that you want saved in the initialization file (for example, you may want to use the Options > Startup command to change the percentage of workstation memory Derive uses when it runs).

5.	Limit users.  If your network license for Derive is for fewer workstations than there are on the network, use network metering software to limit the maximum number of instances of Derive that can be run at any one time.

Other Frequently Asked Questions and Answers


Additional Resources

You can find more information about using the Derive computer algebra system to teach, learn, and do mathematics from the following sources:

The Derive Web Site

For the latest information about Derive visit the www.derive.com web site.  At this site you can

•	learn the major capabilities of Derive.

•	examine the first two chapters of the Derive manual.

•	download a trial version of Derive.

•	review the Derive technical support options.

•	check out features recently added to Derive.

•	update your copy of Derive to the latest version.

•	download user contributed utility files for Derive.

•	find a list of math textbooks based on Derive.

•	link to other web sites of interest to Derive users.

•	join or post to various Derive discussion groups.

The International Derive User Group

An independent, international user group was established in 1991 as a forum for the exchange of ideas within the growing community of Derive users.  Members receive a subscription to The Derive Newsletter published four times a year.  The newsletter includes articles written by Derive enthusiasts explaining how to make the best use of the system.  The editor always welcomes contributions.  For more information, write:

Derive User Group

Josef Böhm

A-3042 Würmla

D'Lust 1	Phone/Fax:  43-(0)2275-8207

Austria (Europe)	Email: nojo.boehm@pgv.at

The Derive Electronic Discussion List

Derive-news is an electronic mailing list established to promote the discussion of issues related to Derive.  To join the mailing list, send a one line e-mail message of the form

JOIN derive-news YourFirstName YourLastName

to the address jiscmail@jiscmail.ac.uk.  To contribute to the derive-news mailing list, send e-mail to the address derive-news@jiscmail.ac.uk.  For more information about derive-news, go to the web page: www.jiscmail.ac.uk/lists/derive-news.html. It contains amongst other things, access to stored archives messages.  This page also permits you to post to the list, change your personal membership settings and access files associated with the list.

The Publishers of Derive

Texas Instruments Incorporated	Soft Warehouse Europe
Educational and Productivity Solutions (E&PS)	Hauptstr. 99
7800 Banner Drive	A-4232 Hagenberg, Austria (Europe)
Dallas, Texas 75251 (USA)	phone:  +43-7236-3297
phone: 1-800-TI-CARES (1-800-842-2737)	fax:  +43-7236-3297-71
email: info@derive.com	email:  info@derive-europe.com
web: www.derive.com	web:  www.derive-europe.com
Other Help Contents


Acknowledgments

Countless individuals have contributed to Derive (first released in 1988) and its predecessor muMATH (first released in 1979).  The actual programming and documenting of the Windows version of Derive (first released in 1996) was done by the following individuals (in alphabetical order):

Principal contributors:

•	Bernhard Kutzler, Soft Warehouse Europe

•	Albert D. Rich, Soft Warehouse, Inc.

•	Theresa M. Shelby, Soft Warehouse, Inc./Texas Instruments Incorporated

•	David R. Stoutemyer, Soft Warehouse, Inc./Texas Instruments Incorporated

Additional contributors:

•	Ellen Champagne, CrunchWare

•	Ralph Freese, University of Hawaii

•	Geoff Hanson, CrunchWare

•	Patti Ihori, Soft Warehouse, Inc./Texas Instruments Incorporated

•	David Jeffrey, University of Western Ontario

•	Nelson Kanemoto, Referentia Systems, Inc.

•	Vlasta Kokol-Voljc, University of Maribor

•	David Parker, Kearns, Utah

•	Joan Rich, Soft Warehouse, Inc./Texas Instruments Incorporated

•	Karen Stoutemyer, Soft Warehouse, Inc./Texas Instruments Incorporated

•	Johann Wiesenbauer, Technical University of Vienna

Other Help Contents


Technical Support

If you have a question concerning Derive not answered by the printed manual or this on-line help, we recommend you start with the sources of information listed in Additional Resources.  For additional help, you can contact the following

For customers in Europe, the Middle East, Africa, and South America:

For questions of a general nature about Derive, visit the Soft Warehouse Europe web site at

www.derive-europe.com

For questions of a technical nature about Derive, contact Derive Tech Support at

Phone: +43-7236-3297-67 (Austria)

Email: support@derive-europe.com

Fax: +43-7236-3297-71 (Austria)

For customers in the United States, Canada, and other locations not listed above:

For questions of a general nature about Derive, call Texas Instruments Customer Support at 1-800-TI-CARES (1-800-842-2737).

For questions of a technical nature about Derive, contact the Texas Instruments Programming Assistance Group at

Phone: 1-972-917-8324

Email: info@derive.com

Customer phone support is available Monday through Thursday from 8:00am to 4:30pm Central standard time, and Friday from 9:30am to 4:30pm Central standard time.

For more information about other Texas Instruments educational products and services, contact Texas Instruments at

Email: ti-cares@ti.com

Web site: http://education.ti.com

Other Help Contents


Derive 5 Revision Summary

The following topics summarize improvements and bug fixes made to Derive 5 since version 5.00 was released on 15 March 2000:

Version 5.01 Revision Summary (16 June 2000)

Version 5.02 Revision Summary (30 June 2000)

Version 5.03 Revision Summary (15 January 2001)

Version 5.04 Revision Summary (11 April 2001)

Version 5.05 Revision Summary (December 2001)

Other Help Contents


Derive 5.01 Revision Summary
Version 5.01 Revision Summary

The following summarizes improvements and bug fixes made in version 5.01 of Derive 5 released on 16 June 2000:

•	Improvements have been made to the interface for editing Derive expression objects.  A status bar message now indicates editing mode and many commands have been disabled until editing is complete.

•	The default working directory for opening or saving files is now \Users instead of the Windows desktop.

•	Installing version 5.01 of Derive automatically includes it in the list of programs displayed by the Add/Remove Programs command of the Window’s Control Panel.

•	A bug that prevented substituting new values for the variables in a matrix has been fixed.

•	The names of string variables displayed in dialog boxes are now enclosed in double quotes so that they can be recognized as such by the user and the system.

•	When Greek characters are entered by clicking on the Greek symbol toolbar or by typing in their equivalent Latin name (e.g. when typing "gamma" for γ or "GAMMA" for Γ), the case of the Greek characters is always respected, even when the case of Latin characters is being ignored (i.e. when in case insensitive input mode).

•	The text color set by the Options > Display > Font of New Text Objects command is now properly saved in the Derive initialization file.

•	Inserting a character from the Greek or math symbol toolbars into an existing text box no longer changes the font of existing text under any circumstance.

•	Changes the user makes to the orientation and position of the Greek and math symbol toolbars are now saved correctly in the Derive initialization file.

•	Context-sensitive help has been enabled for additional dialog boxes.

•	The expression entry line now gives a syntax error message if the user enters #n where n is missing or an invalid expression number.

•	Expressions that span more than one full printed page are now printed and previewed correctly.

•	The hot-keys for Zoom In, One Page and Close in Print Preview mode now work correctly.

•	Pressing PgUp (page up) or PgDn (page down) scrolls the display up or down as before, but now selects the object (instead of the expression) at the top or bottom of the current screen, respectively.

•	If the scroll bar is at either end of the scroll region when the algebra window is resized, it will remain at that position.

•	The highlighted expression is now redrawn correctly when uncovered by a dialog box.

•	A bug that caused erroneous plots of trigonometric functions when Derive was in Degree angle mode has been fixed.

•	Off-scale 2D parametric plots no longer hang Derive when running it on Windows NT.

•	After the 2D parametric parameters dialog, the command toolbar buttons no longer require 2 mouse-clicks to activate.

•	Attempts to enter an invalid value (e.g. a box length of 0) in the 3D-plot window now results in an error message.

•	Scales that result in more than 100 tick marks on one side of the box are no longer allowed in the 3D-plot window.

•	Modifications have been made to the 3D-plot window display to keep all plot lines in the designated plot region.

•	The algorithm for denesting and simplifying algebraic numbers has been improved to produce simpler, more compact results.

•	New rules have been added for algebraically simplifying expression involving the Hurwitz zeta and digamma functions.  These functions often arise when finding definite sums or integrals.  Also, given real or complex numeric arguments, version 5.01 can efficiently approximate zeta and digamma functions to high precision using an Euler-Maclaurin series expansion.

•	Minor bugs have been fixed in the functions ITERATE, SUBST, EVERY, SOME, FACTOR, EXPAND and PRIME? which occurred when they were given certain unusual arguments.

Other Revision Summaries


Derive 5.02 Revision Summary
Version 5.02 Revision Summary

The following summarizes improvements and bug fixes made in version 5.02 of Derive 5 released on 30 June 2000:

•	Algebra worksheet file names in the Window menu are now updated immediately after a file name has changed.

•	If the cursor is in the expression entry line and Alt-Tab is used to switch to another application and then back to Derive, the cursor will return to the expression entry line.

•	If rows or columns are increased when editing a matrix or vector the new cells will be initialized to 0s in the entry dialog.

•	If the user encounters a parsing error when opening a dfw file and then elects to continue reading the file, the mathematical expression will be entered into the worksheet as a string.  After the file has been opened, the user may then edit the string to correct the error and enter it as a mathematical expression.

•	The Up and Down arrow keys may now be used to select a variable in the Simplify > Variable Substitution command dialog box.

•	Improvements have been made so that the FLOOR function can accurately determine the floor of virtually all algebraic and transcendental numbers in exact mode.  For example, version 5.02 simplifies FLOOR(EXP(pi*SQRT(163))) to 262537412640768743 instead of 262537412640768744.

•	Rules have been added for finding antiderivatives of expressions of the form sin(u)^p/cos(u)^p, where p is a rational number.  For example, version 5.02 can integrate SQRT(SIN(t))/SQRT(COS(t)).

•	After finding tentative solutions of an equation, Derive uses back substitution to verify the solutions.  This verification algorithm has been improved to better recognize valid solutions.  For example, version 5.02 can solve the equation x+(x+1)^(1/3) = 2 for x.

•	A bug that caused the ROUND function to return 1 instead of 0 for numbers very close to 0 was fixed.  For example, version 5.02 simplifies ROUND(1/10000000000) to 0 instead of 1.

•	When solving systems of nonlinear polynomial equations, several problems have been resolved that caused hangs or prevented finding all the solutions to the equations.  For example, version 5.02 can find both solutions to the system of equations 1 - z·x = 0, y = 0, and x^2 + y - 4 = 0 in terms of x, y, and z.

•	Derive’s ability to find the limits of expressions involving the logarithm function has been improved.  For example, version 5.02 can determine that the limit of LN(-2·COT(x/2)-1)+LN(-COS(x)-SIN(x)+1) as x approaches 0 from the right is 2·LN(2)+2·pi·î.

Other Revision Summarys


Derive 5.03 Revision Summary
Version 5.03 Revision Summary

The following summarizes improvements and bug fixes made in version 5.03 of Derive 5 released on 15 January 2001:

•	Derive 5 is now fully compatible with Windows 2000.  The problems displaying and printing Derive text objects when operating under Windows 2000 have been resolved.

•	The intersection of 3D plots is now displayed with greater accuracy without significant speed degradation.

•	The minimum percentage of memory allocated by Derive and allowed by the Options > Startup command is now computed and is based on the current physical memory of the host machine.  This makes it possible to allocate less than 20% of physical memory to Derive on computers in a multi-tasking environment with a large amount of memory.

•	Matrices are now printed correctly, even if both the length and width of the matrix spans more than one printed page.

•	The plot color of point list plots and parametric plots in 2D-plot objects is now saved in DfW files.

•	After the user pressed the Esc key to abort a long computation, on very rare occasions Derive would be abnormally terminated by a system zero-divide error.  This problem has been resolved.

•	A difficulty loading utility files with very long file names from a drive other than the current one has been resolved.

•	Choosing the top left white color in the color palette as the background color in the 3D plot-window no longer results in a background color of yellow on some machines.

•	A problem that prevented making 3D plots of some equations involving two variables has been resolved.  For example, z=x and z-x=0 both plot as a plane in the 3D-plot window.

•	When formatting text in a text box, version 5.03 no longer scrolls the worksheet to make the top of the text box visible after formatting the desired selection.

•	The ability to solve equations involving the elementary math functions has been enhanced by the addition of several new rules.

•	Version 5.03 is able to efficiently and accurately approximate huge magnitude numbers, and then display them in scientific notation.  For example, try 7^1000000 approximates to 1.096514191·10^845098, and 1000000! approximates to 8.263934043·10^5565708.

•	The accuracy of the real and imaginary parts when approximating the error and complementary error functions has been improved.  For example, at 10 digits of precision, version 5.03 correctly approximates ERFC(10*î) to 1 - 1.524307422·10^42·î.

•	Several new definite and indefinite integration rules have been added.  For example, version 5.03 can integrate LN(SIN(x)) from x=0 to π/2.

•	The ` transpose operator now distributes over matrices whose elements happen to be equations and inequalities.  For example, version 5.03 simplifies [x=1, x=2; x=3, x=4]` to [x=1, x=3; x=2, x=4].

•	User functions defined using the APPROX, EXPAND, and FACTOR functions now work as expected.  For example, if FOO(x) is defined as APPROX(x), version 5.03 simplifies FOO(π) to the rational approximation 1146408/364913 instead of the symbol π.

•	A problem that prevented solving equations involving absolute values for real values of the solution variables has been resolved.  For example, version 5.03 can find both real solutions to the equation |x| = 5.

Other Revision Summaries


Derive 5.04 Revision Summary
Version 5.04 Revision Summary

The following summarizes improvements and bug fixes made in version 5.04 of Derive 5 released on 11 April 2001:

•	The new File > Write > Rich Text Format File command makes it easy to convert Derive 5 worksheets into a format that can be loaded into word processing programs.  Then, these programs can be used to convert them into a format suitable for use on the Internet.  See the File > Write commands for details.

•	The built-in string conversion function has been extended to handle function compositions, as well as numbers and variables.  This allows Derive 5 programs to analyze the structure of expressions.  See the String Processing Functions for details.

•	Numerous internal improvements have been made in the simplification of expressions involving the trigonometric and hyperbolic functions, and their inverses, on the real line and in the complex plane.

•	Declared variables that have not been assigned a value are no longer included in the Variable Name list displayed by the Declare > Variable Value command dialog box, thus reducing clutter and making it easier to verify other variable values.

•	Multiple occurrences of the \ set difference operator now associate to the left, so that A \ B \ C is equivalent to (A \ B) \ C instead of A \ (B \ C).

•	When a function definition is displayed in a worksheet, strings in the definition are now enclosed in double quotes so they can be easily identified as strings.

•	A problem adding two identical vectors having one or more 0 elements has been resolved.

•	Sets of coordinate point pairs (for example, {[2,3], [1,4], [0,2]} ) can now be included in a vector of expressions to be plotted in the 2D-plot window.

•	Expressions involving the CEILING function can now be plotted without having to first simplify the expressions.

•	When plotting a parameterized expression in the 3D-plot window, the s and t parameter values specified in the Insert > Plot dialog box are now properly correlated with the variables s and t occurring in the expression.

•	If the Calculus > Taylor Series command or the TAYLOR function is given an equation or vector, the Taylor series of the elements of the equation or vector are returned.

•	When uninstalling Derive 5 through the program group shortcut or the Windows Control Panel, the uninstall program now finds the installation log even if the Derive 5 installation directory has spaces in its path name.

Other Revision Summaries


Derive 5.05 Revision Summary
Version 5.05 Revision Summary

The following summarizes improvements and bug fixes made in version 5.05 of Derive 5 released in December 2001:

Algebra window items:

•	The aspect ratio of an embedded plot object is now maintained when resizing the object with any of the corner sizing handles.

•	When editing an expression object, a hatched pattern surrounds the object until the edit operation is either completed or cancelled.

•	The File > Load > Data file command now accepts the CSV (comma or semi-colon delimited) file format used by Microsoft Excel® and other spreadsheet programs.

•	The Options > Display > Background Color command allows only solid system background colors to be selected.

•	When printing an algebra window worksheet, page breaks no longer occur when Derive encounters an empty text object.

•	The state of the Display Tabs setting is now saved for the next Derive session in the dfw.ini file.

•	Messages on the status bar are now displayed using the “ToolTip” font specified using the Appearance tab of the Display Properties dialog box of the Windows Control Panel.  Expression annotations are still displayed on the status bar using the DfW5 Screen font.

•	After using the Insert expression or Paste command in the expression entry line, if the resulting expression can be totally contained within the line, the expression will scroll to the left so that all the text is visible.

Plot window items:

•	The 2D-plot window now has a Display properties tab dialog box similar to that of the 3D-plot window.  To activate it, issue the Options > Display command or right-click in the plot window and choose Display from the popup menu.

•	The 2D-plot window dialog boxes now use only solid system colors.  When the Options > Change Plot Colors menu option is checked, visibly unique colors are used for plot lines.

•	Scales greater than 400·π are now allowed in the 2D-plot window.

•	Plots of a disjunction (i.e. the logical OR) of inequalities are now plotted in a single color, rather than a different color for each inequality.

•	If a and b are numbers, 2D-plots of the form a·x = b are plotted as vertical rather than horizontal lines.

•	When making 2D polar plots of univariate expressions, the variable is always interpreted as the angle from the positive x-axis; unless the variable is r, in which case r is interpreted as the radius from the origin.

•	Printing or previewing the 2D-plot window using a screen resolution greater than 1024×768 no longer results in the “Cannot draw 2D-plot window” message.

•	When a new 2D-plot window is opened by editing an embedded plot object in a non-maximized algebra window, the new plot window will have the same aspect ratio as the embedded plot object.  Note that embedded plot objects are edited by issuing the Edit > Derive Object command or by double clicking on the plot object.

•	The top and bottom of 3D-plots can again be displayed using different colors (this resolves an error introduced in version 5.03 of Derive).

Mathematical items:

•	Several integration and summation rules have been added, including one for definite integrals of expressions of the form 1/(a·x^n+b) for x=0 to infinity, where n is a positive integer and the product a·b is positive.  For example, version 5.05 returns a very compact result when integrating 1/(x^7+1) from x=0 to infinity.

•	The equation solver has been extended to solve some simple equations involving the functions FLOOR and MOD (e.g. try solving FLOOR(x^2)=3 and MOD(2·x + 3, 5) = 4 for x).  Also expressions involving FLOOR are converted to equivalent ones involving MOD, if the latter is more compact.

•	The equality of two vectors or two matrices now simplifies to a conjunction of equalities of their elements (e.g. [a,b]=[c,d] simplifies to a=c ∧ b=d instead of [a=c, b=d] ).

•	In user-defined functions, assignments made to non-local variables (i.e. variables not in the functions formal argument list) are retained upon exit from the function.  This allows Derive programs to permanently set the value of control variables, etc.

•	If u and v are vectors, the inverse of u·v no longer simplifies to u inverse times v inverse, since that transformation is not valid for vectors (e.g. 1/([a,b]·[c.d]) simplifies to 1/(a·c+b·d) ).

•	The algorithm used to determine if algebraic and transcendental numbers are identically zero has been strengthened and made more efficient.

•	Insure that the recognizer functions (e.g. INTEGER?, ODD?, PRIME?, etc.) ignore infinitesimal imaginary parts that can result from previous computations.

•	Given a rational number, the functions STRING and NAME_TO_CODES use the current notation style (rational or decimal) and number of digits when converting the number to a string.

•	Modify the special functions QUOTIENT, REMAINDER, SOLVE, NSOLVE, SOLUTIONS, and NSOLUTIONS so that they operate correctly when called from within user-defined functions.

•	The function SUBST now makes serial substitutions for subexpressions, as well as for variables (e.g. SUBST(x·y, y, x, x^2, z) now simplifies to z).

•	Given a fixed payment amount of 0, the function RATE now returns the correct interest rate, instead of 1 plus the interest rate.

•	When using the Declare > Function Definition command to retrieve a function definition for editing, prevent the order of factors in products from occasionally being permuted.

•	The function APPEND_COLUMNS defined in Vector.mth has been generalized to append any number of matrices, or a vector of matrices.

•	Several new utility file packages are included in the Users directory including ones for tensor algebra and analysis, simplex mini/max method, logistic regression, nonlinear regression, and drawing arrows in the 2D and 3D-plot windows.

Other Revision Summaries


Derive Constants

The following are the mathematical constants in Derive.  The first column shows how the constants are displayed on the screen.  The second column shows how the constants can be typed in on the expression entry line.  The first 5 constants listed can also be entered by pressing the indicated control key ("hotkey") combination.  Alternatively, some of the constants can be entered by selecting them off the math symbol toolbar.

π	pi	area of unit circle (3.14159...)	Ctrl+P

ê	#e	base of natural logarithms (2.71828...)	Ctrl+E

î	#i	imaginary unit (square root of -1)	Ctrl+I

°	deg	radians per degree (π/180)	Ctrl+O

∞	inf	plus infinity	Ctrl+0

euler_gamma	euler_gamma	Euler's constant (0.577215...)

true	true	logical constant ‘true’

false	false	logical constant ‘false’

unit_circle	unit_circle	arbitrary point on unit circle

axes	axes	3D coordinate axes (GRAPHICS.MTH)

cylindrical	cylindrical	cylindrical geometry matrix r, θ, z (VECTOR.MTH)

spherical	spherical	spherical geometry matrix r, θ, Φ (VECTOR.MTH)

i_	i_	[1, 0, 0]: unit vector for x-axis (VECTOR.MTH)

j_	j_	[0, 1, 0]: unit vector for y-axis (VECTOR.MTH)

k_	k	[0, 0, 1]: unit vector for z-axis (VECTOR.MTH)

Other Help Contents


Derive Operators

The following are the mathematical operators in Derive.  The first column shows how the operators are displayed on the screen.  The second column shows how the operators can be typed in on the expression entry line.  Alternatively, the operators can be entered by selecting them off the math symbol toolbar.

Mathematical Operators

u + v	u + v	u plus v

-u	-u	minus u

u - v	u - v	u minus v

u · v	u * v	u times v

u / v	u / v	u divided by v

u ^ v	u ^ v	u raised to v

u%	u%	u percent

u!	u!	u factorial

±u	"+-"u	plus or minus u

'x	'x	quote x

Relational Operators

u = v	u = v	u equals v

u ≠ v	u /= v	u not equal v

u < v	u < v	u less than v

u ≤ v	u <= v	u less than or equal to v

u > v	u > v	u greater than v

u ≥ v	u >= v	u greater than or equal to v

Boolean Operators

(If operands are integers, bit-wise logical operations are performed on them.)

¬ p	NOT p	negation of p

p ∧ q	p AND q	conjunction of p and q

p ∨ q	p OR q	disjunction of p and q

p XOR q	p XOR q	exclusive or of p and q

p → q	p IMP q	logical implication of p and q

p IFF q	p IFF q	logical equivalence of p and q

Set Operators

u`	u`	complement of set u

u ∩ v	u INTERSECTION v	intersection of sets u and v

u ∪ v	u UNION v	union of sets u and v

u \ v	u \ v	set difference of sets u and v

u ⊆ v	u SUBSET v	true if u is a subset of v; otherwise false

Vector Operators

u · v	u . v	dot product of vectors u and v

v ↓ n	v SUB n	nth element of vector v

v ↓ [n1,...,nm]	v SUB [n1,...,nm]	vector of elements n1 through nm of vector v

Matrix Operators

A`	A`	transpose of matrix A

A · B	A . B	dot product of matrices A and B

A ROW n	A ROW n	nth row of matrix A

A COL n	A COL n	nth column of matrix A

A ↓ n	A SUB n	nth row of matrix A

A ↓↓ n	A SUB SUB n	nth column of matrix A

A ↓ n ↓ m	A SUB n SUB m	element in nth row and mth column of matrix A

A ↓ [n1,...,nm]	A SUB [n1,...,nm]	matrix of rows n1 through nm of matrix A

A ↓↓ [n1,...,nm]	A SUB SUB [n1,...,nm]	matrix of columns n1 through nm of matrix A

Assignment Operators

x :=	declare x an arbitrary variable

x := u	declare x a variable and assign it the value u

F(x, y, ...) :=	declare F an arbitrary function with formal variables x, y, ...

F(x, y, ...) := u	declare F a function with formal variables x, y, ... defined as u(x, y, ...)

F v := u	declare F a function of  any number of variables defined as u(x, y, ...)

x :∈ domain	declare x an arbitrary variable in the given domain

x :∈ domain interval	declare x an arbitrary variable in the given domain and interval

x :+ u	assign variable x the value x+u

x :- u	assign variable x the value x-u

x :* u	assign variable x the value x·u

x :/ u	assign variable x the value x/u

Other Help Contents


Derive Functions

The following is an alphabetical list of the mathematical functions built-into Derive (see Built-in Functions and Constants) or defined in the utility files distributed with Derive (see the Utility File Functions).  Those functions defined in utility files are automatically load on demand.

ABS(x)	absolute value of real x

ABS(z)	magnitude (modulus) of complex z

ABS(v)	magnitude (length) of vector v

ACOS(z)	angle whose cosine is z

ACOSH(z)	inverse hyperbolic cosine of z

ACOT(x,y)	angle of the point (x,y)

ACOT(z)	angle whose cotangent is z

ACOTH(z)	inverse hyperbolic cotangent of z

ACSC(z)	angle whose cosecant is z

ACSCH(z)	inverse hyperbolic cosecant of z

ADJOIN(u,v)	adjoin u to the front of vector v

ADJOINT(A)	adjoint of square matrix A

AI_SERIES(z,m)	m+1 terms of series approximation for Airy function Ai(z)

ALMOST_LIN(r,b,p,q,x,y,x0,y0)	implicit solution of r(x,y)y'+p(x)b(y)=q(x) if almost linear

ALMOST_LIN_GEN(r,b,p,q,x,y,c)	general solution of r(x,y)y'+p(x)b(y)=q(x) if almost linear

APPEND(v,w)	vector of elements of v followed by elements of w

APPEND_COLUMNS(A,B)	append columns of A and B

APPROX(u)	approximate u using the current digits of precision

APPROX(u,n)	approximate u using n digits of precision

APPROX_EIGENVECTOR(A,μ)	approximate eigenvector of A for approximate eigenvalue μ

ARC_LENGTH(y,x,x1,x2)	arc length of y(x) from x=x1 to x2

ARC_LENGTH(y,x,x1,x2,μ)	integral of μ(x) along arc y(x) from x=x1 to x2

ARCS(w,z,r0,rm,m,θ0,θn,n)	w-plane map of polar z-plane grid r=r0...rm, θ=θ0...θn

AREA(x,x1,x2,y,y1,y2)	area of region x=x1 to x2 and y=y1(x) to y2(x)

AREA(x,x1,x2,y,y1,y2,μ)	integral of μ(x,y) over region

AREA_CENTROID(x,x1,x2,y,y1,y2)	area centroid of region

AREA_CENTROID(x,x1,x2,y,y1,y2,μ)	centroid of density μ(x,y) over region

AREA_INERTIA(x,x1,x2,y,y1,y2)	area inertia tensor of region

AREA_INERTIA(x,x1,x2,y,y1,y2,μ)	inertia tensor of density μ(x,y)

AREA_OF_REVOLUTION(y,x,x1,x2)	area of y(x) revolved about x-axis

AreaBetweenCurves(u,v,x,a,b)	plots area between u(x) and v(x) from x = a to b (a < b)

AreaOverCurves(u,x,a,b)	plots area over u(x) and under the x-axis from x = a to b (a < b)

AreaUnderCurves(u,x,a,b)	plots area under u(x) and above the x-axis from x = a to b (a < b)

AREAY_OF_REVOLUTION(y,x,x1,x2)	area of y(x) revolved about y-axis

ASEC(z)	angle whose secant is z

ASECH(z)	inverse hyperbolic secant of z

ASIN(z)	angle whose sine is z

ASINH(z)	inverse hyperbolic sine of z

ASSIGN(v,u)	if the value of v is a variable, assigns that variable the value u

ASSOCIATED_LEGENDRE_P(n,m,x)	nth associated Legendre polynomial Pn(m)(x)

ATAN(y,x)	angle of the point (x,y)

ATAN(z)	angle whose tangent is z

ATANH(z)	inverse hyperbolic tangent of z

AUTONOMOUS(r,v)	dv/dy, given y"=r(y,v), reducing to sequence of two 1st order

AUTONOMOUS_CONSERVATIVE(q,x,y,x0,y0,v0)	solves y"=q(y), y=y0 and y'=v0 at x=x0

AVERAGE(z1,...,zn)	arithmetic mean (average) of z1, ..., zn

BELL(n)	nth Bell or exponential number

BERNOULLI(n)	nth Bernoulli number

BERNOULLI_ODE(p,q,k,x,y,x0,y0)	implicit solution of Bernoulli equation y'+p(x)y=q(x)y^k

BERNOULLI_ODE_GEN(p,q,k,x,y,c)	general solution of Bernoulli equation y'+p(x)y=q(x)y^k

BERNOULLI_POLY(n,x)	nth Bernoulli polynomial evaluated at x

BESSEL_I(n,z)	modified Bessel function of 1st kind In(z)

BESSEL_I_ASYMP(n,z)	2-term asymptotic approximation for In(z)

BESSEL_I_SERIES(n,z,m)	m+1 terms of series approximation for In(z)

BESSEL_J(n,z)	Bessel function of 1st kind Jn(z)

BESSEL_J_ASYMP(n,z)	1-term asymptotic approximation for Jn(z)

BESSEL_J_LIST(n,z)	vector of Bessel functions of 1st kind J0(z) through Jn(z)

BESSEL_J_SERIES(n,z,m)	m+1 terms of series approximation for Jn(z)

BESSEL_K(n,z)	modified Bessel function of 2nd kind Kn(z)

BESSEL_K_ASYMP(n,z)	2-term asymptotic approximation for Kn(z)

BESSEL_Y(n,z)	Bessel function of 2nd kind Yn(z), n fractional

BESSEL_Y_ASYMP(n,z)	1-term asymptotic approximation for Yn(z)

BESSEL_Y_SERIES(n,z,m)	m+1 terms of series approximation for Yn(z), n integer

BI_SERIES(z,m)	m+1 terms of series approximation for Airy function Bi(z)

BINOMIAL_DENSITY(k,n,p)	binomial probability density function

BINOMIAL_DISTRIBUTION(k,n,p)	cumulative probability binomial distribution function

CATALAN(n)	nth Catalan number

CEILING(m)	smallest integer ≥ m

CEILING(m,n)	smallest integer ≥ m/n

CENTER_OF_CURVATURE(y,x)	center of curvature of y(x)

CENTERED(n,p)	nth p-sided centered number

CENTERED_CUBE(n,d)	nth d-dimensional centered cube number

CENTERED_HEX(n,d)	nth d-dimensional centered hex number

CENTERED_PYRAMID(n,p)	nth p-sided d-dimensional centered pyramid number

CHARPOLY(A,v)	characteristic polynomial of square matirx A in terms of variable v

CHEBYCHEV_T(n,x)	nth Chebychev polynomial of 1st kind Tn(x)

CHEBYCHEV_T_LIST(n,x)	vector of first n Chebychev polynomials of 1st kind

CHEBYCHEV_U(n,x)	nth Chebychev polynomial of 2nd kind Un(x)

CHEBYCHEV_U_LIST(n,x)	vector of first n Chebychev polynomials of 2st kind

CHI(a,x,b)	if a<x<b, returns 1; if x<a or x>b, returns 0

CHI(a,x,b,c)	if x=a, returns c; if x=b, returns 1-c; else returns CHI(a,x,b)

CHI(a,x,b,c,d)	if x=a, returns c; if x=b, returns d; else returns CHI(a,x,b)

CHI_SQUARE(u,v)	Chi-square distribution P(u|v), u = χ²

CI(z)	cosine integral Ci(z), -π < phase z < π

CLAIRAUT(p,q,x,y,v,c)	vector of general and implicit solutions of generalized Clairaut differential equation

CLAIRAUT_DIF(p,q,d,x,y,c)	implicit solution of Clairaut difference equation

CODES_TO_NAME(v)	string or integer corresponding to ASCII codes in vector v

COFACTOR(A,i,j)	numerator of element i,j of inverse of square matrix A

COMB(z,w)	combinations of z things taken w at a time

CONE(φ,θ,z)	3D coordinate vector of cone at an angle of φ radians from z-axis

CONJ(z)	complex conjugate of z

CONTINUED_FRACTION(x,n)	vector of n+1 partial quotients of continued fraction of x

CONVERGENT(x,k)	kth convergent of x based on continued fraction of x

CONVERGENTS(x,k)	vector of first k+1 convergents of x based on continued fraction of x

COPROJECTION(A)	convert matrix A from lines of constant t to constant s

COS(z)	cosine of z radians

COSH(z)	hyperbolic cosine of z

COT(z)	cotangent of z radians

COTH(z)	hyperbolic cotangent of z

COVARIANT_METRIC_TENSOR(A)	covariant metric tensor of Jacobian matrix A

CROSS(v,w)	cross product of vectors v and w

CRT(a,m)	solution of system of linear congruence equations x = ai mod mi

CSC(z)	cosecant of z radians

CSCH(z)	hyperbolic cosecant of z

CURL(v)	curl of 2 or 3 element vector v wrt variables x, y, and z

CURL(v,w)	curl of 2 or 3 element vector v wrt variables in vector w

CURL(v,A)	curl of 2 or 3 element vector v using coordinate geometry matrix A

CURVATURE(y,x)	curvature of y(x)

CYCLOTOMIC(n,x)	simplifies to the nth cyclotomic polynomial in x

CYLINDER(r,θ,z)	3D coordinate vector of cylinder of radius r from z-axis

CYLINDRICAL_VOLUME(r, r1,r2,θ,θ1,θ2,z,z1,z2)	volume of region in cylindrical coordinates

CYLINDRICAL_VOLUME(r,r1,r2,θ,θ1,θ2,z,z1,z2,μ)	integral of μ(r,θ,z) over region in cylindrical coordinates

DAWSON(x)	Dawson’s integral F(x)

DEF_INT_PARTS(u,v,x,a,b)	integral of u(x)·v(x) from x=a to b using integration by parts

DEF_INT_SUBST(y,x,u,a,b)	integral of y(x) from x=a to b using substitution

DELETE(v,n)	delete element n from vector v

DENOMINATOR(u)	syntactic denominator of u

DET(A)	determinant of matrix A

DIF(u,x)	derivative of u(x) wrt x

DIF(u,x,n)	nth order derivative of u(x) wrt x

DIF(u,x,-n)	nth-order antiderivative of u(x) wrt x

DIF_DATA(A)	1st derivative of 2-column numeric data matrix A

DIF_NUMERIC(y,x,x0,h,n)	nth derivative of y wrt x at x0 using step size h

DIF2_DATA(A)	2nd derivative of 2-column numeric data matrix A

DIGAMMA(x)	digamma function ψ(x)

DIGAMMA_PSI(z)	approximation for digamma function ψ(z)

DILOG(x)	dilogarithm function of x

DIM(v)	number of elements of vector v

DIRECTION_FIELD(r,x,x0,xm,m,y,y0,yn,n)	vector that plots as direction field for y'=r(x,y)

DISTINCT_PARTS(n)	number of decompositions of n into integer summands

DIV(v)	divergence of vector v wrt variables x, y, and z

DIV(v,w)	divergence of vector v wrt variables in vector w

DIV(v,A)	divergence of vector v using coordinate geometry matrix A

DIVISOR_SIGMA(k,n)	sum of kth powers of positive divisors of n

DIVISOR_TAU(n)	number of divisors of n

DIVISORS(n)	ordered vector of all positive divisors of n

DSOLVE1(p,q,x,y,x0,y0)	specific solution of p(x,y)+q(x,y)y'=0 with initial conditions y=y0 at x=x0

DSOLVE1_GEN(p,q,x,y,c)	general solution of p(x,y)+q(x,y)y'=0 in terms of c

DSOLVE2(p,q,r,x,c1,c2)	general solution of y"+p(x)y'+q(x)y=r(x) in terms of c1 and c2

DSOLVE2_BV(p,q,r,x,x0,y0,x2,y2)	specific solution of y"+p(x)y'+q(x)y=r(x) with boundary conditions

DSOLVE2_IV(p,q,r,x,x0,y0,v0)	specific solution of y"+p(x)y'+q(x)y=r(x) with initial conditions

EI(x,m)	m terms of series approximation for exponential integral Ei(x)

EI1(z,m)	m terms of series approximation for E1(z), -π < phase z < π

EIF(Φ,m,n)	n iteration approximation of elliptic integral of 1st kind F(Φ|m)

EIGENVALUES(A,v)	eigenvalues of square matrix A in terms of variable v

ELEMENT(v,n)	nth element of vector v

ELEMENT(A,j,k)	element in jth row and kth column of matrix A

ELLIPTIC_E(Φ,m)	approximation of elliptic integral of 2nd kind E(Φ|m)

ELLIPTIC_F(Φ,m)	approximation of elliptic integral of 1st kind F(Φ|m)

ELLIPTIC_PI(Φ,m,n)	approximation of elliptic integral of 3rd kind II(n;Φ|m)

EN(n,z)	nth exponential integral En(z), real part of z > 0

EN_ASYMP(n,z,m)	m+1 terms of asymptotic approximation for En(z)

ERF(z)	error function of z

ERF(z,w)	generalized error function of z and w

ERFC(z)	complementary error function of z

EULER(n)	nth Euler number

EULER_ODE(r,x,y,x0,y0,h,n)	vector of n+1 solution points of y'=r(x,y) using Euler's method

EULER_BETA(z,w)	Euler's beta function B(z,w)

EULER_PHI(n)	Euler's totient function φ(n)

EULER_POLY(n,x)	nth Euler polynomial evaluated at x

EVEN?(k)	if k is an even number, return true; otherwise return false

EVERY(u,x,c)	if u(x) is true for every x in c, return true; otherwise return false

EVERY(u,k,m,n,s)	if u(k) is true for every k=m to n in steps of s, return true; otherwise return false

EXACT(p,q,x,y,x0,y0)	implicit specific solution of p(x,y)+q(x,y)y'=0, if it is exact

EXACT_EIGENVECTOR(A,μ)	eigenvector of matrix A corresponding to exact eigenvalue μ

EXACT_GEN(p,q,x,y,c)	implicit general solution of p(x,y)+q(x,y)y'=0, if it is exact

EXACT2(p,q,x,y,v,c)	reduces order of p(x,y,v)y"+q(x,y,v)=0 with v=y', if it is exact

EXP(z)	exponential of z (that is e^z)

EXPAND(u,amount,x,y,...)	expand u by amount wrt variables x,y,...

EXTENDED_GCD(a,b)	vector [g, [x, y]] of integers such that g = gcd(a, b) = x·a+y·b

EXTRACT_2_COLUMNS(A,j,k)	matrix composed of jth and kth columns of matrix A

F_DISTRIBUTION(F,v1,v2)	cumulative probability F-distribution P(F|v1,v2)

FACTOR(u,amount,x,y,...)	factor u by amount wrt variables x,y,...

FACTORS(n)	vector of pairs of primes and their powers of factorization of integer n

FACTORS(u)	vector of pairs of syntactic factors and their powers of expression u

FAREY(n)	vector of Farey fractions of order n

FIBONACCI(n)	nth Fibonacci number

FIRST(v)	first element of vector v

FIT(v,A)	least squares fit of label vector v to data matrix A

FIXED_POINT(g,x,x0,n)	n iterations of vector x=g(x), starting at x=x0

FLOOR(m)	integer part of m

FLOOR(m,n)	greatest integer ≤ m/n

FORCE0(A,i,j,p)	force element i,j of A to 0 using pivot row p

FOURIER(y,t,t1,t2,n)	nth harmonic Fourier series of y(t) from t=t1 to t2

FRESNEL_COS(z)	approximates to Fresnel cosine integral C(z)

FRESNEL_COS_ASYMP(z)	5-term asymptotic approximation for cosine integral C(z)

FRESNEL_COS_J(z,m)	approximation of C(z) based on sum of m+1 spherical Bessel functions

FRESNEL_COS_SERIES(z,m)	m+1 terms of series approximation for cosine integral C(z)

FRESNEL_SIN(z)	approximates to Fresnel sine integral S(z)

FRESNEL_SIN_ASYMP(z)	5-term asymptotic approximation for sine integral S(z)

FRESNEL_SIN_J(z,m)	approximation of S(z) based on sum of m+1 spherical Bessel functions

FRESNEL_SIN_SERIES(z,m)	m+1 terms of series approximation for sine integral S(z)

FUN_LIN_CCF(r,p,q,k,x,y,x0,y0)	implicit solution of y'=r(p·x+q·y+k), if p,q,k constant

FUN_LIN_CCF_GEN(r,p,q,k,x,y,c)	general solutions of y'=r(p·x+q·y+k), if p,q,k constant

FVAL(i,nper,pmt,pval,time)	future value of contract

GAMMA(z)	gamma function of z

GAUSS(a,b,c,z)	Gauss hypergeometric function F(a,b;c;z)

GAUSS_SERIES(a,b,c,z,m)	m+1 terms of series for Gauss hypergeometric function

GCD(m,n,...)	greatest common divisor of m, n, ...

GEGENBAUER_C(n,a,x)	nth Gegenbauer ultraspherical polynomial Cn(a)(x)

GEGENBAUER_C_LIST(n,a,x)	vector of first n Gegenbauer ultraspherical polynomials

GEN_HOM(r,x,y,x0,y0)	implicit specific solution of y'=r(x,y), if r is generalized homogeneous

GEN_HOM_GEN(r,x,y,c)	implicit general solution of y'=r(x,y), if r is generalized homogeneous

GEN_LUCAS(n,p,q,L0,L1)	nth term of the generalized Lucas sequence L(n)

GENERALIZED_LAGUERRE(n,a,x)	nth generalized Laguerre polynomial Ln(a)(x)

GENERALIZED_LAGUERRE_LIST(n,a,x)	vector of first n generalized Laguerre a polynomials

GEOMETRIC1(k,p,q,x,x0,y0)	solution of 1st order linear-geometric recurrence equation

GEOMETRY_MATRIX(θ,G)	geometry matrix for coordinate vector θ having metric tensor G

GOODNESS_OF_FIT(u,x,A)	standard deviation of u(x) from data in matrix A

GRAD(u)	gradient of expression u wrt variables x, y, and z

GRAD(u,w)	gradient of expression u wrt variables in vector w

GRAD(u,A)	gradient of expression u using coordinate geometry matrix A

HERMITE_H(n,x)	nth Hermite polynomial Hn(x)

HERMITE_H_LIST(n,x)	vector of first n Hermite polynomials

HERMITE_HE(n,x)	nth associated Hermite polynomial HEn(x)

HERMITE_HE_LIST(n,x)	vector of first n associated Hermite polynomials

HEX(n)	nth hex (i.e. 6-sided centered) number

HOMOGENEOUS(r,x,y,x0,y0)	specific solution of y'=r(x,y), if r is homogeneous

HOMOGENEOUS_GEN(r,x,y,c)	general solution of y'=r(x,y), if r is homogeneous

HORIZONTALS(w,z,z00,zmn,m,n)	w-plane map of rectangular z-plane grid

HURWITZ_ZETA(s,a,m)	m+1 terms of series approximation for Hurwitz generalized zeta function

HYPERGEOMETRIC_DENSITY(k,n,m,j)	hypergeometric probability density function

HYPERGEOMETRIC_DISTRIBUTION(k,n,m,j)	cumulative hypergeometric probability distribution function

HYPERGEOMETRIC_SERIES(plist,qlist,z,m)	m+1 terms of series for generalized hypergeometric function

IDENTICAL?(u,v)	if u is identical to v, return true; otherwise return false

IDENTITY_MATRIX(n)	n by n identity matrix

IF(r)	if r is true, return 1; if r is false, return 0

IF(r,t,f)	if r is true, return expression t; if r is false, return expression f

IF(r,t,f,u)	if r is true, return expression t; if false, return expression f; if unknown, return u

IM(z)	imaginary part of z

IMP_CENTER_OF_ CURVATURE(u,x,y)	center of curvature of implicit function u(x,y)=0

IMP_CURVATURE(u,x,y)	curvature of implicit function u(x,y)=0

IMP_DIF(u,x,y,n)	nth derivative of implicit function u(x,y)=0

IMP_OSCULATING_CIRCLE(u,x,y,x0,y0,θ)	circle osculating implicit function u(x,y)=0 at (x0,y0) in terms of θ

IMP_PERPENDICULAR(u,x,y,x0,y0)	line perpendicular to implicit function u(x,y)=0 at (x0,y0)

IMP_TANGENT(u,x,y,x0,y0)	line tangent to implicit function u(x,y)=0 at (x0,y0)

INCOMPLETE_BETA(x,z,w)	incomplete beta function Bx(z,w)

INCOMPLETE_GAMMA(z,w)	incomplete gamma function P(z,w), real part z > 0

INCOMPLETE_GAMMA_SERIES(z,w,m)	m+1 terms of series approximation for P(z,w)

INSERT(u,v,n)	insert u before the nth element of v

INT(u,x)	antiderivative of u(x) wrt x

INT(u,x,a,b)	definite integral of u(x) from x=a to b

INT_DATA(A)	antiderivative of numerical data matrix A

INT_PARTS(u,v,x)	antiderivative of u(x)·v(x) using integration by parts

INT_SUBST(y,x,u)	antiderivative of y(x) by substituting x for u(x)

INTEGER?(k)	if k is an integer, return true; otherwise return false

INTEGER_TYPE?(u)	if expression u is of integer type, return true; otherwise return false

INTEGRATING_FACTOR(p,q,x,y,x0,y0)	specific solution of p(x,y)+q(x,y)y'=0, if integrating factor exists

INTEGRATING_FACTOR _GEN(p,q,x,y,c)	general solution of p(x,y)+q(x,y)y'=0, if integrating factor exists

INVERSE(u,x)	inverse of u(x) with respect to x

INVERSE_MOD(a,m)	inverse of a mod m if it exists, and a question mark otherwise

ISOMETRIC(v)	2D isometric projection of 3D coordinate vector v

ISOMETRICS(v,s,s0,sm,m,t,t0,tn,n)	vector that 2D plots as isometric projection of 3D coordinate vector v

ITERATE(u,x,x0)	1st repeated element of sequence x0, u(x0), u(u(x0)), ...

ITERATE(u,x,x0,n)	element n+1 of sequence x0, u(x0), u(u(x0)), ...

ITERATE(u,[x1,x2,...],[x01, x02,...])	1st repeated element of sequence [x01, x02,...],u(x01, x02,...),...

ITERATES(u,x,x0)	vector [x0,u(x0),u(u(x0)),...] until an element is repeated

ITERATES(u,x,x0,n)	1st n+1 elements of vector [x0,u(x0),u(u(x0)),...]

JACOBI(a,b)	Jacobi symbol (a/b)

JACOBI_AM(u,m,n)	Jacobi elliptic amplitude function

JACOBI_P(n,a,b,x)	nth Jacobi polynomial Pn(a,b)(x)

JACOBI_P_LIST(n,a,b,x)	vector of 1st n Jacobi (a,b) polynomials

JACOBIAN(u,v)	Jacobian matrix of the coordinate transformation x=u(v1,v2, …, vm)

KI(m,n)	complete elliptic integral of the 1st kind

KRONECKER(i,j)	Kronecker delta function

KUMMER(a,b,z)	Kummer's confluent hypergeometric function M(a,b,z)

KUMMER_SERIES(a,b,z,m)	m+1 terms of series approximation for M(a,b,z)

LAGUERRE_L(n,x)	nth Laguerre polynomial Ln(x)

LAGUERRE_L_LIST(n,x)	vector of first n Laguerre polynomials

LAPLACE(y,t,s)	Laplace transform of y(t) for transform domain variable

LAPLACIAN(u)	divergence of gradient of expression u wrt variables x, y, and z

LAPLACIAN(u,w)	divergence of gradient of expression u wrt variables in vector w

LAPLACIAN(u,A)	divergence of gradient of expression u using coordinate geometry matrix A

LCM(m,n,...)	least common multiple of m, n, ...

LEFT_RIEMANN(u,x,a,b,n)	left Riemann sum of n rectangles of integral of u(x) from x=a to b

LEGENDRE_P(n,x)	nth Legendre polynomial Pn(x)

LEGENDRE_P_LIST(n,x)	vector of first n Legendre polynomials

LERCH_PHI(z,s,a,m)	m terms of series approximation for Lerch transcendent function Φ(z,s,a)

LHS(r)	left hand side (left operand) of relation r

LI(x,m)	m terms of series approximation for logarithmic integral li(x), x>1

LIM(u,x,a)	limit of u(x) as x approaches a

LIM(u,x,a,1)	limit of u(x) as x approaches a from above

LIM(u,x,a,-1)	limit of u(x) as x approaches a from below

LIM2(u,x,y,x0,y0)	limit of u as [x,y] -> [x0,y0] along slope of @1

LIN_FRAC(r,a,b,c,p,q,k,x,y,x0,y0)	specific solution of linear fractional equation y'=r((ax+by+c)/(px+qy+k))

LIN_FRAC_ GEN(r,a,b,c,p,q,k,x,y,c)	general solution of linear fractional equation y'=r((ax+by+c)/(px+qy+k))

LIN1_DIFFERENCE(p,q,x, x0,y0)	specific solution of recurrence equation y(x+1)=p(x)y(x)+q(x), y(x0)=y0

LIN2_CCF(p,q,r,x,c1,c2)	general solution of difference equation y(x+2)+p·y(x+1)+q·y(x)=r(x)

LIN2_CCF_BV(p,q,r,x,x0,y0,x2,y2)	specific solution of difference equation y(x+2)+p·y(x+1)+q·y(x)=r(x)

LINEAR_CORRELATION_COEFFICIENT(A)	linear correlation coefficient of 2-column x-y matrix A

LINEAR1(p,q,x,y,x0,y0)	explicit solution of linear monic equation y'+p(x)y=q(x)

LINEAR1_GEN(p,q,x,y,c)	general solution of linear monic equation y'+p(x)y=q(x)

LIOUVILLE(p,q,x,y,c1,c2)	general solution of Liouville equation y"+p(x)y'+q(y)(y')^2=0

LN(z)	natural logarithm of z

LOAD(filename)	load the utility file named filename

LOG(z)	natural logarithm of z

LOG(z,w)	logarithm of z to the base w

LOGICAL?(k)	if k is a truth-value (i.e. true or false), return true; otherwise return false

LOGICAL_TYPE?(u)	if expression u is of truth-value type, return true; otherwise return false

LOOP(s1,...,sn)	repeatedly simplify statements s1 through sn until a RETURN or EXIT statement encountered

LUCAS(n)	nth Lucas number beginning at 1

LUCAS_LEHMER(p)	if p is an odd prime and 2^p-1 is prime, returns true; otherwise returns false

MAP(u,x,c)	evaluates u(x) for x equal to elements of collection c and returns true

MAP(u,k,m,n,s)	evaluates u(k) for k=m to n in steps of size s and returns true

MAP_LIST(u,x,c)	evaluates u(x) for x equal to elements of collection c and returns result as a collection

MAP_LIST(u,k,m,n,s)	evaluates u(k) for k=m to n in steps of size s and returns result as a vector

MATPROD(A,B,i,j)	element i,j of the dot product of A and B

MAX(x1,x2,...)	maximum of x1, x2, ...

MAX(v)	maximum element of vector v

MEMBER?(u,v)	if u is a member of v, return true; otherwise return false

MERSENNE(n)	nth Mersenne prime 2^p - 1

MERSENNE_DEGREE(n)	exponent p of nth Mersenne prime 2^p - 1

MERSENNE_LIST(n)	exponents p of first n Mersenne prime 2^p - 1

MIN(x1,x2,...)	minimum of x1, x2, ...

MIN(v)	minimum element of vector v

MINOR(A,i,j)	delete row i and column j from A

MOD(m)	fractional part of m

MOD(m,n)	m modulo n (nonnegative remainder of m/n)

MODS(m,n)	symmetric m modulo n

MOEBIUS_MU(n)	Moebius mu function of n

MONOMIAL_TEST(p,q,x,y)	integrating factor of p(x,y)+q(x,y)y'=0, if result of the form x^m·y^n

NAME_TO_CODES(v)	vector of ASCII codes corresponding to the characters in string or integer s

NEWTON(u,x,x0,n)	n iterations of Newton's method applied to equation u(x)=0 with initial guess of x=x0

NEWTONS(u,x,x0,n)	n iterations of Newton's method applied to a system of equations

NEXT_MERSENNE_DEGREE(n)	smallest prime p>n such that Mersenne number 2^p - 1 is prime

NEXT_PRIME(n)	next prime larger than n

NORMAL(z)	cumulative distribution function of z

NORMAL(z,m,s)	normal distribution function of z with mean m and standard deviation s

NORMAL_LINE(u,v,v0,t)	line normal to surface u=0 at v=v0, using parameter t

NPER(i,pmt,pval,fval,time)	number of payment periods

NSOLUTIONS(u,x)	vector of approximate solutions of equation u=0 for variable x

NSOLUTIONS(B,x)	vector of approximate solutions of Boolean B for variable x

NSOLUTIONS(B,x,Real)	vector of approximate real solutions of Boolean B for variable x

NSOLUTIONS(B,v)	vector of vectors of simultaneous solutions of Boolean B for variables in vector v

NSOLUTIONS(w,v)	vector of vectors of simultaneous solutions of Booleans in vector w for variables in vector v

NSOLVE(u,x)	approximate solution of equation u=0 for variable x expressed as a Boolean equivalent to u=0

NSOLVE(B,x)	approximate solution of Boolean B for variable x expressed as a Boolean equivalent to B

NSOLVE(B,x,Real)	approximate real solution of Boolean B for variable x expressed as a Boolean equivalent to B

NSOLVE(B,v)	solution of Boolean B for variables in vector v expressed as a Boolean equivalent to B

NSOLVE(w,v)	solution of Booleans in vector w for variables in vector v expressed as a vector of Booleans whose disjunction is equivalent to the conjunction of the Booleans in vector w

NTH_PRIME(n)	nth prime number

NUMBER?(k)	if k is a real or complex number, return true; otherwise return false

NUMBER_TYPE?(u)	if expression u is real or complex, return true; otherwise return false

NUMERATOR(u)	syntactic numerator of u

OCTAHEDRAL(n)	nth octahedral number

ODD?(k)	if k is an odd number, return true; otherwise return false

OSCULATING_CIRCLE(y,x,θ)	circle osculating y(x), in terms of θ

OUTER(v,w)	outer product of vectors v and w

PADE(y,x,x0,n,d)	approx y(x) near x=x0, n=numr deg, d=denr deg, n=d or d-1

PARA_ARC_LENGTH(v,t,t1,t2)	arc length of vector v(t) from t=t1 to t2

PARA_ARC_LENGTH(v,t,t1,t2,μ)	integral of μ(t) along v(t) from t=t1 to t2

PARA_CENTER_OF_CURVATURE(v,t)	center of curvature of v=[x(t),y(t)]

PARA_CURVATURE(v,t)	curvature of v=[x(t),y(t)]

PARA_DIF(v,t,n)	nth derivative of v=[x(t),y(t)]

PARA_OSCULATING_CIRCLE(v,t,t0,Φ)	circle osculating v=[x(t),y(t)] at t=t0 in terms of Φ

PARA_PERPENDICULAR(v,t,t0,x)	line perpendicular to v=[x(t),y(t)] at t=t0 in terms of x

PARA_TANGENT(v,t,t0,x)	line tangent to v=[x(t),y(t)] at t=t0 in terms of x

PARTITION(v,n,d)	partition of vector v into vectors of length n with an offset delta of d

PARTS(n)	number of decompositions of n into integer summands

PARTS_LIST(n)	n+1 element vector of PARTS(0) through PARTS(n)

PELL(n)	nth Pell number

PENTATOPE(n)	nth pentatope number

PERFECT(n)	nth perfect number (i.e. numbers that are equal to the sum of their divisors)

PERM(z,w)	permutations of z things taken w at a time

PERPENDICULAR(y,x,x0)	line perpendicular to y(x) at x=x0

PHASE(z)	phase angle of z

PICARD(r,p,x,y,x0,y0)	improved series approximation of ODE, given the series p(x)

PIVOT(A,i,j)	force column j below row i to 0 by pivoting

PlotInt(u,x,a,b)	plots the definite integral of the function u(x) from x = a to b

PMT(i,nper,pval,fval,time)	periodic payment

POCHHAMMER(a,x)	Pochhammer symbol function (a)x

POISSON_DENSITY(k,t)	Poisson probability density

POISSON_DISTRIBUTION(k,t)	cumulative probability Poisson distribution function

POLAR_ARC_LENGTH(r,θ,θ1,θ2)	arc length of polar r(θ) from θ1 to θ2

POLAR_ARC_LENGTH(r,θ,θ1,θ2,μ)	integral of μ(θ) along arc r(θ)

POLAR_AREA(r,r1,r2,θ,θ1,θ2)	area of θ=θ1 to θ2 and r=r1(θ) to r2(θ)

POLAR_AREA(r,r1,r2,θ,θ1,θ2,μ)	integral of μ(θ) over region

POLAR_CENTER_OF_CURVATURE(r,θ)	center of curvature of r(θ)

POLAR_CURVATURE(r,θ)	curvature of r(θ)

POLAR_DIF(r,θ,n)	nth derivative of r(θ)

POLAR_OSCULATING_CIRCLE(r,θ,θ0,Φ)	circle osculating r(θ) at θ=θ0 in terms of Φ

POLAR_PERPENDICULAR(r,θ,θ0,x)	line perpendicular to r(θ) at θ=θ0 in terms of x

POLAR_TANGENT(r,θ,θ0,x)	line tangent to r(θ) at θ=θ0 in terms of x

POLY _COEFF(u,x,n)	coefficient of x^n term in polynomial u(x)

POLY _DEGREE(u,x)	degree of polynomial u(x)

POLY _INTERPOLATE(A,x)	polynomial interpolation of data matrix A

POLY _INTERPOLATE _EXPRESSION(u,x,a)	polynomial in x that interpolates u given 1D vector of points a

POLY_GCD(u,v)	polynomial gcd of u and v

POLY_MOD(u,n)	polynomial whose coefficients are those of polynomial u reduced by modulus n

POLY_MODS(u,n)	polynomial whose coefficients are those of polynomial u reduced by symetric modulus n

POLYGAMMA(n,z,m)	m+1 terms of series approximation for the nth polygamma function Ψn(z)

POLYGONAL(n,p)	nth p-sided polygonal number

POLYGONAL_PYRAMID(n,p,d)	nth p-sided d-dimensional polygonal pyramid number

POLYLOG(n,z,m)	m terms of series approximation for Jonquière's polylogarithm function Li(n)(z)

POTENTIAL(v)	scalar potential of vector v starting at (0,0,0) wrt variables x, y, and z

POTENTIAL(v,w)	scalar potential of vector v starting at coordinates in vector w wrt variables x, y, and z

POTENTIAL(v,w,u)	scalar potential of vector v starting at coordinates in vector w wrt variables in vector u

POTENTIAL(v,w,A)	scalar potential of vector v starting at coordinates in vector w using geometry matrix A

POWER?(u)	if expression u is a power, return true; otherwise return false

POWER_MOD(n,d,m)	n^d mod m

POWER_SET(s)	all subsets of s

PREVIOUS_PRIME(n)	first prime smaller than n

PRIME?(n)	if n is prime, return true; otherwise return false

PRIMEPI(x,d,a)	number of primes p ≤ x, such that p is of the form p = k·d + a for some k ≥ 0

PRIME_POWER?(n)	if n is a power of a prime number, returns true; otherwise returns false

PRIMITIVE_ROOT(n)	smallest primitive root mod n, if one exists; otherwise a ?

PRODUCT(c)	product of the elements of collection c

PRODUCT(u,k)	antiquotient of u(k) wrt k

PRODUCT(u,k,c)	product of u(k) for k an element of collection c

PRODUCT(u,k,m,n)	definite product of u(k) from k=m to n

PRODUCT?(u)	if expression u is a product, return true; otherwise return false

PROG(s1,...,sn)	simplify statements s1 through sn unless a RETURN(u) or EXIT statement encountered

PROVE_SUM(t,k,a,n,s)	if SUM(t,k,a,n)=s, return [0,0]

PVAL(i,nper,pmt,fval,time)	present value of contract

QUOTIENT(u,v)	polynomial quotient of u divided by v

RANDOM(n)	if n=0, initialize seed based on current time

RANDOM(n)	if n=1, a random number in the interval [0,1)

RANDOM(n)	if n>1, a random integer  in the interval [0,n)

RANDOM(n)	if n<1, initialize random number seed to n

RANDOM_MATRIX(m,n,s)	m by n matrix with random elements from -s to s

RANDOM_NORMAL(s,m)	random normal value with a standard deviation of s and a mean value of m

RANDOM_POLY(x,d,s)	poly of degree d in x with random coefficents from -s to s

RANDOM_SIGN	random 1 or -1

RANDOM_VECTOR(n,s)	n element vector with random elements from -s to s

RANK(A)	rank of matrix A

RATE(nper,pmt,pval,fval,time,min,max)	periodic interest rate

RATIO_TEST(t,n)	if < 1, SUM(t,n,a,inf) converges; if > 1, sum diverges

RATIONAL?(k)	if k is a rational number, return true; otherwise return false

RAYS(w,z,z00,zmn,m,n)	matrix of w vectors for z =x0 + #i y0... xm + #i y

RE(z)	real part of z

REAL_TYPE?(u)	if expression u is real, return true; otherwise return false

RECURRENCE(u,v,v0,m)	m recurrences of u(v) starting with vector v=v0

RECURRENCE1(r,x,y,x0,y0,n)	n steps of y(x+1)=r(x,y(x)), y(x0)=y0

REMAINDER(u,v)	polynomial remainder of u divided by v

REPLACE(u,v,n)	replace the nth element of v with u

REST(v)	returns a vector of all but the first element of v

RETURN(u)	immediately exit function and return u as its value

REVERSE(v)	reverse elements of vector v

RHOMBIC_DODECAHEDRAL(n)	nth rhombic dodecahedral number

RHS(r)	right hand side (right operand) of relation r

RK(r,v,v0,h,n)	fourth order Runge-Kutta solution of system of 1st order differential equations

RMS(z1,...,zn)	root mean square of z1 through zn

ROTATE_X(ϕ)	matrix A so that A . [x,y,z] rotates angle ϕ about x axis

ROTATE_Y(ϕ)	matrix A so that A . [x,y,z] rotates angle ϕ about y axis

ROTATE_Z(ϕ)	matrix A so that A . [x,y,z] rotates angle ϕ about z axis

ROUND(m,n)	nearest integer to m/n (n defaults to 1)

ROW_REDUCE(A)	row echelon form of A

ROW_REDUCE(A,B)	row echelon form of A augmented by B

SCALE_ELEMENT(v,i,s)	multiply element i of v by s

SEC(z)	secant of z radians

SECH(z)	hyperbolic secant of z

SELECT(u,k,m,n,s)	vector of k as k goes from m thru n in steps of s for which u(k) is true

SELECT(u,k,c)	collection of those elements of collection c for which u(k) is true

SEPARABLE(p,q,x,y,x0,y0)	specific solution of separable equation y'=p(x)q(y)

SEPARABLE_GEN(p,q,x,y,c)	general solution of separable equation y'=p(x)q(y)

SET?(u)	if u is a set, return true; otherwise return false

SET_TYPE?(u)	if expression u is of set type, return true; otherwise return false

SI(z)	sine integral Si(z)

SIGN(x)	sign of x

SIGN(z)	radial projection of z on unit circle

SIN(z)	sine of z radians

SIN(z·deg)	sine of z degrees

SINH(z)	hyperbolic sine of z

SMOOTH_COLUMN(A,j)	matrix A with column j smoothed

SMOOTH_VECTOR(v)	smoothed copy of vector v

SOLUTIONS(u,x)	vector of solutions of equation u=0 for variable x

SOLUTIONS(B,x)	vector of solutions of Boolean B for variable x

SOLUTIONS(B,x,Real)	vector of real solutions of Boolean B for variable x

SOLUTIONS(B,v)	vector of vectors of simultaneous solutions of Boolean B for variables in vector v

SOLUTIONS(w,v)	vector of vectors of simultaneous solutions of Booleans in vector w for variables in vector v

SOLVE(u,x)	solution of equation u=0 for variable x expressed as a Boolean equivalent to u=0

SOLVE(B,x)	solution of Boolean B for variable x expressed as a Boolean equivalent to B

SOLVE(B,x,Real)	real solution of Boolean B for variable x expressed as a Boolean equivalent to B

SOLVE(B,v)	solution of Boolean B for variables in vector v expressed as a Boolean equivalent to B

SOLVE(w,v)	solution of Booleans in vector w for variables in vector v expressed as a vector of Booleans whose disjunction is equivalent to the conjunction of the Booleans in vector w

SOLVE_MOD(u,x,m)	vector of solutions of the linear congruence equation u(x) mod m

SOME(u,x,c)	if u(x) is true for some x in c, return true; otherwise return false

SOME(u,k,m,n,s)	if u(k) is true for some k=m to n in steps of s, return true; otherwise return false

SORT(v)	function to sort the elements of a vector or set v, and return the result as a vector

SPHERE(r,θ,Φ)	3D coordinate matrix of a sphere of radius r

SPHERICAL_BESSEL_Y(n,z)	closed-form spherical Bessel function of 2nd kind,yn(z)

SPHERICAL_BESSEL_J(n,z)	spherical Bessel function of 1st kind jn(z) for integer n

SPHERICAL_BESSEL_J_LIST(n,z)	vector of spherical Bessel functions of 1st kind j0(z) through jn(z)

SPHERICAL_BESSEL_Y(n,z)	spherical Bessel function of 2nd kind yn(z) for integer n

SPHERICAL_VOLUME(r,r1,r2,θ,θ1,θ2,Φ,Φ1,Φ2)	volume of region specified in spherical coordinates

SPHERICAL_VOLUME(r, r1,r2,θ,θ1,θ2,Φ,Φ1,Φ2,μ)	integral of μ(r,θ,Φ) over the region

SQRT(z)	square root of z

SQUARE_ROOT(a,p)	square root of integer a mod prime p, if one exists; otherwise ?

SQUARE_WAVE(x)	square wave of x

SQUAREFREE(n)	if n is not divisible by the square of a prime, returns true; otherwise returns false

STAR(n)	nth star (i.e. 12-sided centered) number

STDEV(z1,...,zn)	standard deviation of z1 through zn

STEP(x)	step function of x

STIRLING1(n,k)	nth Stirling cycle number of the 1st kind

STIRLING2(n,k)	nth Stirling subset number of the 2nd kind

STIRLING_CYCLE(n,k)	nth Stirling cycle number of the 1st kind

STIRLING_SUBSET(n,k)	nth Stirling subset number of the 2nd kind

STRING(v)	string variable having same display name as variable v

STRING?(u)	if expression u is a string variable, return true; otherwise return false

STUDENT(t,v)	student's cumulative probability distribution A(t|v)

SUBST(u,old,new)	substitute new for old in u

SUBTRACT_ELEMENTS(v,i,j,s)	subtract element j·s from element i of v

SUM(c)	sum of the elements of collection c

SUM(u,k)	antidifference of u(k) wrt k

SUM(u,k,c)	sum of u(k) for k an element of collection c

SUM(u,k,m,n)	definite sum of u(k) from k=m to n

SUM?(u)	if expression u is a sum, return true; otherwise return false

SURFACE_AREA(z,x,x1,x2,y,y1,y2)	area of surface z(x,y)

SURFACE_AREA(z,x,x1,x2,y,y1,y2,μ)	integral of μ(x,y) over surface z(x,y)

SWAP_ELEMENTS(v,i,j)	interchange elements i and j of vector v

TABLE(u,k,m,n,s)	table of (n-m+1)/s rows of u(k) simplified with k=m to n in steps of size s

TAN(z)	tangent of z radians

TANGENT(y,x,x0)	line tangent to y(x) at x=x0

TANGENT_PLANE(u,v,v0)	plane tangent to u(x,y,z)=0 at [x,y,z]=v=v0

TANH(z)	hyperbolic tangent of z

TAYLOR(u,x,a,n)	nth order Taylor approximation of u(x) about x=a

TAYLOR_INVERSE(u,x,y,x0,n)	nth order series expansion of inverse of y=u(x)

TAYLOR_ODE1(r,x,y,x0,y0,n)	nth order Taylor series solution of y'=r(x,y) with y=y0 at x=x0

TAYLOR_ODE2(r,x,y,v,x0,y0,v0,n)	nth order Taylor series solution of y''=r(x,y,y')

TAYLOR_ODES(r,x,y,x0,y0,n)	vector of nth order Taylor series solutions of system of  differential equations

TAYLOR_SOLVE(u,x,y,x0,y0,n)	nth order series solution y(x) of u(x,y)=0

TERMS(u)	vector of syntactic terms of u

TETRAHEDRAL(n)	nth tetrahedral number

TORUS(r,θ,Φ)	3D coordinate matrix of torus of radius r

TRACE(A)	trace of matrix A (sum of diagonal elements)

TRIANGULAR(n)	nth triangular number

TRUTH_TABLE(p1,p2,...,bool1,bool2,...)	truth table matrix for Boolean expressions bool1, bool2, ...

U_LUCAS(n,p,q)	nth term of the Lucas sequence L(n) where L(0)=0, L(1)=1, and L(n+2)=p·L(n+1)-q·L(n)

U_MOD(n,p,q,m)	U_LUCAS(n, p, q) mod m, but is more efficient

V_LUCAS(n,p,q)	nth term of the Lucas sequence L(n) where L(0)=2, L(1)=p, and L(n+2)=p·L(n+1)-q·L(n)

V_MOD(n,p,q,m)	V_LUCAS(n,p,q) mod m, but is more efficient

VARIANCE(z1,...,zn)	variance of z1, ..., zn

VARIABLE?(u)	if u is a variable, return true; otherwise return false

VARIABLES(u)	a vector of the free variables in u

VECTOR(u,k,v)	vector of u(k) applied to elements of vector v

VECTOR(u,k,n)	vector of u(k) as k goes from 1 thru n in steps of 1

VECTOR(u,k,m,n)	vector of u(k) as k goes from m thru n in steps of 1

VECTOR(u,k,m,n,s)	vector of u(k) as k goes from m thru n in steps of s

VECTOR?(u)	if u is a vector, return true; otherwise return false

VECTOR_POTENTIAL(v)	vector potential of vector v starting at (0,0,0) wrt variables x, y, and z

VECTOR_POTENTIAL(v,w)	vector potential of vector v starting at vector w wrt variables x, y, and z

VECTOR_POTENTIAL(v,w,u)	vector potential of vector v starting at vector w wrt variables in vector u

VECTOR_POTENTIAL(v,w,A)	vector potential of vector v starting at vector w using geometry matrix A

VECTOR_TYPE?(u)	if expression u is of vector type, return true; otherwise return false

VOLUME(x,x1,x2,y,y1,y2,z,z1,z2)	volume y=y1(x) to y2(x), z=z1(x,y) to z2(x,y)

VOLUME(x,x1,x2,y,y1,y2,z,z1,z2,μ)	integral of μ(x,y,z) over region

VOLUME_CENTROID(x,x1,x2,y,y1,y2,z,z1,z2)	volumetric centroid of region

VOLUME_CENTROID(x,x1,x2,y,y1,y2,z,z1,z2,μ)	centroid of density μ(x,y,z)

VOLUME_INERTIA(x,x1,x2,y,y1,y2,z,z1,z2)	volumetric inertia tensor

VOLUME_INERTIA(x,x1,x2,y,y1,y2,z,z1,z2,μ)	inertia tensor of μ(x,y,z)

VOLUME_OF_REVOLUTION(y,x,x1,x2)	volume of y(x) revolved about x-axis

VOLUMEY_OF_REVOLUTION(y,x,x1,x2)	volume of y(x) revolved about y-axis

WEBER_D(n,x)	Weber's nth parabolic cylinder function Dn(x)

ZETA(s)	the Riemann zeta function ζ(s)

ZETA(s,z)	the Hurwitz zeta function ζ(s,z)

Other Help Contents


Derive Reserved System Names

The following are the reserved system names in DERIVE in alphabetical order.  They cannot be used for the names of user variables or functions:

Angle	Any	Approximate

ArrowKeyMode	Asterisk	Auto

Binary	Branch	CaseMode

Character	Collect	Complex

Compressed	Cosines	Decimal

Degree	DisplayFormat	Dot

Exact	exit	Expand

Exponential	Hexadecimal	Implicit

InputBase	InputMode	Insensitive

Integer	LineEdit	Logarithm

Logical	Mixed	Nonscalar

Normal	Notation	NotationDigits

Octal	OutputBase	Precision

PrecisionDigits	Principal	Radian

raDical	Rational	Real

Scientific	ScientificThreshold	Sensitive

Set	SimplifyRelations	Sines

Squarefree	Subexpression	TimesOperator

Trigonometry	Trigpower	Trivial

VariableOrder	Vector	Word

Other Help Contents