After run my code, output is

(2^(-2 \[Alpha]) Sqrt[\[Pi]] 
SubscriptBox[\(a\), \(0\)], 
RowBox[{"2", ",", "0"}], ")"}],
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

error . Any suggestion?

  • $\begingroup$ 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. $\endgroup$ – bbgodfrey Apr 8 '16 at 14:33
  • 1
    $\begingroup$ As a rule of thumb avoid Subscripts in Mathematica unless you are typesetting something $\endgroup$ – Sektor Apr 8 '16 at 14:50
  • $\begingroup$ @Sektor How use of Subscript[a, 0][x, y] in Mathematica? $\endgroup$ – bahram Apr 8 '16 at 15:29
  • $\begingroup$ Or what is correct form? $\endgroup$ – bahram Apr 8 '16 at 15:44
  • $\begingroup$ With respect to the comment by @Sektor, just use a0, for instance. $\endgroup$ – 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.

  • $\begingroup$ 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. $\endgroup$ – bahram Apr 8 '16 at 15:06
  • $\begingroup$ @Bahram What error do you have? Did you copy the Rule in my answer and apply it to your original expression? $\endgroup$ – bbgodfrey Apr 8 '16 at 15:11
  • $\begingroup$ If possible for you which put complete code with 'FullForm'. $\endgroup$ – bahram Apr 8 '16 at 15:24
  • $\begingroup$ @Bahram Just type //FullForm or, better yet, //InputForm after the code at the top of your question and run it. $\endgroup$ – bbgodfrey Apr 8 '16 at 15:31
  • $\begingroup$ I have problem with "//InputForm " and ''//FullForm". $\endgroup$ – bahram Apr 8 '16 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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