Ask Your Question
1

How to define a generic function of two variable t and r

asked 2024-07-01 11:13:07 +0100

antrock1999 gravatar image

I want to define a generic function of two variables, called t and r, to perform symbolic calculation. Is it possible in sagemath?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2024-07-01 11:48:23 +0100

eric_g gravatar image

updated 2024-07-01 11:48:49 +0100

Like this:

sage: f(t,r) = function('f')(t, r)

Then f stands for the function (technically a callable symbolic expression):

sage: f
(t, r) |--> f(t, r)

and f(t,r) stands for the symbolic expression expressing f acting on (t,r):

sage: diff(r^3*f(t,r), r)
r^3*diff(f(t, r), r) + 3*r^2*f(t, r)
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

Stats

Asked: 2024-07-01 11:13:07 +0100

Seen: 167 times

Last updated: Jul 01