Substitute
Substitute[ exprorg, expr1, expr2 ]
Substitute[ exprorg, expr1, expr2 ] substitutes all occurrences of expression expr1 with expression expr2 in a given expression exprorg .
| Example | in | out | reduced |
|---|---|---|---|
The expression x^4 + x^2+ 3x^2 + 6 with all occurrences of x^2 replaced by p. |
Substitute[x^4 + x^2+ 3x^2 + 6, x^2, p ] |
x^4 + p + 3p + 6 |
x^4 + 4p + 6 |