Ask Your Question

lefthandstander's profile - activity

2019-09-28 20:37:14 +0100 received badge  Notable Question (source)
2018-09-08 20:18:02 +0100 received badge  Popular Question (source)
2017-02-20 19:58:54 +0100 commented answer help on using chain rule in Sage

Great! I see that diff(w,t) at the end gives the same behavior I was observing above. Thanks!

2017-02-20 09:51:34 +0100 received badge  Student (source)
2017-02-20 09:50:09 +0100 asked a question help on using chain rule in Sage

Does anyone have any tips for using Sage to take derivatives of functions of many variables?

For example, if I define

w(x,y) = x^2 + y^2 (say)

and then if I suppose that x and y depend on an independent variable t, the chain rule applies for finding w.diff(t). The only way I found to do this in Sage is


x(t) = cos(t) (say)

y(t) = sin(t)

w(x,y) = x^2 + y^2


But this isn't really using the chain rule. If I instead try


(define w again)

(define x and y again)


Out: (x,y) |--> 0

Apparently it thinks the derivative is zero because it still thinks x and y are two independent variables where they appear in w, even though you get


Out: t |--> cos(t)

and similarly for y. Any suggestions? Thanks.