Ask Your Question
1

function vs expression

asked 2021-08-29 14:55:38 +0200

eyal gravatar image

Hi there,

Is there a difference between, e.g.,

g=x^2

and

f(x)=x^2

?

In the literature the first is considered to be an expression while the other is a function, but checking their types gives

<class 'sage.symbolic.expression.Expression'>

in both cases.

edit retag flag offensive close merge delete

Comments

Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2021-08-29 19:33:49 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-08-29 15:53:33 +0200

tmonteil gravatar image

You should check their parent:

sage: g.parent()
Symbolic Ring

sage: f.parent()
Callable function ring with argument x

sage: f(x).parent()
Symbolic Ring
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-08-29 14:55:38 +0200

Seen: 167 times

Last updated: Aug 29 '21