First time here? Check out the FAQ!

Ask Your Question
1

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

asked 0 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 0 years ago

eric_g gravatar image

updated 0 years ago

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)
Preview: (hide)
link

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: 0 years ago

Seen: 182 times

Last updated: Jul 01 '24