You can use the package
Notation
and symbolize them:
In[]:=
Needs["Notation`"]​​Symbolize[ParsedBoxWrapper[SubscriptBox["x","i"]]]​​Symbolize[ParsedBoxWrapper[SubscriptBox["x","j"]]]
In[]:=
D[D[f[
x
i
,
x
j
],
x
i
],
x
j
]
Out[]=
(1,1)
f
[
x
i
,
x
j
]
If you do that,
x
i
and
x
j
are “fixed”. You won’t be able to iterate it, for example:
In[]:=
Sum[
x
i
,{i,0,1}]
Out[]=
2
x
i
But you can still use other indices for that:
In[]:=
Sum[
x
k
,{k,0,1}]
Out[]=
x
0
+
x
1
since
x
k
was not symbolized:
In[]:=
D[
x
k
,x]
Out[]=
(1,0)
Subscript
[x,k]
​