This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ow you to access and modify parts of the Maple data structures that represent expressions and other types of objects. In This Chapter
• Mathematical manipulations • Assumptions • Structural manipulations • Evaluation rules 155 156 • Chapter 6: Evaluation and Simpliﬁcation 6.1 Mathematical Manipulations Solving equations by hand usually involves performing a sequence of algebraic manipulations. You can also perform these steps using Maple.
> eq := 4*x + 17 = 23; eq := 4 x + 17 = 23 To solve this equation, you must subtract 17 from both sides of the equation. Subtract the equation 17=17 from eq. Enclose the unnamed equation in parentheses.
> eq  ( 17 = 17 ); 4x = 6 Divide through by 4. Note that you do not have to use 4=4 in this case.
> % / 4; x= 3 2 The following sections focus on more sophisticated manipulations. Expanding Polynomials as Sums
Sums are generally easier to comprehend than products, so you may ﬁnd it useful to expand a polynomial as a sum of products. The expand command has this capability.
> poly := (x+1)*(x+2)*(x+5)*(x3/2); 3 poly := (x + 1) (x + 2) (x + 5) (x − ) 2
> expand( poly ); x4 + 31 13 3 x + 5 x2 − x − 15 2 2 The expand command expands the numerator of a rational expression. 6.1 Mathematical Manipulations > expand( (x+1)*(y^22*y+1) / z / (y1) ); • 157 xy x y2 y x y2 −2 + + −2 z (y − 1) z (y − 1) z (y − 1) z (y − 1) z (y − 1) 1 + z (y − 1) Note: To convert an expression containing fractions into a single rational expression and then cancel common factors, use the normal command. See this section, page 165. Expansion Rules The expand command also recognizes expansion rules for many standard mathematical functions.
> expand( sin(2*x) ); 2 sin(x) cos(x)
> ln( abs(x^2)/(1+abs(x)) ); ln( x2 ) 1 + x > expand(%); 2 ln(x) − ln(1 + x) The combine command recognizes the same rules but applies them in the opposite direction. For information on combining terms, see this section, page 164. You can specify subexpressions that you do not want to expand, as an argument to expand.
> expand( (x+1)*(y+z) ); xy + xz + y + z
> expand( (x+1)*(y+z), x+1 ); (x + 1) y + (x + 1) z 158 • Chapter 6: Evaluation and Simpliﬁcation You can expand an expression over a special domain.
> poly := (x+2)^2*(x2)*(x+3)*(x1)^2*(x1); poly := (x + 2)2 (x − 2) (x + 3) (x − 1)3
> expand( poly ); x7 + 2 x6 − 10 x5 − 12 x4 + 37 x3 + 10 x2 − 52 x + 24
> % mod 3; x7 + 2 x6 + 2 x5 + x3 + x2 + 2 x However, using the Expand command is more eﬃcient.
> Expand( poly ) mod 3; x7 + 2 x6 + 2 x5 + x3 + x2 + 2 x When you use Expand with mod, Maple performs all intermediate calculations in modulo arithmetic. You can also write your own expand subroutines. For more details, refer to the ?expand help page. Collecting the Coeﬃcients of Like Powers
An expression like x2 + 2x + 1 − ax + b − cx2 is easier to read if you collect the coeﬃcients of x2 , x, and the constant terms, b...
View
Full
Document
This note was uploaded on 08/27/2012 for the course MATH 1100 taught by Professor Nil during the Spring '12 term at National University of Singapore.
 Spring '12
 NIL
 Math, Division

Click to edit the document details