{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 0 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "Tim es" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE " " -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 7 "Advice:" }{TEXT -1 25 " Re ordering an expression" }}{PARA 0 "" 0 "" {TEXT -1 116 "Normally, once an expression has been created in a Maple session, it is always writt en in the same order. Thus if " }{XPPEDIT 18 0 "a+b*c" "6#,&%\"aG\" \"\"*&%\"bGF%%\"cGF%F%" }{TEXT -1 60 " has occurred previously, even a s a sub-expression (e.g. in " }{XPPEDIT 18 0 "(a+b*c)*d" "6#*&,&%\"aG \"\"\"*&%\"bGF&%\"cGF&F&F&%\"dGF&" }{TEXT -1 17 "), and you enter " } {MPLTEXT 0 21 5 "c*b+a" }{TEXT -1 27 ", Maple will rewrite it as " } {XPPEDIT 18 0 "a+b*c" "6#,&%\"aG\"\"\"*&%\"bGF%%\"cGF%F%" }{TEXT -1 17 ". \n\nYou can use " }{MPLTEXT 0 21 4 "sort" }{TEXT -1 63 " to ch ange the order of an expression. The first argument to " }{MPLTEXT 0 21 4 "sort" }{TEXT -1 100 " is the expression to sort, and the second is a list of variables or functions. A third argument " }{MPLTEXT 0 21 4 "plex" }{TEXT -1 211 " causes the sorting to be in pure lexico graphic order in the members of the list, rather than decreasing total degree in the members of the list. \n\nAfter being sorted, the expre ssion stays in the sorted order." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "sort(a+b*c+c^3*d, [b,c]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#, (*&%\"dG\"\"\")%\"cG\"\"$F&F&*&%\"bGF&F(F&F&%\"aGF&" }}}{PARA 0 "" 0 " " {TEXT -1 34 "This is in total-degree order, so " }{XPPEDIT 18 0 "d*c ^3" "6#*&%\"dG\"\"\"*$%\"cG\"\"$F%" }{TEXT -1 25 ", which is of order \+ 3 in " }{XPPEDIT 18 0 "b" "6#%\"bG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "c" "6#%\"cG" }{TEXT -1 15 ", comes before " }{XPPEDIT 18 0 "b*c" "6 #*&%\"bG\"\"\"%\"cGF%" }{TEXT -1 40 " which is of order 2 in those var iables." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "sort(a+b*c+c^3*d, [b,c],plex);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,(*&%\"bG\"\"\"%\"cGF &F&*&%\"dGF&)F'\"\"$F&F&%\"aGF&" }}}{PARA 0 "" 0 "" {TEXT -1 31 "In pu re lexicographic order in " }{MPLTEXT 0 21 5 "[b,c]" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "b*c" "6#*&%\"bG\"\"\"%\"cGF%" }{TEXT -1 14 " comes bef ore " }{XPPEDIT 18 0 "d*c^3" "6#*&%\"dG\"\"\"*$%\"cG\"\"$F%" }{TEXT -1 9 " because " }{MPLTEXT 0 21 1 "b" }{TEXT -1 178 " has first priori ty. In a sum, terms containing no members of the list come last. In a product, however, factors containing no members of the list come firs t. Thus we obtained " }{XPPEDIT 18 0 "d *c^3" "6#*&%\"dG\"\"\"*$%\"cG \"\"$F%" }{TEXT -1 13 " rather than " }{XPPEDIT 18 0 "c^3 *d" "6#*&%\" cG\"\"$%\"dG\"\"\"" }{TEXT -1 44 ".\n\nHowever, suppose you have the e xpression " }{XPPEDIT 18 0 "c^3 + c^2 + c + 1" "6#,**$%\"cG\"\"$\"\"\" *$F%\"\"#F'F%F'F'F'" }{TEXT -1 26 " and wish to change it to " } {XPPEDIT 18 0 "1 + c + c^2 + c^3" "6#,*\"\"\"F$%\"cGF$*$F%\"\"#F$*$F% \"\"$F$" }{TEXT -1 26 ". There is no way to use " }{MPLTEXT 0 21 4 "s ort" }{TEXT -1 67 " to do this. You would have to create the expressi on initially as " }{MPLTEXT 0 21 17 "1 + c + c^2 + c^3" }{TEXT -1 75 " . But there is a trick you can use: obtain a new variable that looks \+ like " }{MPLTEXT 0 21 1 "c" }{TEXT -1 127 " but is not the same for Ma ple, and create the expression using that new variable. Then assign t he new variable as a value to " }{MPLTEXT 0 21 1 "c" }{TEXT -1 1 "." } }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " p:= c^3 + c^2 + c + 1;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG,**$)%\"cG\"\"$\"\"\"F**$)F(\"\" #F*F*F(F*F*F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "newc:= `to ols/gensym`(c):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "1 + newc + newc^2 + newc^3;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*\"\"\"F$%\"cG F$*$)F%\"\"#F$F$*$)F%\"\"$F$F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "c:= newc;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"cG%\"cG" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "p;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*\"\"\"F$%\"cGF$*$)F%\"\"#F$F$*$)F%\"\"$F$F$" }}} {PARA 0 "" 0 "" {TEXT -1 166 "In a more complicated case, to create th e new version of the expression you could first convert the expression to a list, permute the elements as desired, substitute " }{MPLTEXT 0 21 4 "newc" }{TEXT -1 5 " for " }{MPLTEXT 0 21 1 "c" }{TEXT -1 33 ", a nd then convert back to a sum." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "plist:= convert(p,list);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&p listG7&\"\"\"%\"cG*$)F'\"\"#F&*$)F'\"\"$F&" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 25 "newc:= `tools/gensym`(c):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "[op(plist[2..4]), plist[1]];" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7&%\"cG*$)F$\"\"#\"\"\"*$)F$\"\"$F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "subs(c=newc,%);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7&%\"cG*$)F$\"\"#\"\"\"*$)F$\"\"$F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "convert(%,`+`);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#,*%\"cG\"\"\"*$)F$\"\"#F%F%*$)F$\"\"$F%F%F%F%" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "c:= newc;" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%\"cG%\"cG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "p;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,*%\"cG\"\"\"*$)F$\"\"#F%F% *$)F$\"\"$F%F%F%F%" }}}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also: " }{TEXT -1 2 " " }{HYPERLNK 17 "sort" 2 "sort" "" }{TEXT -1 2 ", " } {HYPERLNK 17 "`tools/gensym`" 2 "tools/gensym" "" }}}{SECT 0 {PARA 0 " " 0 "" {TEXT 26 22 "Maple Advisor Database" }{TEXT 256 18 " R. Israe l, 1997" }}}}{MARK "1 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }