v = Subscript[v, 0]*Sin[(Pi*S)/Subscript[S, 0]];
a = dv/ds v;
a = D[v, s]


$RecursionLimit::reclim: Recursion depth of 256 exceeded.

Reference in the link shown by error msg doesn't give me a relief. I'm assuming the root cause is that I'm not assigning concrete values to the variables. But here I want to operate differentiation w/o assigning values (is there explicit name in math for this kind of operation?). Don't even know if it's differentiation specific or general issue for an operation not assigning concrete values (and thus can't assign proper tags to this question either). I haven't been able to find the corresponding reference. Thanks.

Update) Code @acl gave works for me now. However, I'm just curious why my code returns the same error even after I corrected "S" to "s", and also removed 2nd line which I didn't really expect Mathematica to do anything for.

  • $\begingroup$ Regarding the update, is my explanation not sufficient? $\endgroup$
    – acl
    Commented Feb 13, 2012 at 19:24
  • $\begingroup$ @acl yes, I guess in my particular situation the variable v might contain something and thus Mathematica tried to evaluate it. Thx $\endgroup$
    – IsaacS
    Commented Feb 14, 2012 at 19:52
  • $\begingroup$ This occurs without anything being bound tov. It is just like k=k+1, which would work in C but in mathematica causes this. $\endgroup$
    – acl
    Commented Feb 14, 2012 at 19:54

1 Answer 1


The error comes from the first line. I am not sure what the second does; finally, you differentiate with respect to s, but have a variable S, which is different.

Perhaps you wanted to do this:

v = v0*Sin[Pi*s/s0]
D[v, s]

which works.

To see the problem with recursion, run this:

v = Subscript[v, 0]

enter image description here

What is happening is the same that happens if you evaluate k = k + 1.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.