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

Online Help

All Products    Maple    MapleSim


applyrule

applying rules

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

applyrule(rule, expr)

applyrule([rule1, rule2, ...], expr)

Parameters

expr

-

expression the rules are applied to

rule

-

rule

Description

• 

With applyrule a rule or a list of rules can be applied to a given expression. applyrule computes the fix point, it applies the rules until no rule can be applied any more. It is more powerful than the command subs, but does not do mathematical transformations as algsubs does.

• 

Rules are given as equations or in the syntax of the pattern matcher with parameters. See patmatch.

Examples

applyrulea+b=x,fa+b+c

fx+c

(1)

applyrulex=y,x2

y2

(2)

applyrulex2=y,fx2,expsinx+2x2

fy,ⅇsinx+2y

(3)

applyrulefa::integerx=afx,f2x+gxfpx

2fx+gxfpx

(4)

applyrulea::even=even,a::prime=prime,1,2,4,3,5,6,4,8,15,21

1,even,even,prime,prime,even,even,even,15,21

(5)

applyrulesin2x=2sinxcosx,sinx+sin2xcosx

sinx+2sinxcosxcosx

(6)

See Also

algsubs

compiletable

define

patmatch

subs