# [Maxima] dy(x)/dy

N.A.Beishuizen at ctw.utwente.nl N.A.Beishuizen at ctw.utwente.nl
Sun Nov 30 12:39:45 CST 2008

```>> I try to take the next derivative:
>> d/dy(y(x))
>>
>> (%i) d: diff(y(x),x);
>> (%o) d/dy(y(x))
>
>I guess you confuse diff(y(x),x) and diff(y(x),y).

Yes, sorry about the typo.
What I meant was why d: diff(y(x),y) is not evaluated as 1

>> Why?
>> I expect this expression to be 1, like in the following:
>> (%i) d: diff(y,x);
>> (%o) 1

>  diff(y,x) => 0
>
>
>unless you assigned y : x + %c.

Hmm, I must be tired. Again, I meant diff(y,y) will be 1, but
diff(y(x),y) stays unevaluated

>> I then try to fix this by substitution:
>>
>> (%i) d: subst(y,y(x),d);
>> (%o) 1
>>
>> but this does not work for double derivatives:
>> (%i) d: diff(diff(y(x),y),x);
>> (%i) d: subst(y,y(x),d);
>> (%o) d^2y/dxdy

>  diff(y(x),y) => 'diff(y(x),y,1)
>  diff(y(x),y,2) => 'diff(y(x),y,2)
>  diff(y(x),y(x)) => 1
>  diff(y(x),y(x),2) => 0

>> Why this behaviour and how can I make it work the way I want
>> without explicitly declaring dependencies?

>  depends(y,x) ?

that contradicts the statement:
>> without explicitly declaring dependencies?

Actually, y does not depend on x, but dy/dx does exist in my problem (determining nth prolongation in symmetry analysis). The alternative is using 'diff(y,x), but then
'diff(y,y) will also stay unevaluated, unless I build in checks to determine what the second
argument is. Maybe I should use a defrule and treat dy/dx as something special.

Regards,
Nijso

```