Does this behavior make sense?



On Mon, Feb 09, 2004 at 08:02:45AM -0500, Dan Stanger wrote:
> c1 depends(a,[b,b,b]);
> d1 [a(b, b, b)]
> c2 diff(a,b)
> 3 * (da/db)
> 
> Shoudn't it be da/db?
> 

It seems it should be neither 3*(da/db) nor da/db.

If one needs to declare a function "a"  which depends on a single
variable "b", it is not correct to write a(b,b,b), or a(b,b).
Correct declaration would be a(b). In order to exclude *declarations*
like a(b,b,b) it would be helpful to use setify([b,b,b]):

(C2) depends(a,setify([b,b,b]));
(D2)                                [a(b)]

*Expressions* like a(b,b,b) may appear if one has a function in a 3-d
space, a(x,y,z) and put x:b,y:b,z:b. In this case a(b,b,b) will be
the value of function a(x,y,z) in the point (b,b,b), which cannot be
subjected to diff., because derivation needs the function to be known not
only in the point (b,b,b), but also in slightly deviating points.
The direction of the deviation must be specified explicitly.
This can be done by defining another function of a single variable ep:
a1(ep):=a(b+alf*ep,b+bet*ep,b+gam*ep). Here vector (alf,bet,gam) specifies
direction in which one takes the derivative. It is expected that alf^2+
bet^2+gam^2=1. Finally, in order to get derivative of function a(x,y,z)
in the point (b,b,b) along the direction (alf,bet,gam) one needs to take
diff(a1,ep) and put ep:0 in the result.
--
Alexander