Error in partial derivative and replace?

After run my code, output is

(2^(-2 \[Alpha]) Sqrt[\[Pi]]
\!$$\*SuperscriptBox[ SubscriptBox[\(a$$, $$0$$],
TagBox[
RowBox[{"(",
RowBox[{"2", ",", "0"}], ")"}],
Derivative],
MultilineFunction->None]\)[x, y])/(\[Alpha] Gamma[\[Alpha]] Gamma[
1/2 + \[Alpha]])


I want to replace the following output in it:

Subscript[a, 0][x, y] -> -(1/4) E^((Sqrt[r] (x + y))/(2 Sqrt[2]))


But I have error

. Any suggestion?

• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Apr 8 '16 at 14:33
• As a rule of thumb avoid Subscripts in Mathematica unless you are typesetting something – Sektor Apr 8 '16 at 14:50
• @Sektor How use of Subscript[a, 0][x, y] in Mathematica? – bahram Apr 8 '16 at 15:29
• Or what is correct form? – bahram Apr 8 '16 at 15:44
• With respect to the comment by @Sektor, just use a0, for instance. – bbgodfrey Apr 8 '16 at 16:47

Use FullForm or, more conveniently here, InputForm to see what the original expression looks like internally:

(Sqrt[Pi]*Derivative[2, 0][Subscript[a, 0]][x, y])/(2^(2*α)*α*Gamma[α]*Gamma[1/2 + α])


Subscript[a, 0][x, y] does not actually appear here. Instead, Derivative[2, 0][Subscript[a, 0]][x, y] does. Consequently, the whole derivative must be replaced. Use

Derivative[2, 0][Subscript[a, 0]][x, y] ->
D[-(1/4) E^((Sqrt[r] (x + y))/(2 Sqrt[2])), {x, 2}]


which yields

(* -((2^(-5 - 2 α) E^((Sqrt[r] (x + y))/(2 Sqrt[2]))Sqrt[π] r)/
(α Gamma[α] Gamma[1/2 + α])) *)


This particular Mathematica behavior is not at all user-friendly.

• I use FullForm[(2^(-2 [Alpha]) Sqrt[[Pi]] \!(*SuperscriptBox[ SubscriptBox[(a), (0)], TagBox[ RowBox[{"(", RowBox[{"2", ",", "0"}], ")"}], Derivative], MultilineFunction->None])[x, y])/([Alpha] Gamma[[Alpha]] Gamma[ 1/2 + [Alpha]])] and I have error. – bahram Apr 8 '16 at 15:06
• @Bahram What error do you have? Did you copy the Rule in my answer and apply it to your original expression? – bbgodfrey Apr 8 '16 at 15:11
• If possible for you which put complete code with 'FullForm'. – bahram Apr 8 '16 at 15:24
• @Bahram Just type //FullForm or, better yet, //InputForm after the code at the top of your question and run it. – bbgodfrey Apr 8 '16 at 15:31
• I have problem with "//InputForm " and ''//FullForm". – bahram Apr 8 '16 at 16:00