MaplePortal/Student/Examples - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : MaplePortal/Student/Examples

Maple Portal for Students Examples

Back to Student Portal Details

 

Constructing algebraic objects

Algebraic manipulations

Differential calculus in one variable

Integral calculus in one variable

Multivariate calculus

Vector calculus

Complex arithmetic

ODEs

Linear algebra

Numerical analysis

Units, errors, and tolerances

Recurrence equations

Constructing algebraic objects

Example 1.1 - How Do I Enter a Piecewise Function?

Follow the steps below to define the function fx&equals;2 x&plus;1x<134 x1 x<25x2 .

Step

Description

Illustration

1

Start by writing the function definition as fx. See How do I... enter a function?

2

To enter a piecewise function, click on the piecewise template from the Expression palette. This palette is located on the left-hand side of the Maple window.

3

Overwrite x with 2 x&plus;1.

Press Tab to move to the next field, and change x<a to x<1.

Overwrite x in the second row with 34 x.

Change xa to 1x<2.

4

To add another row to the piecewise template, hold down Ctrl+Shift and press R.  

5

Now fill in the values for the third row in place of the question marks.

Back to Student Portal Details

Example 1.2 - How Do I Assign a Name to an Equation or Expression?

 

Assignments

To assign a value to a variable, enter a colon followed by an equal sign.

 

In the example to the right, the variable a stores the expression 5 x.

a5 x

a5x

a

5x

Alternatively, the assignment can be made after the fact. That is, after a value is obtained from a calculation, it can be assigned to a name by using the Context Menu.

 

Enter and execute the calculation to be assigned. From the Context Panel for the result, select Assign to a Name from the context-sensitive options. Enter a name in the dialog that appears, and click OK.

 

 

Equations

In Maple, an equation is defined as two expressions separated by a single equal sign.

 

It is important to note the difference between an equation and an expression. The Context Panel for an expression or an equation will bring up different options, since there are some operations that can be performed on expressions but not on equations, and vice versa. For example, expressions can be factored or (explicitly) differentiated whereas equations cannot be.

MapleExpression  x2&plus;x2&semi;

MapleExpressionx2+x2

MapleEquation  y&equals;x2&plus;x2&semi;

MapleEquationy=x2+x2

It is also important to note that when Maple is asked to solve an expression, it assumes that the expression is equal to zero.

x2&plus;x2solutions for x1&comma;2

Back to Student Portal Details

Example 1.3 - How Do I Construct a Loop?

 

Loops are used to execute code multiple times. In Maple there are two types of loops: do loops and while loops. do loops are used to execute code a given number of times, and while loops continue execution as long as a given condition is met.

 

Structure of a do Loop

Structure of a while Loop

for variable from start to finish do     statements end do&colon;

while condition do  statementsend do&colon;

 

Example 1: Behavior of a basic do loop

b 0&colon;for a from 1 to 3 do   b  b&plus;10&colon;  a&colon;end do&semi;

Place the cursor in the block of code and press [Enter] to execute the code. Try replacing the semicolon after end do with a colon and press [Enter] again; notice that there is no output. Using a colon, &colon;, suppresses the output for every step, while using a semicolon, &semi;, allows the user to see the output.

 

Example 2: Use of a print statement in a loop

b 0&colon;for a from 1 to 3 do   b  b&plus;10&colon;  a&colon;  printb&colon;end do&colon;

Upon executing this code, notice that there is output even though a colon is used after end do. This is the result of the print command. This is valuable if you do not want all the variables to be displayed when a complex loop is executed, but you do want to display some output.

Example 3: Nested while loops

a 0&colon;b0&colon; while a<4 do  aa&plus;1&colon;  while b&gt;4 do    bb1&colon;  end do&semi;  cabend do&semi;

Note that the calculations in the inner loop are not displayed. In Maple, only the calculations in the outermost loop display, even if a semicolon is placed after the inner loop's end do.

 

Note: While writing loops, press [Shift][Enter] to move to a new line. Pressing [Enter] alone causes Maple to execute the incomplete loop, resulting in the following error:

Back to Student Portal Details

Example 1.4 - How Do I Enter the Exponential Function, &ExponentialE;x?

 

To enter the exponential function &ExponentialE;x in Math mode, you can use the Expression palette, Command Completion, or the command exp.

 

In Maple Input mode, use the command exp.

 

Method

Description

Illustration

Using the Expression Palette

To enter the exponential function, click on the exponential template from the Expression palette. This palette is located on the left hand side of the Maple window.

Overwrite a with x.

Command Completion

Start by typing e in Math mode. You can then obtain the exponential function by using Command Completion (Press Esc).

 

To enter the exponential &ExponentialE;, select the first item from the list.

 

 

Then press Shift+^ to raise the cursor to the superscript position, and type in the power, x.

 →

An alternate method is to scroll down the Command Completion list and find &ExponentialE;x.

exp(x)

This command works in both Math and Maple Input modes. 

 

 

 

 

expx

&ExponentialE;x

exp(x);

&ExponentialE;x

 

Note: Just typing ex does not create the exponential function. Use one of the methods above to associate the letter e with the mathematical meaning of the exponential function.

 

Back to Student Portal Details

Example 1.5 - How Do I Enter logax Using the Expression Palette?

 

Step

Description

Illustration

1

To enter the logarithmic function with base a, click on the appropriate log template from the Expression palette. This palette is located on the left-hand side of the Maple window.

thismaplet

2

Overwrite the placeholders b and a with a and x, respectively, moving between placeholders by pressing Tab.

     

Back to Student Portal Details

Example 1.6 - How Do I Convert an Expression to a Function?

Step

Description

Illustration

1

Type an equation of the form
        name = expression

Context Menu: Assign Name

a&equals;x2assign

2

Type the equation fx&equals;a 

Context Menu: Assign Function

fx&equals;aassign as functionf

Notes

The expression can be referenced by a name or by an equation label.

The function name can be any valid, previously unassigned name.

Back to Student Portal Details

Algebraic manipulations

Example 2.1 - How Do I Import Data into the Curve Fitting Assistant?

To launch the Curve Fitting Assistant, go to Tools → Tutors → Statistics → Curve Fitting ...

 

When the Assistant is launched, the dialog box appears as shown. Click on

Import to select a data file.

A dialog window appears where you can navigate to your data file. Maple supports various file types, so from this new dialog, select the file from which you wish to import data and select the file type.

 

For this simple example, data is imported from a text file called "Import data test". The image below shows the contents of this sample data file. Note that the first line is purely text, and the second is blank.

 

When you are done, click Next. The Import Data Dialog shown to the right appears.

 

The first two non-data lines in the Data file must be skipped by setting the Skip Lines parameter to 2.

 

The source form can also be specified. Note that the Curve Fitting Assistant only accepts Rectangular data.

 

When you have chosen your desired options, click Done to return to the Curve Fitting Assistant.

 

 

 

The imported data now appears in the table of Independent and Dependent Values, as shown to the right. Note that the third column of data in the Data file is ignored.

 

Click Fit to open the main window of the Curve Fitting Assistant, as shown below.

 

The Plot buttons on the right generate plots of different interpolating functions.

 

Click Done to close the Assistant and return the algebraic expression shown in the bottom left-hand corner beneath the plot, or the displayed plot.

 

 

Back to Student Portal Details

Differential calculus in one variable

Example 6.1 - How Do I Use the Limit Methods Tutor to Evaluate a Limit Stepwise?

 

Step

Description

Illustration

1

Load the Student[Calculus1] package (Tools → Load Package → Student Calculus 1), and enter the expression whose limit is to be computed. Then, from the Context Panel, select:

Student Calculus 1 → Tutors → Limit Methods.

 

2

Note that the mathematical expression has been automatically inserted into the Function field.

 

By default, this Tutor evaluates the limit of the function at zero, but this number can be changed. Also, the direction in which the limit is taken can be specified.

3

The message box displays hints and explicitly states the rules as they are applied. Note that these hints are suggestions as to what might be a reasonable next step, and do not necessarily give the best method.

 

Click on a Rule button to implement that rule.

 

Click Help in the task bar to give a more thorough explanation of all the functions of the Tutor.

4

Click Undo to reverse the last step. Next Step advances the calculation by one step. All Steps provides all the steps needed for a complete solution.

 

The Close button does not serve the same function as the x in the top right-hand corner of the window.

 

Click Close to close the Tutor and return all the displayed steps; click the x in the top right-hand corner to cancel the tutor and return nothing.

 

Back to Student Portal Details

Example 6.2 - How Do I Use the Differentiation Methods Tutor to Differentiate Stepwise?

 

Step

Description

Illustration

1

Load the Student Calculus 1 package (Tools → Load Package → Student Calculus 1), and enter the expression to be differentiated. Then from the Context Panel, select: Student Calculus 1 → Tutors → Differentiation Methods.

 

Note that the mathematical expression has been automatically inserted into the Function field.

2

The white box displays hints and explicitly states the rules as they are applied. Note that only for the Differentiation Methods Tutor are these hints to be taken as the best possible solution (for other Tutors, they are merely suggestions).

 

When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to import the last calculation into your worksheet.

 

Click Help in the Integration Methods Tutor task bar to give a thorough explanation of all the features of the Tutor.

Note

If the Context Panel is used to launch the tutor on an unevaluated derivative, Maple will evaluate the derivative before inserting it into the tutor. For example, the expression &DifferentialD;&DifferentialD; x 3x2 will be entered in the Tutor as 6 x.

 

To prevent this premature evaluation, convert the differential expression to inert form, or simply delete &DifferentialD;&DifferentialD; x from the expression before launching the tutor.

 

To convert an expression to inert form, from the Context Menu, select: 2D-Math → Convert To → Inert Form.

 

An inert mathematical operator is gray (not black), as in the operation &DifferentialD;&DifferentialD; x in the illustration to the right.

 

 

 

 

 

 

 

&DifferentialD;&DifferentialD; x3x2

Back to Student Portal Details

Example 6.3 - How Do I Differentiate Using the Expression Palette?

 

Step

Description

Illustration

1

To enter a differential expression, click on the &DifferentialD;&DifferentialD;xf template from the Calculus palette. This palette is located on the left-hand side of the Maple window.

Select either the differential expression &DifferentialD;&DifferentialD;xf for a single-variable expression, or the partial differential expression xf for a multivariable expression.

2

Overwrite the placeholders f and x, using the Tab key to move to the next placeholder.

 

The function f should be included within brackets (without brackets, only part of the function may be evaluated, giving unexpected results).

 

The templates &DifferentialD;&DifferentialD;xf and xf perform the same task, for a single-variable expression.

 

To differentiate with respect to another variable, simply change x to the desired variable.

&DifferentialD;&DifferentialD; x 5x = 0

&DifferentialD;&DifferentialD; x 5x = 5

 x 5x = 5

&DifferentialD;&DifferentialD; t t2&plus;3 t&plus;4 = 2t&plus;3

Back to Student Portal Details

Example 6.4 - How Do I Use the Derivatives Tutor to Obtain a Plot of a Function's Derivative(s)?

 

Step

Description

Illustration

1

Load the Student[Calculus1] package (Tools → Load Package → Student Calculus 1), and enter an expression.  Then from the Context Panel, select: Student Calculus1 → Tutors → Derivatives.

2

Note that the function has been inserted automatically into the tutor as fx.

 

The default range for the plot can be changed. The first and second derivatives can be displayed, along with the plot of the function.

 

Click Display to redraw the plot. When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to export the plot to your worksheet.

 

Click Help in the Derivative Tutor task bar to give a thorough explanation of all the features of the Tutor.

Back to Student Portal Details

Example 6.5 - How Do I Launch the Taylor Approximation Tutor from the Context Menu?

Tools → Load Package: Student Calculus 1

Loading Student:-Calculus1

Context Menu: Student Calculus1 → Tutors → Taylor Approximation

Back to Student Portal Details

Integral calculus in one variable

Example 7.1 - How Do I Use the Integration Methods Tutor to Evaluate an Integral Stepwise?

 

Step

Description

Illustration

1

Load the Student[Calculus1] package, and then start the Integration Methods Tutor by using the Context Menu for an expression or inert integral:

 

Context Menu: Student Calculus1 → Tutors → Integration Methods.

Note that the integrand is automatically entered in the Function field.

 

2

Integration can be done stepwise by clicking on the appropriate rule button, or by clicking the Next Step or All Steps buttons.

 

The message box displays hints and explicitly states the rules as they are applied. Note that these hints are suggestions as to what might be a reasonable next step, and do not necessarily give the best possible method.

 

When you are finished with the tutor, click the x in the upper right-hand corner of the window to cancel and close the tutor, or click Close to import the last calculation into your worksheet.

 

Click Help in the Integration Methods Tutor task bar to give a thorough explanation of all the features of the Tutor.

Back to Student Portal Details

Example 7.2 - How Do I Enter and Evaluate fxdx or abfx&DifferentialD;x Using the Expression Palette?

Step

Description

Illustration

1

To enter and evaluate an integral, click on the appropriate integration template from the Calculus palette. This palette is located on the left-hand side of the Maple window.

2

For an indefinite integral, overwrite the placeholder f with the desired function. To integrate with respect to a different variable, you must also overwrite x.

 

For a definite integral, the upper and lower limits, a and b, must also be overwritten. Use the Tab key to move between placeholders.

 →

 

  

3

Press Enter to evaluate the integral on a new line (shown to the right), or press Ctrl+= (Command+= in Macintosh) to evaluate the integral inline (shown below).

 

3 x2&plus;2 x&plus;5 &DifferentialD;x = x3&plus;x2&plus;5x

Back to Student Portal Details

Example 7.3 - How Do I Enter and Evaluate an Integral Using Command Completion?

 

Step

Description

Illustration

1

Start by typing int, and then use Command Completion (Press Esc). Select int (definite) for definite integrals or int (indefinite) for indefinite integrals.

2

For an indefinite integral, overwrite the placeholder f with the desired function. To integrate with respect to a different variable, you must also overwrite x.

 

For a definite integral the upper and lower limits, a and b, must also be overwritten. Use the Tab key to move between placeholders.

 →

 

  

3

Press Enter to evaluate the integral on the next line (shown to the right), or Ctrl+= (Command+= in Macintosh) to evaluate the integral inline (shown below).

 

3 x2&plus;2 x&plus;5 &DifferentialD;x = x3&plus;x2&plus;5x

Note

The integral sign itself can be found in the Common Symbols palette or in the Command Completion list if int is typed. Using this symbol, you can construct an integral and evaluate it. However, to prevent the error:

 

 

the d symbol must be entered as an operator. After typing d, use Command Completion. Select the first item from the list, d(differential). Note that the differential d is not italicized, while a normally typed d is italicized in Math mode.

 

5 x4&plus;3 x3&plus;2 x2&plus;4 x&plus;7 &DifferentialD;x =

 

 

Back to Student Portal Details

Example 7.4 - How Do I Use the Approximate Integration Tutor to Approximate a Definite Integral?

 

Step

Description

Illustration

1

Load the Student[Calculus1] package, and then start the Approximate Integration Tutor by using the Context Panel for an expression or inert integral:

 

Context Panel: Student Calculus1 → Tutors → Approximate Integration.

Note that the integrand is automatically inserted as fx.

 

2

The lower and upper limits of integration are given by a and b, respectively. The interval is divided into n subintervals, the number of partitions.

 

Click on the Riemann Sums and

Newton-Cotes Formulae buttons to change the method of approximating the integral.

 

If partition type Normal is chosen, the function is evaluated at the number of nodes determined by n, the number of partitions.

 

If partition type Subinterval is chosen, the function is evaluated at additional nodes between the uniformly spaced ones determined by n.

 

Click the Display button to redraw the plot showing the approximate value of the definite integral. Click Animate to show dynamically the effect of increasing the number of partitions. Plot Options allows you to modify properties of the plot. Compare compares the values obtained by each approximation method. Close closes the Tutor and inserts the plot into the worksheet.

 

Click Help in the Approximate Integration Tutor task bar to give a thorough explanation of all the features of the Tutor.

Back to Student Portal Details

Example 7.5 - How Do I Launch the Function Average Tutor from the Context Menu?

Tools → Load Package: Student Calculus 1

Loading Student:-Calculus1

Context Panel: Student Calculus 1 → Tutors → Function Average

Back to Student Portal Details

Example 7.6 - How Do I Launch the Arc Length Tutor from the Context Menu?

Tools → Load Package: Student Calculus 1

Loading Student:-Calculus1

Context Panel: Student Calculus 1 → Tutors → Arc Lengths

Back to Student Portal Details

Example 7.7 - How Do I Launch the Volume of Revolution Tutor from the Context Menu?

Tools → Load Package: Student Calculus 1

Loading Student:-Calculus1

Context Panel: Student Calculus 1 → Tutors → Volume of Revolution

Back to Student Portal Details

Example 7.8 - How Do I Launch the Surface of Revolution Tutor from the Context Menu?

Tools → Load Package: Student Calculus 1

Loading Student:-Calculus1

Context Panel: Student Calculus 1 → Tutors → Surface of Revolution

Back to Student Portal Details

Multivariate calculus

Example 8.1 - How Do I Launch the Gradients Tutor from the Context Menu?

Tools → Load Package: Student Multivariate Calculus

Loading Student:-MultivariateCalculus

Context Panel: Student Multivariate Calculus → Tutors → Gradients

Back to Student Portal Details

Example 8.2 - How Do I Launch the DirectionalDerivative Tutor from the Context Menu?

Tools → Load Package: Student Multivariate Calculus

Loading Student:-MultivariateCalculus

Context Panel: Student Multivariate Calculus → Tutors → Directional Derivatives

Back to Student Portal Details

Example 8.3 - How Do I Launch the Taylor Approximation Tutor from the Context Menu?

Tools → Load Package: Student Multivariate Calculus

Loading Student:-MultivariateCalculus

Context Panel: Student Multivariate Calculus → Tutors → Taylor Approximation

Back to Student Portal Details

Example 8.4 - How Do I Enter an Iterated Integral with the Expression Palette?

 

Step

Description

Illustration

1

To enter and evaluate a definite iterated integral, click on the definite integration template from the Calculus palette. This palette is located on the left-hand side of the Maple window.

2

Press Tab twice to move the highlighted field over the placeholder f. Click on the definite integral template a second time. The integral is now an iterated double integral.

 

Repeat the process to produce a higher order iterated integral.

 →  →

 

3

Press Tab to move between the placeholders, and overwrite all the colored parameters. Press Shift+Tab to move to the previous placeholder, if you have not already overwritten it.

 

To evaluate the integral, press Enter to display the value on a new line, or Ctrl+= (Command+= in Macintosh) to display the value inline.

 

fxx2&plus;3 x&plus;2&colon; 13f0f2x2y &DifferentialD;x &DifferentialD;y = 68803

f0f213x2y &DifferentialD;y &DifferentialD;x = 68803

Back to Student Portal Details

Example 8.5 - How Do I Launch the Approximate Integration Tutor from the Context Menu?

Tools → Load Package: Student Multivariate Calculus

Loading Student:-MultivariateCalculus

Context Panel: Student Multivariate Calculus → Tutors → Approximate Integration

Back to Student Portal Details

Vector calculus

Example 9.1 - How Do I Attach a Coordinate System to a Free Vector?

Tools→Load Package: Vector Calculus

Loading VectorCalculus

• 

Use syntax such as that shown to the right to define the vector in a particular coordinate system. The default display uses explicit basis vectors.

VVector1&comma;2&comma;3&comma;coords&equals;spherical&rho;&comma;&phi;&comma;&theta;

• 

To change the display of the vector to column notation, change the default value of BasisFormat.

BasisFormatfalse&colon; V

• 

Use the About command to extract information about the vector.

AboutV

Type: Free VectorComponents: 1&comma;2&comma;3Coordinates: sphericalρ,φ,θ

• 

Use the GetCoordinates command to extract the coordinate system and the names of the coordinate variables.

GetCoordinatesV

sphericalρ,φ,θ

• 

Use the attributes command to extract the vector's attributes, which here are its coordinate system.

attributesV

coords=sphericalρ,φ,θ

Back to Student Portal Details

Example 9.2 - How Do I Compute a Gradient Interactively with ?

• 

Set a coordinate system, as, for example, with the SetCoordinate command.

VectorCalculus:-SetCoordinatescartesianx&comma;y

cartesianx,y

• 

Apply the Nabla  or Del operator from the Common Symbols palette.

• 

Context Menu: Evaluate and Display Inline

x2&plus;y2 =

Back to Student Portal Details

Example 9.3 - How Do I Compute a Divergence Interactively with ?

• 

Set a coordinate system, as, for example, with the SetCoordinate command.

VectorCalculus:-SetCoordinatescartesianx&comma;y

cartesianx,y

• 

Define a vector field.

FVectorCalculus:-VectorFieldx&comma;y&comma;cartesianx&comma;y

• 

Apply the Nabla  or Del operator from the Common Symbols palette.

• 

Context Menu: Evaluate and Display Inline

·F = 2

Back to Student Portal Details

Example 9.4 - How Do I Compute a Curl Interactively with ?

• 

Set a coordinate system, as, for example, with the SetCoordinate command.

VectorCalculus:-SetCoordinatescartesianx&comma;y&comma;z

cartesianx,y,z

• 

Define a vector field.

FVectorCalculus:-VectorFieldy2&comma;z2&comma;x2&comma;cartesianx&comma;y&comma;z

• 

From the Common Symbols palette, apply the Nabla  or Del, and the cross-product operators.

• 

Context Menu: Evaluate and Display Inline

×F =

Back to Student Portal Details

Example 9.5 - How Do I Compute a Laplacian Interactively with ?

• 

Set a coordinate system, as, for example, with the SetCoordinate command.

VectorCalculus:-SetCoordinatescartesianx&comma;y

cartesianx,y

• 

Apply the Nabla  or Del operator from the Common Symbols palette.

• 

Context Menu: Evaluate and Display Inline

2x2&plus;y2 = 4

Back to Student Portal Details

Example 9.6 - How Do I Implement the Frenet-Serret Formalism Interactively?

Tools→Load Package: Vector Calculus

Loading VectorCalculus

• 

Enter the space-curve in a radius-vector format.

• 

Context Menu: Select from any of the following options:
TNBFrame, Tangent Vector, Principal Normal, Binormal Vector, Curvature, Torsion, Radius of Curvature

cos&theta;&comma;sin&theta;&comma;&theta;

Back to Student Portal Details

Example 9.7 - How Do I Change Coordinates of a Point ?

Tools→Load Package: Vector Calculus

Loading VectorCalculus

Enter a Cartesian point in the plane. Note that points are expressed as "free vectors" in the Vector Calculus packages.

pa&comma;b

Apply the MapToBasis command, changing from Cartesian to polar coordinates.

MapToBasisp&comma;polar

Note that in non-Cartesian spaces, points are represented by the analog of a free vector in a rectangular instantiation of the non-Cartesian space. This "vector" is a representation only, the "basis vectors" simply indicating the names of the new coordinates.

Back to Student Portal Details

Example 9.8 - How Do I Change Coordinates in a Vector Field?

Tools→Load Package: Vector Calculus

Loading VectorCalculus

In Cartesian coordinates, define a vector field F.

FVectorField1&comma;0&comma;0&comma;cartesianx&comma;y&comma;z&colon;

Express F in spherical coordinates.

MapToBasisF&comma;spherical&rho;&comma;&phi;&comma;&theta;

Note the overbars on the basis vectors. These are true unit basis vectors, defined at all points in the field. Theoretically, these vectors are functions of position, but here in Maple, they are simply symbols that do not actually carry with them any information about the point at which they sit.

Back to Student Portal Details

Complex arithmetic

Example 10.1 - How Do I Enter a Complex Number?

 

Feature

Description

Illustration

Enter Complex Number

In Maple, the default representation of the imaginary unit i&equals;1 is I.

 

To enter the imaginary unit in Maple, click on one of the symbols , ȷ, or I from the Common Symbols palette, found on the left-hand side of the Maple window. Typing the letter I is equivalent to selecting it from this palette

 

Shown at the right are a few examples of complex numbers.

 

Note that simply typing i will not produce the imaginary unit, but typing I will.

 

Also, the imaginary unit i&equals;1 is displayed with a capital I, no matter which symbol was used for input.

 

 

  3&plus;553 = 34

3&plus;4 = 4&plus;3I

Typing i is not recognized as the imaginary unit.

3i&plus;443i = 3i&plus;443i

3ȷ&plus;553ȷ = 34

3 ȷ&plus;5 = 5&plus;3I

3I&plus;5 = 5&plus;3I 

Change

Symbol

To change the symbol used for the imaginary unit, (both for input and output), use the interface command as shown to the right. This command sets j to be the imaginary unit. Thereafter, clicking on i, j, or I in the Common Symbols palette, or typing the letter j&comma;will produce the imaginary unit, and its symbol will be ȷ.

 

 

interfaceimaginaryunit&equals;j&colon;

 

From the palette:

ȷ2 = 1

 

By typing:

j2 = 1 

 

In computations:

1&plus;2jj = 2&plus;ȷ

Command

The Complex command may also be used to enter complex numbers.

Complex5&comma;2 = 5&plus;2I

Back to Student Portal Details

ODEs

Example 11.1 - How Do I Enter an Ordinary Differential Equation?

 

Method

Description

Illustration

Palettes

To enter an ordinary differential equation in Math mode, type it as you would write it. The prime symbol can be entered using the Common Symbols palette or by typing an apostrophe, [']. Higher-order derivatives can be entered with multiple apostrophes, or by using the symbols in the Punctuation palette. (If you cannot see this palette, open it by selecting View → Palettes → Show Palette → Punctuation.)

 

By default, primes indicate differentiation with respect to x.

 

Maple also recognizes higher derivatives expressed with exponents in parentheses: f5x is interpreted as the fifth derivative of f with respect to x.

 

  

y&apos;&plus;y&apos;&apos;&equals;2 x

&DifferentialD;&DifferentialD;xyx+&DifferentialD;2&DifferentialD;x2yx=2x

prime

versus

dot

Differential equations can also be entered by using dot notation. This can be done in two ways:

 

First, type the variable and then press Ctrl+Shift+". This will raise the cursor above the variable. Type a period [&period;] above the variable name to indicate the derivative. Two dots indicate the second derivative.

 

The second method of writing differential equations using dot notation is to use the Layout palette. This palette is located on the left-hand side of the Maple window. If you cannot see this palette, select View → Palettes → Show Palette → Layout.

 

Click on the indicated template and replace A with the desired variable and b with a period. Several periods can be placed over the variable.

 

By default, dot notation indicates differentiation with respect to t. 

→    →

 

 

 →  →

 

y&period;&plus;y..&plus;y&equals;5

&DifferentialD;&DifferentialD;tyt+&DifferentialD;2&DifferentialD;t2yt+yt=5

Output

The output display of a differential equation can be modified. This is done by changing the Typesetting settings.

 

 

 

 

 

 

By executing the command TypesettingSettingstypesetprime&equals;true&comma;typesetdot&equals;true prime notation and dot notation are displayed in the output in place of the &DifferentialD;&DifferentialD; x and &DifferentialD;&DifferentialD; t notation, respectively.

 

 

 

 

The command Typesetting[Suppress] can be used to suppress the functional dependency from being displayed in the output.

 

For example, the command TypesettingSuppressyt&colon;

suppresses t from being displayed in the output.

 

These settings can also be accessed through the Typesetting Rules Assistant (View → Typesetting Rules) under the heading Differential Options.

y&apos;&plus;y&apos;&apos;&equals;2 x

&DifferentialD;&DifferentialD;xyx&plus;&DifferentialD;2&DifferentialD;x2yx&equals;2x

y&period;&plus;y..&plus;y&equals;5

&DifferentialD;&DifferentialD;tyt&plus;&DifferentialD;2&DifferentialD;t2yt&plus;yt&equals;5

TypesettingSettingstypesetprime&equals;true&comma;typesetdot&equals;true&colon;

y&apos;&plus;y&apos;&apos;&equals;2 x

yx+yx=2x

y&period;&plus;y..&plus;y&equals;5

y.t+y..t+yt=5

TypesettingSuppressyt&colon;

y&period;&plus;y..&plus;y&equals;5

y.+y..+y=5

Options

As indicated in the above examples, y assumes differentiation with respect to x, while y&period; assumes differentiation with respect to t. This is the Maple default for the prime and dot notation. This can also be customized using either the Typesetting[Settings] command or the Typesetting Rule Assistant (View → Typesetting Rules).

 

 

Maple Input Mode

To enter differential equations in Maple Input mode, use the command diff.

 

The diff command diff(y(t),t) is equivalent to &DifferentialD;&DifferentialD;tyt.

diff(y(t),t,t)+diff(y(t),t)+5*y(t)=7;

y..+y.+5y=7

&DifferentialD;2&DifferentialD;t2yt&plus;&DifferentialD;&DifferentialD;tyt&plus;5yt&equals;7

Back to Student Portal Details

Example 11.2 - How Do I Solve an ODE Numerically?

 

Method

Description

Illustration

1

Enter the ODE and its initial condition. Use any of of the methods described in Example 11.1 to enter the ODE.

 

odey&period;&equals;1y910&comma;y0&equals;9991000

odey.t=1yt910&comma;y0=9991000

2

Use the dsolve command with option numeric to obtain the solution.

 

Obtain the numerical value of the solution for a specific value of t.

 

 

 

 

 

 

 

To plot the solution use the command plots[odeplot].

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

odeSolutiondsolveode&comma;numeric&colon;

odeSolution1

t=1.&comma;yt=0.249396208864589

odeSolution2

t=2.&comma;yt=0.746621871835948

plotsodeplotodeSolution&comma;0..6

Back to Student Portal Details

Linear algebra

Example 12.1 - How Do I Obtain the Dot Product of Two Vectors?

        

Step

Method

Description

Illustration

1

Command

In Maple, a vector can be constructed by a comma-separated n-tuple of numbers within a pair of angle brackets:  

  

Palette

 

A vector can also be defined by using the Matrix palette. To insert a vector from the Matrix palette, either the number of rows or the number of columns must be equal to one. This will produce a row vector or a column vector, respectively.

 

You can choose the dimensions of the vector (or matrix) by either entering dimension in the Rows and Columns boxes or by clicking Choose and dynamically sizing the vector (or matrix) using the mouse.

 

Click the Insert Vector[column] button to insert the vector into the document or worksheet. By clicking the arrow on this button, you can choose to insert a matrix or a vector. Note: this option is only available if the matrix is a single column or row.

 

Overwrite the fields as needed. Press Tab to move to the next placeholder, and Shift+Tab to move to the previous placeholder.

 

  →  362

2

Command Completion

The dot product can be calculated by using Command Completion. After typing or inserting the first vector, type dot and the access the Command Completion list (by pressing Esc). Select dotproduct. Then type the second vector. 

  3&comma;4&comma;5·2&comma;3&comma;4     362·123

dot

The dot product can also be calculated by using the centered dot (·) from the Common Symbols palette.

 

3&comma;4&comma;5·2&comma;3&comma;4 = −2

3

Evaluate

Press [Enter] to evaluate the dot product on a new line, and press Ctrl+= (Command+= in Macintosh) to evaluate it inline.

  3&comma;4&comma;5&period;2&comma;3&comma;4

2

362·123 = 21 

Maple Input

To calculate the dot product in Maple Input mode, enter a period between the vectors.

<3,4>.<-1,1>;

1

<3,2,-1>.<-2,3,0>;

0

Back to Student Portal Details

Example 12.2 - How Do I Calculate the Norm of a Vector?

 

Step

Method

Description

Illustration

1

First, load the Student[LinearAlgebra] package (Tools → Load Package → Student Linear Algebra).

Loading Student:-LinearAlgebra

 

 

2

Context Menu

From the Context Panel for an existing vector, select Norm.

 

Command Completion or Palette

The Norm notation for a vector can be obtained by using Command Completion. Start by typing Norm, and then access the Command Completion list (by pressing [Esc]) and choose the first item, Norm, with double bars around the placeholder x.

 

The Norm notation can also be found in the Layout Palette. (If this palette is not visible, select View → Palettes → Show Palette → Layout.)

 

 

 →   

 →

3

 

 

 

 

 

 

Replace the placeholder x (or A) with a vector. To enter a vector in Maple, see step 1 of Example 12.1.

 

Press [Enter] to display the value of the Norm on a new line, or [Ctrl][=] ([Command][=], Macintosh) to display the value inline.

      34 = 5

 

Commands

The norm can also be constructed by typing two vertical strokes in succession both before and after the object whose norm is to be computed.

 1&comma;2&comma;3 = 14  

Maple Input

To calculate the Norm of a vector in Maple Input mode, use the command Norm. An example of this is shown to the right.

 

This command can also be used in Math mode.

Norm3&comma;4 = 5

Note

Typing lower case norm will not display the same Command Completion list as Norm.

 

norm and Norm are in fact two distinct commands in Maple.

Back to Student Portal Details

Example 12.3 - How Do I Calculate the Cross-Product of Two Vectors?

 

Step

Description

Illustration

1

In Math mode, the cross-product of two vectors can be calculated using the cross operator (×&rpar; from either the Common Symbols palette or the Operators palette.

   

2

Enter the two vectors in any format, with the cross operator between them.

362×123 = 14−70           2&comma;3&comma;1×4&comma;2&comma;5 = 17−14−8

Maple Input Mode

In Maple Input mode, first load the Student[LinearAlgebra] package. Then you can use the symbol &x as the cross-product operator.

 

Note that in the example to the right &x has no meaning outside of the package.

<2,3,-1>&x<4,2,5>;

23−1&x425

 

Loading Student:-LinearAlgebra

<2,3,-1>&x<4,2,5>;

Back to Student Portal Details

Example 12.4 - How Do I Calculate the Determinant of a Matrix?

 

Methods

Description

Illustration

Context Menu

For an existing square matrix, apply the Context Panel item: Standard Operations → Determinant.

Palette

Alternatively, click on the absolute-value template from the Layout palette (if this palette is not visible, select View → Palettes → Show Palette → Layout).

 

Replace the A inside the vertical lines with the desired matrix or with a reference to it (to enter a matrix in Maple, use the Matrix palette shown in step 1 of Example 12.1).

 

To obtain notation that looks more traditional, the brackets on the matrix can be deleted without affecting the result.

   →

2358

2358

 

Press Enter or Ctrl+= (Command+= in Macintosh) to evaluate the determinant.

      2358 = 1 

Note

Note that double vertical bars on both sides will calculate the norm of the matrix and not the determinant. 

2358 = 13 

Back to Student Portal Details

Example 12.5 - How Do I Obtain the Transpose of a Matrix?

 

Methods

Description

Illustration

Context Menu

For an existing matrix, apply the Context Panel item:

Standard Operations → Transpose.

Command

Alternatively, enter the desired matrix into your worksheet (to enter a matrix in Maple, use the Matrix palette shown in step 1 of Example 12.1).

 

Press Shift+^ to raise the cursor to the superscript position. Then type %T.

 →  →

 

Press Enter or Ctrl+= (Command+= in Macintosh) to evaluate and display the transpose of the matrix.

1234%T = 1324

Hermitian Transpose

The Hermitian transpose of a matrix with complex entries can be obtained by typing %H instead of %T. 

 

 

52I3&plus;I14I36I%H =  

Back to Student Portal Details

Example 12.6 - How Do I Perform Augmentation or Stacking Operations on Matrices and Vectors?

 

For this example, define the following matrices and vectors.

 

Matrix A

Matrix B

Matrix C

Vector a

Vector b

A  1482

B1357911

C B%T

a3&comma;3&comma;3

b  555

 

Stacking Matrices and Vectors

 

The command p&comma;q stacks the first matrix or vector, p, on top of the second matrix or vector, q. See the examples below.

 

A&comma;C

C&comma;A

b&comma;B

B&comma;b

A&comma;C&comma;A

A&comma;B

Error, (in Matrix) this entry is too wide or too narrow: Matrix(2, 3, {(1, 1) = 1, (1, 2) = 3, (1, 3) = 5, (2, 1) = 7, (2, 2) = 9, (2, 3) = 11})

 

As expected, only matrices and vectors that have the same number of columns can be stacked on top of one another.

Augmenting Matrices and Vectors

 

The command p&verbar;q augments the first matrix or vector, p, with the second matrix or vector, q, by placing it on the right. Multiple augmentation or stacking is possible. See the examples below.

 

A&verbar;B

B&verbar;A

C&verbar;a

a&verbar;C&verbar;a

 C&verbar;a&verbar;C&comma;  A&verbar;B 

A&verbar;C

Error, (in Matrix) this entry is too tall or too short: Matrix(3, 2, {(1, 1) = 1, (1, 2) = 7, (2, 1) = 3, (2, 2) = 9, (3, 1) = 5, (3, 2) = 11})

 

As expected, only matrices and vectors that have the same number of rows can be augmented together.

Solving the Linear System Ax&equals;y

 

Given the matrix     A3213 and the vector y85, find the solution to the linear system Ax&equals;y.

Step

Description

Illustration

1

Form the augmented matrix A&comma;y as shown in the previous example.

A&verbar;y =

2

Apply the Context Panel item:

Solvers and Forms → Row-Echelon Form.

reduced row-echelon form

 

fraction-free elimination

 

row-echelon elimination

 

3

The solution, x, is the right-most column of the reduced row echelon form. This can be read from the matrix itself.

 

Alternatively, the solution can be displayed directly by applying the Context Panel item Select Elements → Restrict Columns, and enter the index of the last column, in this case, 3.

restrict columns

Back to Student Portal Details

Example 12.7 - How Do I Implement Gaussian Elimination by Using the Tutor?

 

Use the Gaussian Elimination Tutor to solve a linear system Ax&equals;y&comma; where A is 1379, and y is 511.

Step

Description

Illustration

1

Start by augmenting the matrix as shown in the example above.

A1379&colon;y511&colon;

A&verbar;y =

2

Next, load the Student[LinearAlgebra] package (Tools → Load Package → Student Linear Algebra).

Loading Student:-LinearAlgebra

3

To access the Tutor, from the Context Panel for the output, select: Student Linear Algebra → Tutor → Linear System Solving.

 

A dialog appears where you can choose the method of solving. Choose Gaussian Elimination.

 

Note that the matrix is automatically entered into the tutor.

 

4

The Edit Matrix button allows you to edit the matrix through the Matrix Builder.

 

The matrix and the equations it represents are viewable in both matrix and variable form.

 

The check box Augmented is selected by default. For an augmented matrix, a vertical line is drawn between A and y in the matrix, and the Variables view pane shows the nonhomogeneous equations.

 

You can change the dimensions of the array by clicking the drop-down boxes under Rows and Columns. Select Square to automatically convert the matrix to a square matrix, adding rows of zeros, if needed.

 

Click Display to redraw the Matrix and Variables views with the applied changes. Click Close to export the new matrix back to the Gaussian Elimination Tutor.

 

 

 

 

5

Gaussian elimination can be performed manually on the matrix by clicking on any of the row operation buttons shown on the right.

 

Click Undo to remove the last step performed. Click Next Step to perform and display one Gaussian elimination step. Click All Steps to display all steps to the final step of the Gaussian elimination.

 

After the matrix has been reduced to row echelon form, go to Step 6.

 

 

 

6

To complete the solution by back substitution, click the Solve System button. If the matrix has not been reduced to row echelon form an error displays.

 

    If the augmented matrix is in row echelon form, another window will open.

 

Click the buttons Equations, Solve x[2], Solve x[1], and Solution, in that order, to manually implement back substitution and display the solution to the linear system.

 

Click the Change the matrix button to launch the Matrix Builder.

 

7

Click Cancel to close the Tutor and output nothing.

 

Click Close to close the Tutor and output a column matrix that represents the solution to the system.

1357911linear solve tutor

Back to Student Portal Details

Example 12.8 - How Do I Use the Matrix Inverse Tutor?

 

Step

Description

Illustration

1

To begin, load the Student Linear Algebra package (Tools → Load Package → Student Linear Algebra).

    Loading Student:-LinearAlgebra

2

For any square matrix, apply the Context Panel item Student Linear Algebra → Tutors → Matrix Inverse.

 

Note that Tutors will not appear in the Context Menu unless the Student Linear Algebra package is loaded.

 

 

 

 

 

Notice that the matrix is automatically entered into the tutor and augmented with the identity matrix.

 

3

Reduce the matrix to the identity manually by clicking on any of the row operation buttons shown on the right.

 

4

Click Undo to remove the last step performed. Click Next Step to display one additional reduction step. Click All Steps to complete the reduction and show the inverse.

 

Click Edit Matrix to change the matrix to be reduced. This button opens the Matrix Builder assistant.

 

Click Help in the Tutor's task bar to give a more thorough explanation of all the functions in the Tutor.

5

Click Return the Inverse to close the tutor and display the inverse in your document.

 

Click Close to cancel the tutor.

Back to Student Portal Details

Numerical analysis

Example 13.1 - How Do I Approximate the Roots of an Expression Using Newton's Method?

 

Steps

Description

Illustration

1

First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).

Loading Student:-NumericalAnalysis

2

Enter the expression.

 

f &ExponentialE;x&plus;cosx1

f&ExponentialE;x+cosx1

3

Use the Newton command with the initial approximation and the option tolerance to obtain the solution.

 

This solution is accurate to within 105.

 

 

 

To see a plot of this application of Newton's method, use the option output=plot.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Newtonf&comma;x&equals; 1&comma;tolerance&equals;105

−0.9626326373

Newtonf&comma;x&equals; 1&comma;tolerance&equals;105&comma;output&equals;plot

Back to Student Portal Details

Example 13.2 - How Do I Approximate the Roots of an Expression Using a Specific Method?

 

Steps

Description

Illustration

1

First, load the Student[NumericalAnalysis] package (Tools → Load Package → Student Numerical Analysis).

Loading Student:-NumericalAnalysis

2

Enter the expression.

 

f x318 x2cosx

fx318x2cosx

3

Use the Roots command with the initial approximation(s) and the method option to obtain the solution.

 

Here, we use the secant method, which requires a pair of initial approximates.

 

 

To see a plot of this application of the secant method, use the option output=plot.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Rootsf&comma;x&equals;15&comma;20&comma;method&equals;secant

18.00204199

Rootsf&comma;x&equals;15&comma;20&comma;method&equals;secant&comma;output&equals;plot

Back to Student Portal Details

Example 13.3 - How Do I Find the Interpolating Polynomial?

 

Method

Description

Illustration

Given data points xi&comma;yi

First, load the Student[NumericalAnalysis] package (