How to use Arabic symbols as mathematical variables?
You can do it, but I don't think your readers will be happy.
\documentclass{article}
\usepackage{amsmath}
\DeclareRobustCommand{\waw}{{\text{\usefont{U}{xnsh}{m}{n}\symbol{240}}}}
\begin{document}
$\waw+3=x_{\waw}$
\end{document}
You can create a table of the font with
\documentclass{article}
\usepackage{fonttable}
\begin{document}
\xfonttable{U}{xnsh}{m}{n}
\end{document}
If you can display the character in text mode, you can wrap the command in \textnormal
to display it in math mode. It might be a good idea to additionally wrap it in \mathord
to prevent ligatures in what should be a product of separate variables.
For example, you can support OpenType fonts this way, and display Arabic correctly simply by typing it in. This MWE is for recent versions of LuaLaTeX, but the definition of \mwaw
ought to work with whatever method you use to display the character.
\documentclass{article}
\tracinglostchars=2
\usepackage[english, bidi=basic, layout=sectioning.tabular]{babel}
\usepackage{unicode-math}
\defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX, Renderer=HarfBuzz }
% You can substitute your fonts of choice here. Any OpenType or TrueType
% font should work.
\babelfont{rm}
[Ligatures=Common, Language=Default, Scale=1.0]{Libertinus Serif}
\babelfont{sf}
[Ligatures=Common, Language=Default]{Libertinus Sans}
\babelfont{tt}
[Language=Default]{Libertinus Mono}
\babelprovide[import=ar, onchar=ids fonts]{arabic}
\babelfont[arabic]{rm}
[Ligatures=Common]{Amiri}
% Specify \babelfont[arabic]{sf} here, if needed.
\babelfont[arabic]{tt}
{ALM Fixed}
\setmathfont{Libertinus Math}
\newcommand\mwaw{\mathord{\textnormal{و}}}
\begin{document}
$\mwaw+3=x_{\mwaw}$
\end{document}