First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 6 years ago

dsejas gravatar image

Direct substitution vs "subs" method

Suppose I define

var('a b c')
formula = a^2 + 5*b + c

Then I would like to substitute some values, like a=2, b=2 and c=4. As far as I'm aware, there are two options to do this:

formula(a=2, b=2, c=4)

and

formula.subs(a=2, b=2, c=4)

In this particular case, is there any difference between this two options? Is there any difference in some other case(s)? Thanks in advance for you answers!

Direct substitution vs "subs" method

Suppose I define

var('a b c')
formula = a^2 + 5*b + c

Then I would like to substitute some values, like a=2, b=2 and c=4. As far as I'm aware, there are two options to do this:

formula(a=2, b=2, c=4)

and

formula.subs(a=2, b=2, c=4)

In this particular case, is there any difference between this two options? Is there any difference in some other case(s)? Thanks in advance for you answers!

Direct substitution vs "subs" method

Suppose I define

var('a b c')
formula = a^2 + 5*b + c

Then I would like to substitute some values, like a=2, b=2 and c=4. As far as I'm aware, there are two options to do this:

formula(a=2, b=2, c=4)

and

formula.subs(a=2, b=2, c=4)

In this particular case, is there any difference between this two options? Is there any difference in some other case(s)? case(s)?

Thanks in advance for you answers!

Direct substitution vs "subs" method

Suppose I define

var('a b c')
formula = a^2 + 5*b + c

Then I would like to substitute some values, like a=2, b=2 and c=4. As far as I'm aware, there are two options to do this:

formula(a=2, b=2, c=4)

and

formula.subs(a=2, b=2, c=4)

In this particular case, is there any difference between this two options? Is there any difference in some other case(s)?

Thanks in advance for you answers!

click to hide/show revision 5
retagged

updated 3 years ago

FrédéricC gravatar image

Direct substitution vs "subs" method

Suppose I define

var('a b c')
formula = a^2 + 5*b + c

Then I would like to substitute some values, like a=2, b=2 and c=4. As far as I'm aware, there are two options to do this:

formula(a=2, b=2, c=4)

and

formula.subs(a=2, b=2, c=4)

In this particular case, is there any difference between this two options? Is there any difference in some other case(s)?

Thanks in advance for you answers!