Difference between revisions of "Substitute Command"
From GeoGebra Manual
Line 3: | Line 3: | ||
;Substitute[ <expression>, <from>, <to> ] | ;Substitute[ <expression>, <from>, <to> ] | ||
:Substitutes ''from'' in ''expression'' with ''to''. | :Substitutes ''from'' in ''expression'' with ''to''. | ||
− | :{{example| 1=<div><code><nowiki>Substitute[(3 m - 3)^2 - (m + 3)^2, | + | :{{example| 1=<div><code><nowiki>Substitute[(3 m - 3)^2 - (m + 3)^2, m, a]</nowiki></code> gives ''(3 a - 3)<sup>2</sup> - (a + 3)<sup>2</sup>''.</div>}} |
+ | ;Substitute[ <Expression>, <Substitution List> ] | ||
+ | :Substitutes in ''expression'' every variable of the list with the variable or number you choose for it. | ||
+ | :{{example| 1=<div><code><nowiki>Substitute[2x+3y-z,{x=a,y=2,z=b}]</nowiki></code> returns ''2a-b+6''.</div>}} |
Revision as of 15:02, 10 August 2011
This command works in CAS View only.
- Substitute[ <expression>, <from>, <to> ]
- Substitutes from in expression with to.
- Example:
Substitute[(3 m - 3)^2 - (m + 3)^2, m, a]
gives (3 a - 3)2 - (a + 3)2.
- Substitute[ <Expression>, <Substitution List> ]
- Substitutes in expression every variable of the list with the variable or number you choose for it.
- Example:
Substitute[2x+3y-z,{x=a,y=2,z=b}]
returns 2a-b+6.