I am trying to write a function in mathematica which depends on different parameters. For example
$$f(x_1, x_2, x_3, x_4, x_5)= 2x_1+\sin(x_2)+x_3*x_4-x_5^{-1}$$
(My actual function has 12 such parameters $x_i$'s and the expression on the rhs is very long and complicated looking). I would like to use subscripts to make the expressions readable and also easy for me to catch typos. My goal is to investigate the behavior of a function like $f$ above using different values for $x_i$.
However, mathematica does not seem to work with subscripts well. I tried "Symbolize" using Notation package. However that does not let me evaluate the function when I plug in different values for $x_i$ such as $x_1=1, x_2=\pi,x_3=1, x_4=4, x_5=1$. It just gives me back $f[1, \pi, 1, 4, 1]$ instead of $5$. I can use "Subscript[]" but that would add more "words" to my expression and make it unreadable.
Thus is there another way of using variables with subscripts that can be evaluated using a number?


f[x1_, x2_, x3_, x4_, x5_] := 2 x1 + Sin[x2] + x3*x4 - x5^-1. Especially if your subscripts are numbers I encourage you to use this instead as this form is easier to input and work with. – Mr.Wizard Jun 16 '20 at 02:51