On Oct 8, 3:57 pm, Oscar Lazo <[email protected]> wrote:
> Hello!
>
> Is there some way to calculate a total differential in sage? I'm
> thinking of something that in mathematica would be done like this:
>
> In[1]:= f=x^2+y+Sin[z]
> In[2]:= Dt[f,m]
>
> Out[2]= 2 x Dt[x, m] + Dt[y, m] + Cos[z] Dt[z, m]
>
> In sage I get:
>
> sage: var('x y z m')
> sage: f=x^2+y+sin(z)
> sage: diff(x,m)
> 0
>
> My guess is there's no way to do this yet, but I also think It shouldn't
> be too hard to implement.

If you define x,y,z to be functions of m, it does what you want:

sage: var("m")
sage: x=function("x",m)
sage: y=function("y",m)
sage: z=function("z",m)
sage: diff(f,m)
cos(z(m))*D[0](z)(m) + 2*x(m)*D[0](x)(m) + D[0](y)(m)

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to