Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider the following substitution

Derivative[2, 0][S][th, ph] /. S -> Function[{th, ph}, SphericalHarmonicY[3, 0, th, ph]]

which gives correct answer. While for some cases, eg.

Derivative[2, 0][S][th, ph] /. S -> Function[{th, ph}, SphericalHarmonicY[3, 3, th, ph]]

will produce the

Infinity::indet: Indeterminate expression (0 24 \[Sqrt]70 E^(-I \[Phi]) ComplexInfinity)/(12 \[Sqrt]35) encountered. >>

error. Of course the command

D[SphericalHarmonicY[3, 3, th, ph], {th, 2}]

will produce the desired output. So the question is what is wrong with the substitution rule?

share|improve this question
The problem seems to be caused by the Gamma function generated by the direct derivation. Observe the result of Derivative[2, 0][SphericalHarmonicY[3, 3, #, #2] &] and try Limit[Derivative[2, 0][SphericalHarmonicY[3, 3, #, #2] &] /. Gamma[a_] -> Gamma[a + c], c -> 0][th, ph] // Simplify. Not sure if it's a bug or just the property of SphericalHarmonicY. – xzczd Mar 11 '14 at 2:32
This looks rather as a bug... – mmal Mar 26 '14 at 20:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.