I'm pretty sure I'm misunderstanding something, so this isn't so much an answer as an attempt to force more clarity.
Here is a function:
theFunction[arg1_, arg2_, arg3_, arg4_, arg5_, arg6_, arg7_] :=
((arg1*arg2^2*arg4^3 + arg1*(arg2^2*arg4^3 + 2*arg1*(arg2 + arg2*arg4^3)))*arg5*arg6*Sqrt[Pi])/
(2*arg3^2*(arg2 + arg2*arg4^3)^(3/2)) -
((arg1*arg2^2*arg4^4 + arg1*(arg2^2*arg4^4 + 2*arg3*(arg2*arg4 + arg2*arg4^3)))*arg6*arg7*Sqrt[Pi])/
(2*arg1^2*(arg2*arg3^3 + arg2*arg4)^(3/2))
Applying the function as follows will reproduce your original expression:
theFunction[a, b, c, d, r[1, 1], r[1, 4], r[5, 2]]
And so, in the specific example you gave in one of your comments:
theFunction[1, 2, 1, 1, 2, 3, 5]
(* -9*Sqrt[Pi] *)
Is that what you're after?