11.07.2015 Views

Maple 9 Learning Guide - Maplesoft

Maple 9 Learning Guide - Maplesoft

Maple 9 Learning Guide - Maplesoft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

160 • Chapter 6: Evaluation and SimplificationInstead, make a substitution before you collect. In the preceding case,substituting a dummy name for x*y, then collecting on the dummy nameproduces the desired result.> subs( x=xyprod/y, big_expr );z xyprod + 2 xyprod + z> collect( %, xyprod );(z + 2) xyprod + z> subs( xyprod=x*y, % );(z + 2) y x + zSection 6.3 Structural Manipulations explains the use of the subscommand.If you are collecting coefficients of more than one variable simultaneously,two options are available, the recursive and distributed forms.The recursive form initially collects in the first specified variable, then inthe next, and so on. The default is the recursive form.> poly := x*y + z*x*y + y*x^2 - z*y*x^2 + x + z*x;poly := y x + z x y + y x 2 − z y x 2 + x + z x> collect( poly, [x,y] );(1 − z) y x 2 + ((1 + z) y + 1 + z) xThe distributed form collects the coefficients of all variables at thesame time.> collect( poly, [x,y], distributed );(1 + z) x + (1 + z) y x + (1 − z) y x 2The collect command does not sort the terms. Use the sort commandto sort. See this section, page 171.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!