| 1 | initial version |
Look at the help of derivative. It works on symbolic functions, polynomials, and symbolic expressions. Your variable u is not a function, so it is not really being considered a two dimensional symbolic expression or function. If you do
sage: u(x,y) = matrix(1,2,[-1,1])
sage: derivative(u, x)
(x, y) |--> 0
then you can see that it is considering it as a two dimensional function. In the second case, you have a function of one variable in the variable x.
The alternative fix is to work in the symbolic ring:
sage: u = matrix(SR, [-1,1])
sage: derivative(u,x)
[0 0]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.