How to | Create and Use Rules
Transformation rules in the Wolfram Language let you set local values for symbols, functions, and all other types of expressions. Using rules provides a powerful and extensible method to replace all or part of another expression with the value you specify.
The short form for a rule uses a right arrow, which you get by typing -> (with no space between - and >). The Wolfram System front end automatically converts -> into upon further typing. Either symbol is a short form for Rule.
By looking at the output for x3, you can see that this rule does not do anything: the output is simply the rule itself. This is because rules do not do anything when they are alone. You must use a rule with an expression for it to be of any use.
Rules can be applied to expressions by using /. (the short form for ReplaceAll). The general syntax for this is expr/.rules.
For more information on using patterns, see "Introduction to Patterns."
You may need to use delayed rules instead, which are not evaluated until they are used with an expression. Delayed rules are created by using RuleDelayed.
The short form for a delayed rule is :> (with no space between : and >). The Wolfram System front end automatically converts :> into upon typing. Either represents the short form for RuleDelayed: