Contents Previous Next Index
5 Mathematical Problem Solving
This chapter focuses on solving problems in specific mathematical disciplines. The areas described below are not all that Maple provides, but represent the most commonly used packages. Examples are provided to teach you how to use the different methods of calculation available in Maple, including tutors, assistants, commands, task templates, plotting, and context-sensitive operations.
The examples in this chapter assume knowledge of entering commands and mathematical symbols. For information, see Entering Expressions. For information on basic computations, including integer operations and solving equations, see Basic Computations.
5.1 In This Chapter
Section
Topics
Algebra - Performing algebra computations
Polynomial Algebra
Linear Algebra - Performing linear algebra computations
Creating Matrices and Vectors
Accessing Entries in Matrices and Vectors
Linear Algebra Computations
Student LinearAlgebra Package
Calculus - Performing calculus computations
Limits
Differentiation
Series
Integration
Differential Equations
Calculus Packages
Optimization - Performing optimization computations using the Optimization package
Point-and-Click Interface
Efficient Computation
MPS(X) File Support
Statistics - Performing statistics computations using the Statistics package
Probability Distributions and Random Variables
Statistical Computations
Plotting
Teaching and Learning with Maple - Student and Instructor resources for using Maple in an academic setting
Student Packages and Tutors
Study Guides
Step by Step Solutions
More Student and Instructor Resources
Clickable MathTM - Solve math problems using some of the interactive methods available in Maple
Step-by-Step examples
5.2 Algebra
Maple contains a variety of commands that perform integer operations, such as factoring and modular arithmetic, as described in Integer Operations. The following section describes Maple's support of polynomial algebra.
For information on matrix and vector algebra, see Linear Algebra.
For information directed to students of algebra or precalculus, see Teaching and Learning with Maple.
A Maple polynomial is an expression in powers of an unknown. Univariate polynomials are polynomials in one unknown, for example, x3⁢−⁢2x⁢+⁢13. Multivariate polynomials are polynomials in multiple unknowns, such as x3 y − 32⁢x y2⁢+⁢7 x.
The coefficients can be integers, rational numbers, irrational numbers, floating-point numbers, complex numbers, variables, or a combination of these types.
a⁢x2⁢+⁢7x⁢−⁢b2
a⁢x2+7⁢x−12⁢b
Arithmetic
The polynomial arithmetic operators are the standard Maple arithmetic operators excluding the division operator (/). (The division operator accepts polynomial arguments, but does not perform polynomial division.)
Polynomial division is an important operation. The quo and rem commands find the quotient and remainder of a polynomial division. See Table 5.1. (The iquo and irem commands find the quotient and remainder of an integer division. For more information, see Integer Operations.)
Operation
Operator
Example
Addition
+
x2⁢+⁢1⁢+⁢3⁢x3⁢−⁢5⁢x⁢+⁢2
3⁢x3+x2−5⁢x+3
Subtraction
−
x2⁢+⁢1⁢−⁢3⁢x3⁢−⁢5⁢x⁢+⁢2
−3⁢x3+x2+5⁢x−1
Multiplication1
*
x2⁢+⁢1⋅3⁢x3⁢−⁢5⁢x⁢+⁢2
x2+1⁢3⁢x3−5⁢x+2
Division: Quotient and Remainder
quo
rem
quo⁡2⁢x2⁢+⁢x⁢−⁢3,⁢3⁢x⁢+⁢5,⁢x
2⁢x3−79
rem⁡2⁢x2⁢+⁢x⁢−⁢3,⁢3⁢x⁢+⁢5,⁢x
89
Exponentiation2
^
x2⁢+⁢13
x2+13
1You can specify multiplication explicitly by entering *, which displays in 2-D Math as ⋅. In 2-D Math, you can also implicitly multiply by placing a space character between two expressions. In some cases, the space character is optional. For example, Maple interprets a number followed by a name as an implicit multiplication.
2In 2-D Math, exponents display as superscripts.
To expand a polynomial, use the expand command.
expand⁡3⁢x2⋅3⁢x+5−x2−2
9⁢x3+14⁢x2+2
If you need to determine whether one polynomial divides another, but do not need the quotient, use the divide command. The divide command tests for exact polynomial division.
divide⁡x4y2+x3y2−x2⁢y2+13⁢x2+13⁢x−13+y⋅x2+x⋅y−y,⁢x2+x−1
true
Important: You must insert a space character or a multiplication operator (⋅) between adjacent variables names. Otherwise, they are interpreted as a single variable.
For example, without a space, xy is considered a single variable, and x does not divide the single variable xy.
divide⁡xy,⁢x
false
But, x divides the product of x and y.
divide⁡x⁢y,⁢x;⁢divide⁡x⋅y,⁢x
For information on polynomial arithmetic over finite rings and fields, refer to the mod help page.
Sorting Terms
To sort the terms of a polynomial, use the sort command.
p1≔x2+x4+x3−x:
sort⁡p1
x4+x3+x2−x
Note: The sort command returns the sorted polynomial, and updates the order of the terms in the polynomial.
The terms of p1 are sorted.
p1
To specify the unknowns of the polynomial and their ordering, include a list of names.
sort⁡a2x3+x2+x a+a+b,⁢a
x3⁢a2+x⁢a+a+x2+b
sort⁡a2x3+x2+x a+a+b,⁢x,⁢b
a2⁢x3+x2+a⁢x+b+a
By default, the sort command sorts a polynomial by decreasing total degree of the terms.
p2:=x3+y3+x2y2:
sort⁡p2,⁢x,⁢y
x2⁢y2+x3+y3
The first term has total degree 4. The other two terms have total degree 3. The order of the final two terms is determined by the order of their names in the list.
To sort the terms by pure lexicographic order, that is, first by decreasing order of the first unknown in the list option, and then by decreasing order of the next unknown in the list option, specify the 'plex' option.
sort⁡p2,⁢x,⁢y,⁢'plex'
x3+x2⁢y2+y3
For information on enclosing keywords in right single quotes ('), see Delaying Evaluation.
The first term contains x to the power 3; the second, x to the power 2; and the third, x to the power 0.
Using context-sensitive operations, you can perform operations, such as sorting, for polynomials and many other Maple objects.
To sort a polynomial:
Select the polynomial.
From the Context Panel, under the Sorts menu, select:
Single-variable, and then the unknown, or,
Two-variable (or Three-variable), Pure Lexical or Total Degree, and then the sort priority of the unknowns.
See Figure 5.1.
Figure 5.1: Sorting a Polynomial Using the Context Panel
Maple sorts the polynomial.
In Worksheet mode, Maple inserts the calling sequence that performs the sort followed by the sorted polynomial. For this example, choose Sorts > Two-variable > Pure Lexical > y,x.
x3⁢+⁢y3⁢+⁢x2y2
sort( y^3+y^2*x^2+x^3, [y, x], 'plex' )
y3+y2⁢x2+x3
You can use the Context Panel to perform context-sensitive operations on 2-D Math content including output. For more information, see Computing with the Context Panel (for Document mode) or The Context Panel (for Worksheet mode).
Collecting Terms
To collect the terms of polynomial, use the collect command.
collect⁡2⁢a⁢x⁢y⁢+⁢c⁢x2⁢y⁢−⁢z⁢y2⁢+⁢a⁢z⁢−⁢13⁢b⁢y⁢+⁢3⁢y2x,⁢y
−z+3x⁢y2+c⁢x2+2⁢a⁢x−13⁢b⁢y+a⁢z
Coefficients and Degrees
Maple has several commands that return coefficient and degree values for a polynomial. See Table 5.2.
Command
Description
coeff
Coefficient of specified degree term
coeff⁡(12x3−2⁢x+5,⁢x3)
12
lcoeff
Leading coefficient
lcoeff⁡12x3−2⁢x+5
tcoeff
Trailing coefficient
tcoeff⁡12x3−2⁢x+5
5
coeffs
Sequence of all coefficients, in one-to-one correspondence with the terms
Note: It does not return zero coefficients
coeffs⁡12x3−2⁢x+5
5,−2,12
degree
(Highest) degree
degree⁡12x3−2⁢x+5
3
ldegree
Lowest degree term with a non-zero coefficient
ldegree⁡12x3−2⁢x
1
Factorization
To express a polynomial in fully factored form, use the factor command.
factor⁡x4−1
x−1⁢x+1⁢x2+1
The factor command factors the polynomial over the ring implied by the coefficients, for example, integers. You can specify an algebraic number field over which to factor the polynomial. For more information, refer to the factor help page. (The ifactor command factors an integer. For more information, see Integer Operations.)
To solve for the roots of a polynomial, use the solve command. For information on the solve command, see Solving Equations and Inequations. (The isolve command solves an equation for integer solutions. For more information, see Integer Equations.)
Other Commands
Table 5.3 lists other commands available for polynomial operations.
content
Content (multivariate polynomial)
compoly
Decomposition
discrim
Discriminant
gcd
Greatest common divisor (of two polynomials)
gcdex
Extended Euclidean algorithm (for two polynomials)
CurveFitting[PolynomialInterpolation]
See also the CurveFitting Assistant (Tools → Tutors → Statistics → Curve Fitting)
Interpolating polynomial (for list of points)
lcm
Least common multiple (of two polynomials)
norm
Norm
prem
Pseudo-remainder (of two multivariate polynomials)
primpart
Primitive part (multivariate polynomial)
randpoly
Random polynomial
PolynomialTools[IsSelfReciprocal]
Determine whether self-reciprocal
resultant
Resultant (of two polynomials)
roots
Exact roots (over algebraic number field)
sqrfree
Square-free factorization (multivariate polynomial)
Additional Information
Topic
Resource
General polynomial information
polynom help page
PolynomialTools package
PolynomialTools package overview help page
Algebraic manipulation of numeric polynomials
SNAP (Symbolic-Numeric Algorithms for Polynomials) package overview help page
Polynomial information and commands
Maple Help System Table of Contents: Mathematics→Algebra→Polynomials section
5.3 Linear Algebra
Linear algebra operations act on Matrix and Vector data structures.
You can perform many linear algebra operations using task templates. In the Task Browser (Tools → Tasks → Browse), expand the Linear Algebra folder.
Creating Matrices
You can create a Matrix using
The Matrix command
The angle bracket shortcut notation
The Matrix palette (see Figure 5.2).
When creating a Matrix using the Matrix command, there are several input formats available. For example, enter a list of lists. The dimensions of the matrix are inferred from the number of entries given.
Matrix1,π,0,ⅇ2,sint,872,0,0,5ⅇ
Alternatively, use the angle bracket shortcut, <>. Separate items in a column with commas, and separate columns with vertical bars, |.
1,π,0|ⅇ2,sint,872|0,0,5ⅇ
For information on the Matrix command options, see Creating Matrices and Vectors with Specific Properties.
Use the Matrix palette to interactively create a matrix without commands:
Figure 5.2: Matrix Palette
In the Matrix palette, you can specify the matrix size (see Figure 5.3) and properties. To insert a matrix, click the Insert Matrix button.
Figure 5.3: Matrix Palette: Choosing the Size
After inserting the matrix:
Enter the values of the entries. To move to the next entry placeholder, press Tab.
After specifying all entries, press Enter.
1ⅇ20πsin⁡t008725ⅇ:
Creating Vectors
You can create a Vector using angle brackets (< >).
To create a column vector, specify a comma-delimited sequence, <a, b, c>. The number of elements is inferred from the number of expressions.
1,⁢2,⁢3
To create a row vector, specify a vertical-bar-delimited (|) sequence, <a | b | c>. The number of elements is inferred from the number of expressions.
1⁢⁢2⁢⁢3
For information on the Vector command options, refer to the Vector help page.
You can also create vectors using the Matrix palette. If either the number of rows or number of columns specified is 1, then you have the option of inserting a matrix, or inserting a vector of the appropriate type. See Figure 5.4.
Figure 5.4: Insert Matrix or Insert Vector
Viewing Large Matrices and Vectors
Matrices 10×10 and smaller, and vectors with 10 or fewer elements, display in the document. For larger matrices or vectors, a portion is shown inline.
For example, insert a 30×30 matrix.
In the Matrix palette:
Specify the dimensions: 30 rows and 30 columns.
In the Type drop-down list, select a matrix type, for example, Random.
Click Insert Matrix. The command is inserted; execute it to see the result.
LinearAlgebra:-RandomMatrix⁡30,30
Note the output shows ellipses indicating the data continues and the output is scrollable meaning that you can explore the values directly within the worksheet, using your trackpad or mouse wheel.To view the entire matrix or vector, double-click the summary placeholder. This launches the Matrix Browser. See Figure 5.5.
Figure 5.5: Matrix Browser
To modify the entries using the Matrix Browser:
Select the Table tab.
Double-click an entry, and then edit its value. Press Enter.
Repeat for each entry to edit.
When you have finished updating entries, click Done.
You can view the matrix or vector as a table or as an image, which can be inserted into the document.
To set the maximum dimension of matrices and vectors displayed inline:
Use the interface command with the rtablesize option.
For example, interface(rtablesize = 15).
For more information, refer to the interface help page.
Creating Matrices and Vectors with Specific Properties
By default, matrices and vectors can store any values. To increase the efficiency of linear algebra computations, create matrices and vectors with properties. You must specify the properties, for example, the matrix shape or data type, when defining the object.
The Matrix palette (Figure 5.2) supports several properties.
To specify the matrix type:
Use the Shape and Type drop-down lists.
To specify the data type:
Use the Data type drop-down list.
For example, define a diagonal matrix with small integer coefficients.
Specify the size of the matrix, for example, 3×3.
In the Shapes drop-down list, select Diagonal.
In the Data type drop-down list, select integer[1].
Click the Insert Matrix button.
Enter the values in the diagonal entries.
[−230001700032]:
You cannot specify properties when defining vectors using the angle-bracket notation. You must use the Vector constructor.
To define a column vector using the Vector constructor, specify:
The number of elements. If you explicitly specify all element values, this argument is not required.
A list of expressions that define the element values.
Parameters such as shape, datatype, and fill that set properties of the vector.
The following two calling sequences are equivalent.
Vector⁡0,⁢0,⁢0
Vector⁡3,⁢'shape'⁢=⁢'zero'
To create a row vector using the Vector constructor, include row as an index.
Vectorrow3,'fill'=1
Vectorrow127,⁢0,⁢34,⁢'datatype'⁢=⁢'integer1'
The Matrix palette does not support some properties. To set all properties, use the Matrix constructor.
To define a matrix using the Matrix constructor, specify:
The number of rows and columns. If you explicitly specify all element values, these arguments are not required.
A list of lists that define the element values row-wise.
Parameters such as shape, datatype, and fill that set properties of the matrix.
For example:
Matrix⁡1,⁢2,⁢3,⁢4,⁢5,⁢6
The Matrix palette cannot fill the matrix with an arbitrary value. Use the fill parameter.
Matrix⁡3,⁢4,⁢1,⁢2,⁢3,⁢4,⁢5,⁢6,⁢'fill'⁢=⁢2⁢+⁢⁢ⅈ
For more information on the constructors, including other calling sequence syntaxes and parameters, refer to the storage, Matrix, and Vector help pages.
See also Numeric Computations.
Matrices
To select an entry in a Matrix, enter the matrix name with a sequence of two non-zero integer indices, row first.
M≔−4.3,−6.7,1.9|2.9,−1.2,9.6|9.3,−8.0,−9.2
M≔
M1,3
9.3
To select an entire row, enter a single index; to select an entire column, enter first the entire range of rows, 1..−1,then the column index.
M2
M1..−1,1
Similarly, you can access submatrices. Enter the indices as a list or range.
M2..3,1..2
Vectors
To select an entry in a vector, enter the vector name with a non-zero integer index.
a⁢:=⁢<85.3,⁢47.1,⁢59.9,⁢38.1>
a≔
a1
85.3
Negative integers select entries from the end of the vector.
a−1
38.1
To create a Vector consisting of multiple entries, specify a list or range of integers in the index.
a1,⁢2
a2..4
Maple has extensive support for linear algebra. You can perform many matrix and vector computations using context-sensitive operations. Matrix operations such as multiplication and inverses can be done with the basic matrix arithmetic operators. The LinearAlgebra package provides the full range of Maple commands for linear algebra and vector space computations, queries, and linear system solving.
Matrix Arithmetic
The matrix and vector arithmetic operators are the standard Maple arithmetic operators up to the following two differences.
The scalar multiplication operator is the asterisk (*), which displays in 2-D Math as ⋅. The noncommutative matrix and vector multiplication operator is the period (.).
There is no division operator (/) for matrix algebra. (You can construct the inverse of a matrix using the exponent −1.)
Table 5.5 lists the basic matrix operators.
A≔93431937: B≔48201937:C≔23,6:
A+B
A−B
Multiplication
.
A.C
Scalar Multiplication1
12 A
4⋅C
A3
B−1
1You can specify scalar multiplication explicitly by entering *, which displays in 2-D Math as ⋅. In 2-D Math, you can also implicitly multiply a scalar and a matrix or vector by placing a space character between them. In some cases, the space character is optional. For example, Maple interprets a number followed by a name as an implicit multiplication.
A few additional matrix and vector operators are listed in Table 5.6.
Define two column vectors.
d⁢:=⁢<1,⁢2,⁢3>:⁢e⁢:=⁢<4,⁢5,⁢6>:
Transpose
^%T1
d%T
Hermitian Transpose
^%H1
[ⅈ−2⁢ⅈ3⁢+⁢4⁢ⅈ2⁢−⁢ⅈ]%H
Cross Product
(3-D vectors only)
&x2
with⁡LinearAlgebra:
d⁢&x⁢e
1Exponential operators display in 2-D Math as superscripts.
2After loading the LinearAlgebra package, the cross product operator is available as the infix operator &x . Otherwise, it is available as the LinearAlgebra[CrossProduct] command.
For information on matrix arithmetic over finite rings and fields, refer to the mod help page.
Point-and-Click Interaction
Using the Context Panel, you can perform many matrix and vector operations.
Matrix operations available in the Context Panel include the following.
Perform standard operations: determinant, inverse, norm (1, Euclidean, infinity, or Frobenius), transpose, and trace
Compute eigenvalues, eigenvectors, and singular values
Compute the dimension or rank
Convert to the Jordan form, or other forms
Perform Cholesky decomposition and other decompositions
For example, compute the infinity norm of a matrix. See Figure 5.6.
Figure 5.6: Computing the Infinity Norm of a Matrix
In Document mode, Maple inserts a right arrow and the name of the computation performed, followed by the norm.
18735.6985349723.2349879859.459798124.14089→infinity-norm807983.5999
Vector operations available in the Context Panel include the following.
Compute the dimension
Compute the norm (1, Euclidean, and infinity)
Compute the transpose
Select an element
For more information on context-sensitive operations, see Computing with the Context Panel (for Document mode) or The Context Panel (for Worksheet mode).
LinearAlgebra Package Commands
The LinearAlgebra package contains commands that construct and manipulate matrices and vectors, compute standard operations, perform queries, and solve linear algebra problems.
Table 5.7 lists some LinearAlgebra package commands. For a complete list, refer to the LinearAlgebra/Details help page.
Basis
Return a basis for a vector space
CrossProduct
Compute the cross product of two vectors
DeleteRow
Delete a row or rows of a matrix
Dimension
Determine the dimension of a matrix or a vector
Eigenvalues
Compute the eigenvalues of a matrix
Eigenvectors
Compute the eigenvectors of a matrix
FrobeniusForm
Reduce a matrix to Frobenius form
GaussianElimination
Perform Gaussian elimination on a matrix
HessenbergForm
Reduce a square matrix to Hessenberg form
HilbertMatrix
Construct a generalized Hilbert matrix
IsOrthogonal
Test if a matrix is orthogonal
LeastSquares
Compute the least-squares approximation to A . x = b
LinearSolve
Solve the linear system A . x = b
MatrixInverse
Compute the inverse of a square matrix or pseudo-inverse of a non-square matrix
QRDecomposition
Compute the QR factorization of a matrix
RandomMatrix
Construct a random matrix
SylvesterMatrix
Construct the Sylvester matrix of two polynomials
For information on arithmetic operations, see Matrix Arithmetic.
For information on selecting entries, subvectors, and submatrices, see Accessing Entries in Matrices and Vectors.
Example: Determine a basis for the space spanned by the set of vectors {(2, 13, -15), (7, -2, 13), (5, -4, 9)}. Express the vector (25, -4, 9) with respect to this basis.
v1⁢:=⁢<2,⁢13,⁢−15>:⁢v2⁢:=⁢<7,⁢−2,⁢13>:⁢v3⁢:=⁢<5,⁢−4,⁢9>:
Find a basis for the vector space spanned by these vectors, and then construct a matrix from the basis vectors.
basis⁢:=⁢Matrix⁡Basis⁡v1,⁢v2,⁢v3;
basis≔
To express (25, -4, 9) in this basis, use the LinearSolve command.
LinearSolve⁡basis,⁢<25,⁢−4,⁢9>
Numeric Computations
You can very efficiently perform computations on large matrices and vectors that contain floating-point data using the built-in library of numeric linear algebra routines. Some of these routines are provided by the Numerical Algorithms Group (NAG®). Maple also contains portions of the CLAPACK and optimized ATLAS libraries.
For information on performing efficient numeric computations using the LinearAlgebra package, refer to the EfficientLinearAlgebra help page.
See also Creating Matrices and Vectors with Specific Properties and Reading from Files.
The Student package contains subpackages that help instructors teach concepts and allow students to visualize and explore ideas. These subpackages also contain computational commands.
In the Student[LinearAlgebra] subpackage, the environment differs from that of the LinearAlgebra package in that floating-point computations are generally performed using software precision, instead of hardware precision, and symbols are generally assumed to represent real, rather than complex, quantities. These defaults, and others, can be controlled using the SetDefault command.
For information on using Maple as a teaching and learning tool, see Teaching and Learning with Maple.
5.4 Calculus
This section describes the key Maple calculus commands. Many of these commands are also available in the Context Panel for an expression.
For a complete list of calculus commands, refer to the Mathematics (including Calculus, Differential Equations, Power Series, and Vector Calculus subfolders) and Education >Student Package sections of the Maple Help System Table of Contents.
The Task Browser (Tools→Tasks→Browse) contains numerous calculus task templates.
For more about resources for teaching or learning calculus, see Teaching and Learning with Maple.
To compute the limit of an expression as the independent variable approaches a value:
In the Calculus palette, click the limit item .
Specify the independent variable, limit point, and expression, and then evaluate it. Press Tab to move to the next placeholder.
limx→0⁡(xsin⁡x)
The limit Command
By default, Maple searches for the real bidirectional limit (unless the limit point is ∞ or -∞). To specify a direction, include one of the options left, right, real, or complex in a call to the limit command. See Table 5.8.
Limit
Command Syntax
Output
limx→0⁡1x
limit⁡(1x,⁢x⁢=⁢0)
undefined
limx→0+⁡1x
limit1x,⁢x⁢=⁢0,⁢'right'
∞
limx→0−⁡1x
limit1x,⁢x⁢=⁢0,⁢'left'
−∞
Using the limit command, you can also compute multidimensional limits.
limitx2y,x=1,y=∞
0
For more information on multidimensional limits, refer to the limit/multi help page.
Numerically Computing a Limit
To numerically compute a limit:
Use the evalf(Limit(arguments)) calling sequence.
Important: Use the inertLimit command, not the limit command.
The Limit command accepts the same arguments as the limit command.
evalf⁡Limit⁡sin⁡xcos⁡x⁢+⁢tan⁡x,⁢x⁢=⁢1.225
0.3020605357
For information on the evalf command, see Numerical Approximation.
The Limit command does not compute the limit. It returns an unevaluated limit.
Limit⁡sin⁡xcos⁡x⁢+⁢tan⁡x,⁢x⁢=⁢1.225
limx→1.225⁡sin⁡xcos⁡x+tan⁡x
For more information on the Limit command, refer to the Limit help page.
Maple can perform symbolic and numeric differentiation.
To differentiate an expression:
In the Calculus palette, click the differentiation item or the partial differentiation item .
Specify the expression and independent variable, and then evaluate it.
For example, to differentiate x sina x with respect to x:
unassign'a':
ⅆⅆ x x sina x
sin⁡a⁢x+x⁢a⁢cos⁡a⁢x
You can also differentiate using the Context Panel. For more information, see The Context Panel.
To calculate a higher order or partial derivative, edit the derivative symbol inserted. For example, to calculate the second derivative of x sina x+x2 with respect to x:
ⅆ2ⅆx2⁡x⁢sin⁡a⁢x+x2
2⁢a⁢cos⁡a⁢x−x⁢a2⁢sin⁡a⁢x+2
To calculate the mixed partial derivative of x sin3 y+y x5:
∂2∂y⁢∂x⁡x sin3 y+y x5
3⁢cos⁡3⁢y+5⁢x4
Note: To enter another ∂ symbol, you can copy and paste the existing symbol, or enter d and use symbol completion.
The diff Command
Maple computes derivatives using the diff command. To directly use the diff command, specify the expression to differentiate and the variable.
x⁢sin(a⁢x)+x2
x⁢sin⁡a⁢x+x2
diff⁡,⁢x
sin⁡a⁢x+x⁢a⁢cos⁡a⁢x+2⁢x
For information on equation labels such as (5.3), see Equation Labels.
You can calculate a higher order derivative by specifying a sequence of differentiation variables. Maple recursively calls the diff command.
diff⁡,⁢x,⁢x
To calculate a partial derivative, use the same syntax. Maple assumes that the derivatives commute.
diff⁡x⁢sin⁡3⁢y⁢+⁢yx,⁢x,⁢y
3⁢cos⁡3⁢y+12⁢x
To enter higher order derivatives, it is convenient to use the syntax diff(f, x$n). This syntax can also be used to compute the symbolic nth order derivative.
diff⁡cost,⁢t$n
cos⁡t+n⁢π2
Differentiating an Operator
You can also specify a mathematical function as a functional operator (a mapping). For a comparison of operators and other expressions, see Distinction between Functional Operators and Other Expressions.
To find the derivative of a functional operator:
Use the D operator.
The D operator returns a functional operator.
For example, find the derivative of an operator that represents the mathematical function F:x→x cosx.
First, define the operator F.
In the Expression palette, click the single-variable function definition item .
Enter placeholder values.
To move to the next placeholder, press the Tab key. Note: If pressing the Tab key inserts a tab, click the Tab icon in the toolbar.
F:=x→x⁢cos⁡x:
Now, define the operator, G, that maps x to the derivative of x⁢cosx.
G⁢:=⁢D⁡F
G≔x↦cos⁡x−x⁢sin⁡x
F and G evaluated at π2 return the expected values.
Fπ2;⁢Gπ2
−π2
For more information on the D operator, refer to the D help page. For a comparison of the diff command and D operator, refer to the diffVersusD help page.
Directional Derivative
To compute and plot a directional derivative, use the Directional Derivative Tutor. The tutor computes a floating-point value for the directional derivative.
To launch the tutor:
From the Tools menu, select Tutors, Calculus - Multivariate, and then Directional Derivatives. Maple launches the Directional Derivative Tutor. See Figure 5.7.
Figure 5.7: Directional Derivative Tutor
To compute a symbolic value for the directional derivative, use the Student[MultivariateCalculus][DirectionalDerivative] command. The first list of numbers specifies the point at which to compute the derivative. The second list of numbers specifies the direction in which to compute the derivative.
For example, at the point 1,2,the gradient of x2+y2 points in the direction 2,4,which is the direction of greatest increase. The directional derivative in the orthogonal direction −2,1 is zero.
with⁡StudentMultivariateCalculus:
DirectionalDerivative⁡x2+y2,⁢x,⁢y⁢=⁢1,⁢2,⁢1,⁢2;
2⁢5
DirectionalDerivative⁡x2+y2,⁢x,⁢y⁢=⁢1,⁢2,⁢−2,⁢1;
To generate the Taylor series expansion of a function about a point, use the taylor command.
taylor⁡sin⁡4⁢xcos⁡x,⁢x=0
4⁢x−383⁢x3+42130⁢x5+O⁡x7
Note: If a Taylor series does not exist, use the series command to find a general series expansion.
For example, the cosine integral function does not have a taylor series expansion about 0.
taylorCi⁡x,⁢x⁢=⁢0
Error, does not have a taylor expansion, try series()
To generate a truncated series expansion of a function about a point, use the series command.
series⁡Ci⁡x,⁢x⁢=⁢0
γ+ln⁡x−14⁢x2+196⁢x4+O⁡x6
By default, Maple performs series calculations up to order 6. To use a different order, specify a non-negative integer third argument.
expansion⁢:=⁢series⁡Ci⁡t,⁢t⁢=⁢0,⁢4
expansion≔γ+ln⁡t−14⁢t2+O⁡t4
To set the order for all computations, use the Order environment variable. For information about the Order variable and the Ot4 term, refer to the Order help page.
The expansion is of type series. Some commands do not accept arguments of type series. To use the expansion, you must convert it to a polynomial. You can do this by using the convert/polynom command on the series, or by computing the series with the option oterm=false.
plot⁡Ci⁡t,⁢convert⁡expansion,⁢polynom,⁢t⁢=⁢1100..2
For information on Maple types and type conversions, see Maple Expressions.
For information on plotting, see Plots and Animations.
Maple can perform symbolic and numeric integration.
To compute the indefinite integral of an expression:
In the Calculus palette, click the indefinite integration item .
Specify the integrand and variable of integration, and then evaluate it.
For example, to integrate x⁢sin(a⁢x) with respect to x:
∫x⁢sin(a⁢x)ⅆx
sin⁡a⁢x−x⁢a⁢cos⁡a⁢xa2
Recall that you can also enter symbols, including ∫ and ⅆ, using symbol completion.
Enter the symbol name (or part of the name), for example, int or d, and then press the completion shortcut key.
For more information, see Symbol Names.
You can also compute an indefinite integral using the Context Panel. For more information, see The Context Panel.
To compute the definite integral of an expression:
In the Calculus palette, click the definite integration item .
Specify the endpoints of the interval of integration, integrand expression, and variable of integration, and then evaluate it.
For example, to integrate ⅇ−a t lnt over the interval (0, ∞):
∫0∞ⅇ−a t lnt ⅆt
limt→∞⁡−ⅇ−a⁢t⁢ln⁡t+Ei1⁡a⁢t+γ+ln⁡aa
Maple treats the parameter a as a complex number. As described in Assumptions on Variables, you can compute under the assumption that a is a positive, real number using the assuming command.
∫0∞ⅇ−a t lnt ⅆt assuming a>0
−γ+ln⁡aa
To compute iterated integrals, line integrals, and surface integrals, use the task templates (Tools → Tasks → Browse) in the Multivariate and Vector Calculus folders.
The int Command
∫fⅆx and ∫abfⅆx use the int command. To use the int command directly, specify the following arguments.
Expression to integrate
Variable of integration
x⁢sin(a⁢x)
x⁢sin⁡a⁢x
int⁡,⁢x
For a definite integration, set the variable of integration equal to the interval of integration.
int⁡,⁢x⁢=⁢0..πa
πa2
Numeric Integration
To perform numeric integration:
Use the evalf(Int(arguments)) calling sequence.
Important: Use the inertInt command, not the int command.
In addition to the arguments accepted by the int command, you can include optional arguments such as method, which specifies the numeric integration method.
evalf⁡Int⁡1Γ⁡x,⁢x⁢=⁢0..2,⁢'method'⁢=⁢_Dexp
1.626378399
For information on numeric integration, including iterated integration and controlling the algorithm, refer to the evalf/Int help page.
In addition to top-level calculus commands, Maple contains calculus packages.
VectorCalculus Package
The VectorCalculus package contains commands that perform multivariate and vector calculus operations on VectorCalculus vectors (vectors with an additional coordinate system attribute) and vector fields (vectors with additional coordinate system and vectorfield attributes), for example, Curl, Flux, and Torsion.
withVectorCalculus:
BasisFormatfalse:
SetCoordinates⁡'cartesianx,⁢y,⁢z':
VectorField1⁢:=⁢VectorField⁡−y,⁢x,⁢⁢z
VectorField1≔
Note: For information on changing the display format in the VectorCalculus package, see the VectorCalculus[BasisFormat] help page.
Find the curl of VectorField1.
Curl⁡VectorField1;
Find the flux of VectorField1 through a sphere of radius r at the origin.
Flux⁡VectorField1,⁢Sphere⁡0,⁢0,⁢0,⁢r
4⁢r3⁢π3
Compute the torsion of a space curve. The curve must be a vector with parametric function components.
simplify⁡Torsion⁡t,⁢t2,⁢t3,⁢t⁢assuming⁢t::real
39⁢t4+9⁢t2+1
For information on the assuming command, see The assuming Command.
For more information on the VectorCalculus package, including a complete list of commands, refer to the VectorCalculus help page.
To find other calculus packages, such as VariationalCalculus, refer to the index/package help page.
Student Calculus Packages
The Student package contains subpackages that help instructors teach concepts and allow students to visualize and explore ideas. These subpackages also contain computational commands. The Student calculus subpackages include Calculus1, MultivariateCalculus, and VectorCalculus. The Student[VectorCalculus] package provides a simple interface to a subset of the functionality available in the VectorCalculus package.
For information on using Maple as a teaching and learning tool, including the comprehensive interactive Study Guides, see Teaching and Learning with Maple.
Maple has a powerful set of solvers for ordinary differential equations (ODEs) and partial differential equations (PDEs), and systems of ODEs and PDEs.
For information on solving ODEs and PDEs, see Other Specialized Solvers.
Student ODEs Package
The Student subpackage for ODEs has commands for computation, visualization, and step-by-step solutions, designed to support a first year course in ordinary differential equations.
5.5 Optimization
Using the Optimization package, you can numerically solve optimization problems. The package uses fast Numerical Algorithms Group (NAG) algorithms to minimize or maximize an objective function.
The Optimization package solves constrained and unconstrained problems.
Linear programs
Quadratic programs
Nonlinear programs
Linear and nonlinear least-squares problems
The Optimization package contains local solvers. In addition, for univariate finitely-bounded nonlinear programs with no other constraints, you can compute global solutions using the NLPSolve command. To find global solutions generally, purchase the Global Optimization Toolbox. For more information, visit http://www.maplesoft.com/products/toolboxes.
The primary method for solving optimization problems is the Optimization Assistant.
To launch the Optimization Assistant:
From the Tools menu, select Tutors, Optimization, and then Optimization.
Maple launches the Optimization Assistant. See Figure 5.8.
Figure 5.8: Optimization Assistant
To solve a problem:
Enter the objective function, constraints, and bounds.
Select the Minimize or Maximize radio button.
Click the Solve button. The solution is displayed in the Solution text box.
You can also enter the problem (objective function, constraints, and bounds) in the calling sequence of the Optimization[Interactive] command.
For example, find the maximum value of x3y⁢−⁢y2 subject to the constraints x⁢+⁢y⁢≤⁢6,⁢x⁢∈⁢0,5,⁢y⁢∈⁢0,5.
OptimizationInteractivex3 y−y2,x+y≤6,x=0..5,y=0..5
134.491161539748163,x=4.53559292539129,y=1.46440707460871
When the Optimization Assistant opens, select Maximize, then Solve.
After finding a solution, you can plot it. To plot a solution:
In the Optimization Assistant window, click the Plot button. The Optimization Plotter window is displayed. See Figure 5.9.
Note: When you close the Optimization Assistant, you can choose to return the solution, problem, command used, plot, or nothing, using the drop-down in the bottom right corner of the assistant window.
Figure 5.9: Optimization Assistant Plotter Window
For information on the algorithms used to solve optimization problems, refer to the Optimization/Methods help page.
Large Optimization Problems
The Optimization Assistant accepts input in an algebraic form. You can specify input in other forms, described in the Optimization/InputForms help page, in command calling sequences.
The Matrix form, described in the Optimization/MatrixForm help page, is more complex but offers greater flexibility and efficiency.
For example, solve the linear program:
Maximize cTx subject to Ax⁢⩽⁢b, where x is the vector of problem variables.
Define the column vector, c, of the linear objective function.
restart;
withLinearAlgebra:
c⁢:=⁢RandomVectorcolumn20,outputoptions='datatype'='float':
Define the matrix A, the coefficient matrix for the linear inequality constraints.
A⁢:=⁢RandomMatrix19,20,outputoptions='datatype'⁢=⁢'float':
Define the column vector b, the linear inequality constraints.
b⁢:=⁢RandomVectorcolumn19,outputoptions=⁢'datatype'⁢=⁢'float':
The QPSolve command solves quadratic programs.
OptimizationLPSolve⁡c,⁢A,⁢b,maximize,assume=nonnegative
This example uses a random data set to demonstrate the problem. You could also read data from an external file as Matrices, and use that data. For details and an example, see Reading from Files.
Note: For information on creating matrices and vectors (including how to use the Matrix palette to easily create matrices), see Linear Algebra.
For additional information on performing efficient computations, refer to the Optimization/Computation help page.
To import linear programs from a standard MPS(X) data file, use the ImportMPS command.
Optimization Package Commands
Each Optimization package command solves the problem using a different optimization method. These are described in Table 5.9, along with the general input form for each command.
LPSolve
Solve a linear program (LP), which involves computing the minimum (or maximum) of a linear objective function subject to linear constraints; input is in equation or Matrix form
LSSolve
Solve a least-squares (LS) problem, which involves computing the minimum of a real-valued objective function having the form 12f1x2+f2x2+...+fqx2,where x is a vector of problem variables, possibly subject to constraints; input is in equation or Matrix form
Maximize
Compute a local maximum of an objective function, possibly subject to constraints
Minimize
Compute a local minimum of an objective function, possibly subject to constraints
NLPSolve
Solve a non-linear program (NLP), which involves computing the minimum (or maximum) of a real-valued objective function, possibly subject to constraints; input is in equation or Matrix form
QPSolve
Solve a quadratic program (QP), which involves computing the minimum (or maximum) of a quadratic objective function, possibly subject to linear constraints; input is in equation or Matrix form
For a complete list of commands and other Optimization package information, refer to the Optimization help page.
5.6 Statistics
The Statistics package provides tools for mathematical statistics and data analysis. The package supports a wide range of common statistical tasks including quantitative and graphical data analysis, simulation, and curve fitting.
In addition to standard data analysis tools, the Statistics package provides a wide range of symbolic and numeric tools for computing with random variables. The package supports over 35 major probability distributions and can be extended to include new distributions.
The Statistics package supports:
Continuous distributions, which are defined along the real line by probability density functions. Maple supports many continuous distributions, including the normal, Student-t, Laplace, and logistic distributions.
Discrete distributions, which have nonzero probability only at discrete points. A discrete distribution is defined by a probability function. Maple supports many discrete distributions, including the Bernoulli, geometric, and Poisson distributions.
For a complete list of distributions, refer to the Statistics/Distributions help page.
You can define random variables by specifying a distribution in a call to the RandomVariable command.
withStatistics:
X≔RandomVariablePoissonλ:
Find the probability distribution function for X. (For information on statistics computations, see Statistical Computations.)
PDFX, t
∑k=0∞⁡λk⁢ⅇ−λ⁢Dirac⁡t−kk!
Adding Custom Distributions
To add a new distribution, specify a probability distribution in a call to the Distribution command.
U⁢:=⁢Distribution⁡PDF⁢=⁢t→0t<013t⁢<⁢30otherwise:
To construct a piecewise-continuous function in 1-D Math, use the piecewise command, for example, t -> piecewise(t < 0, 0, t < 3, 1/3, 0).
Define a new random variable with this distribution.
Z⁢:=⁢RandomVariable⁡U:⁢PDF⁡Z,⁢t
0t<013t<30otherwise
Calculate the mean value of the random variable.
Mean⁡Z
32
In addition to basic functions, like mean, median, standard deviation, and percentile, the Statistics package contains commands that compute, for example, the interquartile range and hazard rate.
Example 1 - Interquartile Range
Compute the average absolute range from the interquartile of the Rayleigh distribution with scale parameter 3.
InterquartileRange⁡Rayleigh⁡3
36⁢ln⁡2−−18⁢ln⁡34
To compute the result numerically:
Specify the 'numeric' option.
InterquartileRange⁡Rayleigh⁡3,⁢'numeric'
2.71974481762339
Example 2 - Hazard Rate
Compute the hazard rate of the Cauchy distribution with location and scale parameters a and b at an arbitrary point t.
unassign'b':
HazardRateCauchy⁡a,⁢b,⁢t
1π⁢b⁢1+t−a2b2⁢12−arctan⁡t−abπ
You can specify a value for the point t.
HazardRate⁡Cauchy⁡a,⁢b,⁢12
1π⁢b⁢1+12−a2b2⁢12−arctan⁡12−abπ
You can also specify that Maple compute the result numerically.
HazardRate⁡Cauchy⁡10,⁢1,⁢12,⁢'numeric'
0.003608801461
For more information, refer to the Statistics/DescriptiveStatistics help page.
You can generate statistical plots using the visualization commands in the Statistics package. Available plots include:
Bar chart
Frequency plot
Histogram
Pie chart
Scatter plot
For example, create a scatter plot for a distribution of points that vary from sin⁡2⁢π⁢x200 by a small value determined by a normally distributed sample.
N⁢:=⁢200:
U⁢:=⁢Sample⁡Normal⁡0,⁢1,⁢N:
X ≔ seq⁡x,⁢x⁢=⁢1.. N:
Y⁢:=⁢<seq⁡sin⁡2⁢π⁢xN⁢+⁢Ux5,⁢x⁢=⁢1..N>:
ScatterPlotX,Y,'title'=Scatter Plot;
To fit a curve to the data points, include the optional fit equation parameter.
Using the plots[display] command, create a plot that contains:
a scatter plot of the data points
a quartic polynomial fitted to the data points: f⁡x⁢=⁢a⁢x4⁢+⁢b⁢x3⁢+⁢c⁢x2⁢+⁢d⁢x⁢+⁢e
the function sin⁡2⁢π⁢xN
P ≔ ScatterPlotX,⁢Y,⁢fit⁢=⁢a⁢x4⁢+⁢b⁢x3⁢+⁢c⁢x2⁢+⁢d⁢x⁢+⁢e,⁢x,⁢thickness⁢=⁢2:
Q⁢:=⁢plot⁡sin2⁢π⁢xN,⁢x⁢=⁢1..N,⁢thickness⁢=⁢2,⁢color⁢=⁢Niagara 3:
plotsdisplay(P,⁢Q,⁢'title'⁢=⁢Scatter Plot with Fitted Quartic Polynomial)
For more information on statistical plots, refer to the Statistics/Visualization help page.
For an overview of plotting, see Plots and Animations.
Student Statistics Package
The Student[Statistics] package helps instructors teach concepts and allows students to understand and explore concepts in an introductory statistics course. The Student[Statistics] package provides a simple interface to a limited subset of the functionality available in the Statistics package, as well as some additional resources. You can create and explore random distributions, perform hypothesis testing, and more.
The Student Statistics Example worksheet provides some starting examples.
For more information on the Statistics package, including regression analysis, estimation, data manipulation, and data smoothing, refer to the Statistics help page.
5.7 Teaching and Learning with Maple
Table 5.10 lists the available resources for instructors and students. For additional resources, see Available Resources.
The Student package contains computational and visualization (plotting and animation) functionality, and point-and-click interfaces for explaining and exploring concepts (Tools→Tutors).
Study guides - Complete lessons with interactive examples for academic courses. Maple includes these study guides:
Precalculus Study Guide contains worked problems, each solved as in a standard textbook, using Maple commands and custom Maplet graphical interfaces.
Calculus Study Guide contains worked problems, each solved as in a standard textbook, using Maple commands and custom Maplet graphical interfaces.
Multivariate Calculus Study Guide contains worked problems, each solved as in a standard textbook, using Maple commands and custom Maplet graphical interfaces.
Teacher Resource Center
The Maple Teacher Resource Center contains resources and tips for teachers using Maplesoft products to help in the classroom. Available resources include:
Classroom content for subjects including Precalculus, Calculus, and Engineering
Training videos
E-books
(http://www.maplesoft.com/TeacherResource)
Maple Portal
The Maple Portal includes material designed for all Maple users as well as a specific portal for students. The Maple Portal includes:
How Do I... topics that give quick answers to essential questions
Tutorials that provide an overview of topics from getting started to plotting and working with matrices
Navigation to portals with specialized information for students and engineers
Access the portal the table of contents in the Maple Help System, under Getting Started.
Mathematics and Engineering Dictionary
The Maple Help System has an integrated dictionary of over 5000 mathematics and engineering terms. You can search the dictionary by entering a term in the Help System search field.
Maple Application Center
The Maple Application Center contains tutorials and applications that help instructors begin using Maple and use Maple in the classroom. Browse the many resources by category or search for a topic.
(http://www.maplesoft.com/applications)
Student Help Center
The Maple Student Help Center contains tutorials and applications that help students learn how to use Maple, explore mathematical concepts, and solve problems. Available resources include:
Free course lessons for many subjects including precalculus to vector calculus; high school, abstract, and linear algebra; engineering; physics; differential equations; cryptography; and classical mechanics.
Applications for students, written by students, providing examples in many subject areas.
Student FAQs with answers from experts.
(https://www.maplesoft.com/studentcenter/index.aspx)
The Student package is a collection of subpackages for teaching and learning mathematics and related subjects. The Student package contains packages for a variety of subjects, including precalculus, calculus, and linear algebra.
Instructors can:
Teach concepts without being distracted by the mechanics of the computations.
Create examples and quickly update them during a lesson to demonstrate different cases or show the effect of the variation of a parameter.
Create plots and animations to visually explain concepts, for example, the geometric relationship between a mathematical function and its derivatives (Tools→Tutors→Calculus - Single Variable→Derivatives). See Figure 5.10.
Figure 5.10: Calculus 1 Derivatives Tutor
Students can:
Perform step-by-step computations, for example, compute a derivative by applying differentiation rules using commands or a tutor (Tools→Tutors→Calculus - Single Variable→Differentiation Methods). See Figure 5.11.
Perform computations.
Visually explore concepts.
Figure 5.11: Calculus 1 Differentiation Methods Tutor
Tutors provide point-and-click interfaces to the Student package functionality.
To launch a tutor:
From the Tools menu, select Tutors.
Select a subject, for example, Calculus - Multivariate.
Select a tutor, for example, Gradients.
Maple inserts the Student[MultivariateCalculus][GradientTutor]() calling sequence (in Worksheet mode), and launches the Multivariate Calculus Gradient Tutor.
By rotating the three-dimensional plot, you can show that the gradient points in the direction of greatest increase of the surface (see Figure 5.12) and show the direction of the gradient vector in the x-y plane by rotating the plot (see Figure 5.13).
Figure 5.12: Multivariate Calculus Gradient Tutor
Figure 5.13: Multivariate Calculus Gradient Tutor Showing x-y Plane
When you close the tutor, Maple inserts the 3-D plot.
StudentMultivariateCalculusGradientTutor;
Many Student package commands can return a value, mathematical expression, plot, or animation. This allows you to compute the final answer, see the general formula applied to a specific problem, or visualize the underlying concepts.
For example, the Student[VectorCalculus][LineInt] (line integral) command can return the following.
Plot that visually indicates the vector field, path of integration, and tangent vectors to the path
Unevaluated line integral
Numeric value of the line integral
with⁡StudentVectorCalculus:
LineInt⁡VectorField⁡<y,⁢&uminus0;x>,⁢Circle⁡<0,⁢0>,⁢1,⁢'output'⁢=⁢'plot'
LineInt⁡VectorField⁡<y,⁢&uminus0;x>,⁢Circle⁡<0,⁢0>,⁢1,⁢'output'⁢=⁢'integral'
∫02⁢π−sin⁡t2−cos⁡t2ⅆt
To evaluate the integral returned by the output = integral calling sequence, use the value command.
value⁡
−2⁢π
By default, the LineInt command returns the value of the integral.
LineInt⁡VectorField⁡<y⁢−⁢x,⁢&uminus0;x⁢&uminus0;y>,⁢Circle⁡<0,⁢0>,⁢r
−2⁢π⁢r2
For more information on the Student package, refer to the Student help page.
Calculus Problem Solving Examples
Maple is a powerful application with many resources to guide you. The following examples provide you with scenarios to learn about using Maple resources and the Maple program.
When using Maple to solve a problem, consider the following process.
Formulate your problem.
Obtain Maple resources that allow you to solve it.
Problem
Scenario A:
Your company is designing a bottle for its new spring water product. The bottle must contain 18 ounces of water and the height is fixed. The design includes an undulating curved surface. You know the amplitude and equation of the curve, but you must find the radius. You require the Volume of Revolution.
Scenario B:
You want to teach your students the concept of a Volume of Revolution. Specifically, you want to plot and compute the volume of a solid generated by rotating fx, a≤x≤b, about an axis or a line parallel to an axis.
Figure 5.14: Flowchart of solving a problem
Check for Existing Tools: Tutor
Begin by examining the Tools menu for a Tutor to a Volume of Revolution problem.
To access a Tutor for the Volume of Revolution:
From the Tools menu, select Tutors, and then Calculus-Single Variable. Notice that a Volume of Revolution tutor exists.
Click the Volume of Revolution menu item. The following Maple command is entered in your document.
StudentCalculus1VolumeOfRevolutionTutor;
The Volume of Revolution Tutor is displayed. See Figure 5.15. Use this tutor to enter a function and an interval, view and manipulate the corresponding plot, and view the full Maple command associated with your entries and selections.
Figure 5.15: Volume of Revolution Tutor
After you Close the tutor, the plot is inserted into your worksheet.
Check for Existing Tools: Task Template
From the Tools menu, select Tasks, and then Browse. The Browse Tasks dialog opens, displaying a list of tasks in the left pane. The tasks are sorted by subject to help you quickly find the desired task.
Expand the Calculus - Integral→ Applications → Solids of Revolution folder.
From the displayed list, select Volume. The Volume of Revolution task is displayed in the right pane of the Browse Tasks dialog.
Select the Insert into New Worksheet check box.
Click Insert Default Content. Before inserting a task, Maple checks whether the task variables have assigned values in your worksheet. If any task variable is assigned, the Task Variables dialog opens allowing you to modify the names. Maple uses the edited variable names for all variable instances in the inserted task. The content is inserted into your document. See Figure 5.16.
Figure 5.16: Inserted Task Template
When a Task Template is inserted, parameters are marked as placeholders, denoted by purple font. To navigate between placeholders, press the Tab key. After updating any parameters, execute the command by pressing Enter.
Check for Instructions: Help Page and Example Worksheet
The help system provides command syntax information.
To access a help page:
From the Help menu, select Maple Help.
In the search field, enter volume of revolution and click Search. The search results include the command help page, the dictionary definition, and the associated tutor help page.
Review the calling sequence, parameters, and description in the Student[Calculus1][VolumeOfRevolution] help page.
Copy the examples into your worksheet: from the help system Edit menu, select Copy Examples.
Close the Help Navigator.
In your document, from the Edit menu, select Paste. The examples are pasted into your document.
Execute the examples and examine the results.
To access an example worksheet:
In the worksheet, enter examples/index. The Examples and Applications Index opens.
Expand the Calculus topic.
Click the examples/Calculus1IntApps link. The Calculus1: Applications of Integration worksheet opens. See Figure 5.17.
Expand the Volume of Revolution topic.
Examine and execute the examples.
Figure 5.17: Example Worksheet
Check for Other Ready-To-Use Resources: Application Center
The Maple Application Center contains free user-contributed applications related to mathematics, education, science, engineering, computer science, statistics and data analysis, finance, communications, graphics, and more.
To access a free application for volume of revolution:
Go to the Maplesoft website, http://www.maplesoft.com.
In the menu of the main webpage, click Support & Resources, and then Maple Application Center.
In the Application Search section, enter Volume of Revolution in the Keyword or phrase field.
Click Search.
From the search results page, under Displaying applications, click the Click here link.
From the list of archived applications, select any of the Maple document you want to view.
Click on the Download Maple Document link to download the .mw file.
Execute the worksheet and examine the results.
5.8 Clickable MathTM
For years, Maple has led the way in making math software easy to use. With its collection of Clickable MathTM tools, including palettes, interactive assistants, context-sensitive operations, tutors, and more, Maple has set the standard for making it easy to learn, teach, and do mathematics.
The Study Guides are a core feature of our Clickable Math resources. These are described in Teaching and Learning with Maple.
In addition, two key features of the Clickable Math tool collection are Smart Popups and Drag-to-SolveTM.
Smart Popups
Smart Popups are interactive popup options that are invoked when you select certain types of equations, expressions or subexpressions.
With Smart Popups you can:
Select operations to apply to just one part of your equation or mathematical expression, leaving the rest unchanged.
Preview the result of the operation before going ahead.
Explore your expression to deepen your understanding of the problem.
Easily determine if your subexpression can be factored, what its plot looks like, what mathematical identities could be applied, and more.
Smart popups, if any, are shown at the top of the Context Panel. For more information on Smart Popups, as well as examples, see the Clickable Math: Smart Popups help page.
Drag-to-Solve
The Drag-to-Solve feature enables you to solve your equations step-by-step by dragging terms to where you want them to be.
With Drag-to-Solve you can:
Easily take complete control over each individual step of your calculation.
Let Maple apply the appropriate addition, subtraction, division, or multiplication operation to both sides of your equation, to avoid mechanical errors.
Keep the full record of steps produced by Maple to document your work.
For more information on Drag-to-Solve, as well as examples, see the Clickable Math: Drag-to-Solve help page.
Examples
This chapter is designed to show several ways to solve the same problem in Maple. Throughout these examples, you will need to insert new document block regions. This is done using the Create document block icon ( ) on the toolbar or through the Edit menu, by selecting Document Blocks>Create Document Block. Also, these examples only give the keyboard keys needed for a Windows operating system. Refer to Shortcut Keys by Platform for the keys needed for your operating system.
Example 1 - Graph a Function and its Derivatives
On the interval −π,π, graph f, f′, and f″for fx=x cosx.
We solve this problem using the following methods:
Solution by Context-Sensitive Operations
Solution by Tutor
Access the Tutor from a Task Template
Action
Result in Document
Enter the expression x cosx.
x cosx
Make a copy of the expression and calculate the derivative:
Insert a new document block region by selecting from the Format menu Create Document Block.
Highlight the original expression. Ctrl + drag the expression to the new document block.
Select the expression and, from the Context Panel select Differentiate → With Respect To → x.
x cosx→differentiate w.r.t. xcos⁡x−x⁢sin⁡x
Make a copy of the derivative and calculate the second derivative:
Insert a new document block, and Ctrl + drag the derivative to the document block.
From the Context Panel for the derivative, select Differentiate → With Respect To → x.
cos⁡x−x⁢sin⁡x→differentiate w.r.t. x−2⁢sin⁡x−x⁢cos⁡x
Plot the original expression:
Insert a new document block, and Ctrl + drag the original expression to the new block.
From the Context Panel for the expression, select Plots → 2-D Plot.
Modify the plot through the Context Panel: select Axes → Properties.
In the Axis Properties dialog, de-select Use data extents and change the range to -3.14 to 3.14. Click OK.
x cosx→
Add the first and second derivatives to the plot:
Select and then Ctrl + drag the derivative of the expression onto the plot region. Do the same for the second derivative.
→
Enhance the plot by adding a legend:
From the Context Panel for the plot region, select Legend → Show Legend.
In the legend, double-click Curve 1. Notice that the Text icon is selected in the toolbar, . Delete the text and select the Math icon in the toolbar, . This allows you to enter 2-D Math in a text region. Enter the original expression, x cosx.
Repeat for Curve 2 and Curve 3.
Add a title:
From the Context Panel, select Title → Add Title. Replace the text New title with the text "Plot the expression ".
Click the Math icon, and enter the expression x⁢cos⁡x. Click the Text icon once again and enter " and its derivatives".
The Student Calculus 1 package contains a tutor called Derivatives, which displays a plot of the expression along with its derivatives. In this example, we solve the same problem as previously, using this tutor
Load the Student Calculus 1 package. From the Tools menu, select Load Package → Student Calculus 1.
Ctrl + drag the expression x cosx to a blank document block region.
Loading Student:-Calculus1
From the Context Panel for the expression, select Student Calculus 1 → Tutors → Derivatives. Note: The Student Calculus 1 menu is now available in the Context Panel because we loaded the package in step 1.
In the Derivative Tutor, the color swatch shown beside the original expression is the color used for the curve in the plot region. Similarly for f′x and f″x.
Change the lower endpoint to -Pi. Select the check box to display f″x in the plot. Click Display to make these changes take effect.
You can change the expression and modify plot options from within this tutor. For each change made, click Display to view the altered plot. When complete, click Close to display the resulting plot in the document.
x cosx→derivative tutor
Maple also comes with a Task Template to solve this problem without using any commands.
Launch the Task Template Browser by selecting Tools → Tasks → Browse.
In the table of contents of the Task Browser dialog, select Calculus -Differential→ Derivatives → Graph fx and its Derivatives.
Click Insert Minimal Content at the top of the dialog to insert the task template into the current document.
Enter the new expression x*cosx in the f(x) region.
Enter the interval −π,π. To insert the symbol for pi, you can use command completion or select π from the Common Symbols palette.
Click Launch Differentiation Tutor to launch the same tutor as in the previous solution.
When complete, click Close. A plot of the expression and its derivatives displays in the plot region of the inserted task template.
Example 2 - Solve for x in a Quadratic Equation
Solve for x in the equation x−72+x−12=4x−12+x−42.
Solution through Equation Manipulator
Instant Solution
Step-by-step Interactive Solution
Graphical Solution
Graphical Solution Using Smart Popups
Maple provides a dialog that allows you to single-step through the process of manipulating an expression. This manipulator is available from the Context Panel.
1. Enter the equation x−72+x−12=4x−12+x−42 in a new document block region.
x−72+x−12=4x−12+x−42
From the Context Panel for this equation, select Manipulate Equation. The Manipulate Equation dialog displays.
Group all of the terms to the left:
In the Addition region, the Group terms row allows you to group terms on a specified side. With the left side already selected, click Do.
Expand the left side of the equation:
In the Miscellaneous Operations region, we can manipulate the equation by applying a command from the drop-down menus. Since we want to expand the left side of the equation only, click the first drop-down menu in the second row and select expand. Click Do. Note: This example is carried out with no assumptions. You can assume the solution to be real, positive, nonnegative or integer from the drop-down menu.
Factor the equation:
From the same drop-down menu, select factor and click Do.
Click Return Steps to close the dialog and return all of the steps to the Maple document.
x−72+x−12=4x−12+x−42→manipulate equation−6⁢x−1⁢x−3=0
Ctrl + drag the factored form of the original equation to a new document block region.
From the Context Panel, select Solve → Obtain Solutions for → x.
Or,
Alternatively, click on the output from step 6 and select Solve → Obtain Solutions for → x in the Context Panel.
−6⁢x−1⁢x−3=0→solutions for x1,3
To apply an instant solution to this problem, use the Context Panel.
1. Ctrl + drag the equation x−72+x−12=4x−12+x−42 to a new document block region.
From the Context Panel for the expression, select Solve → Obtain Solutions for → x.
x−72+x−12=4x−12+x−42→solutions for x1,3
This equation can also be solved interactively in the document, by applying context-sensitive operations or commands one step at a time.
1. Ctrl + drag the equation x−72+x−12=4x−12+x−42 to a blank document block region.
x−72+x−12=4⁢x−12+4⁢x−42
Group all terms on the right:
From the Context Panel for this equation, select Move to Right.
x−72+x−12=4x−12+x−42 →move to right0=3⁢x−12+4⁢x−42−x−72
Expand the expression on the right-hand side:
From the Context Panel for this output (or Ctrl + drag the equation to a blank document block region), select Right-hand side.
From the Context Panel for this result, select Expand.
0=3⁢x−12+4⁢x−42−x−72→right hand side3⁢x−12+4⁢x−42−x−72= expand 6⁢x2−24⁢x+18
Use Maple's factor command on the resulting right-hand side:
From the Context Panel for the result, select Right-hand Side.
From the Context Panel for the result, select Factor.
0=6⁢x2−24⁢x+18→right hand side6⁢x2−24⁢x+18= factor 6⁢x−1⁢x−3
Solve for x:
7. From the Context Panel for the result, select Solve → Obtain Solutions for → x.
6⁢x−1⁢x−3→solutions for x1,3
Now that we have seen several methods to solve this problem, we can check the answer by plotting the expression.
1. Ctrl + drag the equation x−72+x−12=4x−12+x−42 to a new document block region and press Enter.
First, manipulate the equation to become an expression:
Select the output and from the Context Panel select Move to Left.
Note the difference in the alignment when using context-sensitive operations on output rather than input. The result is centered in the document with the self-documenting arrow positioned at the left.
x−72+x−12=4⁢x−12+4⁢x−42 →move to leftx−72−3⁢x−12−4⁢x−42=0
Select the output and from the Context Panel select Left-hand Side.
x−72−3⁢x−12−4⁢x−42=0
→left hand sidex−72−3⁢x−12−4⁢x−42
Select the output and from the Context Panel select Expand.
x−72−3⁢x−12−4⁢x−42
=expand −6⁢x2+24⁢x−18
Now that the equation is in its simplest form, plot the result:
Ctrl + drag the output to a new document block.
From the Context Panel for thee expression select Plots → 2-D Plot.
Right-click the output from step 4 and select Plots → 2-D Plot.
−6⁢x2+24⁢x−18→
Change the x- and y- axis ranges using the Context Panel:
By default, the plot uses a range chosen to fit the key features of the graph. To better see the x-intercepts, change the range: from the Context Panel, select Axes → Properties. In the Horizontal tab of the Axes Properties dialog, clear the Use data extents check box and change the Range min and Range max to 0 and 5, respectively. Click the Vertical tab and clear the Use data extents check box. Change the Range min and Range max to -5 and 10, respectively.
Click OK to apply the changes and return to the plot.
The interception points of this graph with the x-axis are 1 and 3, the same solutions that we found previously.
Use Smart Popup menu options to find a graphical solution.
Copy the equation x−72+x−12=4x−12+x−42 to a new document block region and press Enter.
Highlight the right-hand side of the output expression. Smart popups are shown in the top of the Context Panel.
Select the Subtract menu option.
The results of the calculation are displayed in the document.
→subtract 4*(x-1)^2+4*(x-4)^2 from both sides
Select the left side of the equation. A smart popup window is displayed.
Select normal. The results of the calculation are displayed in the document.
→normal (x-7)^2-3*(x-1)^2-4*(x-4)^2
−6⁢x2+24⁢x−18=0
Once again, select the left side of the equation. A smart popup window is displayed. Select 2D plot.
The resulting plot is displayed in the document.
→2D Plot -6*x^2+24*x-18
You can also solve the equation using smart popups. Highlight the simplified equation and from the Smart Popup menu, select solve.
The solution to the equation is displayed.
x=1,x=3
Example 3 - Solve a Quadratic Trig Equation
Find all of the solutions to the equation 6 cos2x−cosx−2=0 in the interval 0,2 π.
Solution by Task Template
Analytic Solution
Ctrl + drag the equation 6 cos2x−cosx−2=0 to a blank document block.
From the Context Panel for the equation, select Left-hand Side.
6⁢cos⁡x2−cos⁡x−2=0→left hand side6⁢cos⁡x2−cos⁡x−2
Click the output and select Plot Builder in the Context Panel. A plot appears. In the Plot Builder panel, in the plot type list, the initally selected plot type is 2-D plot.
Modify the plot range to x=0 to 2*Pi.
Click Plot to display the plot in the document.
From the graph, we can see all of the solutions within the interval 0,2 π. To approximate the values, click the plot, select the type of coordinates that you want to view from the selection menu ( ) in the toolbar, and then use the point probe tool to view the coordinates of the mouse pointer.
From the Tools menu, select Tasks → Browse. Expand the Algebra folder and select Solve Analytically in a Specified Interval.
Click Insert Minimal Content.
Replace the current equation with the one from this example, 6 cos2x−cosx−2=0, and then execute the commands. Notice that equation labels are used to reference the results.
Ctrl + drag the equation 6 cos2x−cosx−2=0 to a blank document block region.
6 cos2x−cosx−2=0
From the Context Panel, select Left-hand Side.
6 cos2x − cosx − 2=0→left hand side6⁢cos⁡x2−cos⁡x−2
From the Context Panel, select Factor.
Click the new factored output and select Solve → Solve in the Context Panel.
Alternatively, you can select each factor, Ctrl + drag the expressions to separate document block regions and for each one select Solve → Solve.
6 cosx2 − cosx −2 = 6⁢cos⁡x2−cos⁡x−2= factor 2⁢cos⁡x+1⁢3⁢cos⁡x−2→solvex=2⁢π3,x=arccos⁡23
Example 4 - Find the Inverse Function
If fx=x2+1,x≥0, find and graph the rule for f−1x, its functional inverse.
Implement the Definition Graphically
The graph of the inverse function is the set of ordered pairs formed by interchanging the ordinates and abscissas.
In a blank document block, enter x2+1,x and press Enter.
x2+1,x
Click the output and select Plot Builder in the Context Panel. In the Plot Builder panel select 2-D plot (parametric) for the plot type. The plot appears.
Adjust the domain for x to the interval 0,1.
Copy and paste the expression x2+1 onto this graph.
Notice that the axis ranges alter.
Copy and paste the expression x onto this graph. The resulting graph shows fx, f′x, and the line y=x.
Adjust the x and y axis ranges:
Select the plot and from the Plot menu, select Axes → Properties.
In the Axis Properties dialog, de-select Use data extents and change the range to 0 to 2.
Click the Vertical tab and repeat step 9. Click OK to apply these settings and close the dialog.
Enter the expression x2+1 in a blank document block.
x2+1
From the Context Panel, select Student Calculus 1 → Tutors → Function Inverse. The Function Inverse Tutor displays.
Adjust the domain to 0,2.
When you are finished, click Close. The plot of the function, its inverse, and the line y=x is returned to the document.
x2+1→inverse tutor
Example 5 - Methods of Integration - Trig Substitution
Evaluate the integral ∫14−x2 ⅆx by making the substitution x=2 sinu.
Immediate Evaluation of the Integral
Solution by Integration Methods Tutor
Solution by First Principles
Enter the integral ∫14−x2 ⅆx in a blank document block region.
∫14−x2 ⅆx
From the Context Panel for the expression and select Evaluate and Display Inline.
∫14−x2 ⅆx = arcsin⁡x2
Loading Student:-Calculus1with(Student:-Calculus1):
with(Student:-Calculus1):
Ctrl + drag the integrand 14−x2 to a blank document block region.
14−x2
From the Context Panel, select Student Calculus 1 → Tutors → Integration Methods. The Integration Methods Tutor displays.
Perform a change of variables by selecting Change and entering x = 2*sin(u).
Apply the constant rule by clicking Constant.
To revert back to the original variable, click Revert.
Now that the integral has been evaluated, click Close to close the tutor and return the evaluated integral to the document.
14−x2 →integration methods tutor∫1−x2+4ⅆx=arcsin⁡x2
Ctrl + drag the integrand 14−x2 to a blank document block region and press Enter.
1−x2+4
Perform trig substitution:
From the Context Panel for the output, select Evaluate at a point. In the dialog that displays, enter 2*sin(u).
→evaluate at point
1−4⁢sin⁡u2+4
From the Context Panel for the output, select Simplify → Symbolic.
→simplify symbolic
12⁢cos⁡u
Calculate ⅆuⅆx:
In a blank document block, enter the substitution equation: x=2 sinu and press Enter.
From the Context Panel for the output, select Differentiate → Implicitly. In the dialog that displays, change the Dependent Variable to x and change Differentiate with respect to to u.
x=2 sinu
x=2⁢sin⁡u
→implicit differentiation
2⁢cos⁡u
Calculate the integral in terms of u:
Referencing the results by their equation labels, multiply the original simplified expression by this derivative.
⋅
Integrate the resulting expression.
∫ ⅆu
u
Revert the substitution:
Place the equation x=2 sinu in a blank document block. Delete u and insert the equation label for the previous result, the value of the integral in terms of u. Press Enter.
From the Context Panel for the output, select Solve → Solve for Variable → u.
The solution is arcsin12x.
x=2 sin
→solve for u
u=arcsin⁡x2
Example 6 - Initial Value Problem
Solve and plot the solution of the initial value problem
y''t+4 y't+13 yt=cos2 t
y0=2
y'0=−1
Solution by ODE Analyzer Assistant
The ODE Analyzer Assistant lets you solve ODEs numerically or symbolically and displays a plot of the solution.
Enter the ODE in a blank document block region.
Select the equation and from the Context Panel, select Solve DE Interactively. The ODE Analyzer Assistant displays with the ODE automatically inserted.
To insert the initial conditions:
In the Conditions region, click Edit. The Edit Conditions dialog opens.
In the Add Condition region, with y selected in the drop-down menu, enter 0 in the first text field to the right and 2 in the second text field. Click Add. Your entry should match the one shown to the right.
To enter the initial condition for y′, select y' from the drop-down menu. In the text fields, enter 0 and -1. Click Add.
Click Done to close this dialog and return to the main dialog. Notice that the initial conditions are in the Conditions section.
Click Solve Numerically. A new dialog appears.
Click Solve to solve the initial value problem.
Click Plot to plot the solution of the DE.
Click the Plot Options button to modify the default graph, if desired.
Click Quit to close the ODE Analyzer and return a plot of the solution to the document.
y''t+4 y't+13 yt=cos2 t→solve DE interactivelyy⁡t=ⅇ−2⁢t⁢sin⁡3⁢t⁢_C2+ⅇ−2⁢t⁢cos⁡3⁢t⁢_C1+9⁢cos⁡2⁢t145+8⁢sin⁡2⁢t145
Download Help Document