Difference between revisions of "Substitute Command"

From GeoGebra Manual
Jump to: navigation, search
m
m (Text replace - ";(.*)\[(.*)\]" to ";$1($2)")
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|geogebra}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|geogebra}}
 
==CAS Syntax==
 
==CAS Syntax==
;Substitute[ <Expression>, <from>, <to> ]
+
;Substitute( <Expression>, <from>, <to> )
 
:Substitutes ''from'' in ''expression'' with ''to''.
 
:Substitutes ''from'' in ''expression'' with ''to''.
 
:{{examples| 1=<div>
 
:{{examples| 1=<div>
 
:*<code><nowiki>Substitute[(x^2 / (4x + 6))^2 + 6(x^2 / (4x + 6)) + 8, x^2, a*(4x + 6)]</nowiki></code> yields ''a<sup>2</sup> + 6 a + 8''.
 
:*<code><nowiki>Substitute[(x^2 / (4x + 6))^2 + 6(x^2 / (4x + 6)) + 8, x^2, a*(4x + 6)]</nowiki></code> yields ''a<sup>2</sup> + 6 a + 8''.
 
:*<code><nowiki>Substitute[(3 m - 3)^2 - (m + 3)^2, m, a]</nowiki></code> yields ''8 a<sup>2</sup> - 24 a''.</div>}}
 
:*<code><nowiki>Substitute[(3 m - 3)^2 - (m + 3)^2, m, a]</nowiki></code> yields ''8 a<sup>2</sup> - 24 a''.</div>}}
;Substitute[ <Expression>, <Substitution List> ]
+
;Substitute( <Expression>, <Substitution List> )
 
:Substitutes in ''expression'' every variable of the list with the variable or number you choose for it.
 
:Substitutes in ''expression'' every variable of the list with the variable or number you choose for it.
 
:{{example| 1=<code><nowiki>Substitute[2x + 3y - z, {x = a, y = 2, z = b}]</nowiki></code> yields ''2a - b + 6''.}}
 
:{{example| 1=<code><nowiki>Substitute[2x + 3y - z, {x = a, y = 2, z = b}]</nowiki></code> yields ''2a - b + 6''.}}

Revision as of 17:16, 7 October 2017


CAS Syntax

Substitute( <Expression>, <from>, <to> )
Substitutes from in expression with to.
Examples:
  • Substitute[(x^2 / (4x + 6))^2 + 6(x^2 / (4x + 6)) + 8, x^2, a*(4x + 6)] yields a2 + 6 a + 8.
  • Substitute[(3 m - 3)^2 - (m + 3)^2, m, a] yields 8 a2 - 24 a.
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}] yields 2a - b + 6.
© 2024 International GeoGebra Institute