applyrule
applying rules
Calling Sequence
Parameters
Description
Examples
applyrule(rule, expr)
applyrule([rule1, rule2, ...], expr)
expr
-
expression the rules are applied to
rule
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.
applyrulea+b=x,fa+b+c
fx+c
applyrulex=y,x2
y2
applyrulex2=y,fx2,expsinx+2x2
fy,ⅇsinx+2y
applyrulefa::integerx=afx,f2x+gx−fpx
2fx+gx−fpx
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
applyrulesin2x=2sinxcosx,sinx+sin2x−cosx
sinx+2sinxcosx−cosx
See Also
algsubs
compiletable
define
patmatch
subs
Download Help Document