There is an expression
(Sqrt[\[Pi]] (a b^2 d^3 + a (b^2 d^3 + 2 a (b + b d^3))) r[1, 1] r[1, 4])/(2 c^2 (b + b d^3)^(3/2)) - ( Sqrt[\[Pi]] (a b^2 d^4 + a (b^2 d^4 + 2 c (b d + b d^3))) r[5, 2] r[ 1, 4])/(2 a^2 (b d + b c^3)^(3/2))
where a, b, c, d, r[1, 1], r[1, 4], r[5, 2] are variables.
I would like to write this expression as a function f where a, b, c, d, r[1, 1], r[1, 4], r[5, 2] are variables. It can be indicated that a, b, c and d are variables as follows f[a_,b_,c_,d_]:= the expression, but how can I specify that r[1, 1], r[1, 4] and r[5, 2] are also variables f[a_,b_,c_,d_,...]:= the expression?
f[a_,b_,c_,d_,r_]:=the expression. – Alan May 19 '23 at 14:00r[1, 1],r[1, 4],r[5, 2]andr[1, 4]have different values – Mam Mam May 19 '23 at 14:08a=1,b=2,c=1,d=1andr[1, 1]=2,r[1, 4]=3,r[5, 2]=5,r[1, 4]=6, that is, it can be specified in the functionf[1,2,1,1, but how to specify values for r[...,...]]? – Mam Mam May 19 '23 at 14:12allowNonSymboltherein is exactly for the task. – xzczd May 19 '23 at 14:25r[1, 4]twice in each of the four variable lists; the last time, in a comment, you give it two different values. Why? How can the same expression have two different values simulataneously? Is it a mistake? – Michael E2 May 19 '23 at 16:26fthus:f[1,2,1,1, <|1 -> <|1 -> 2, 4 -> 3 (* or 6 *)|>, 5 -> <|2 -> 5|>|>]. – Michael E2 May 19 '23 at 17:04