I'm sure you know this, but for readers who aren't familiar with Japanese, it might be worth saying that hiragana, katakana and kanji aren't strictly interchangeable. Sure you can use hiragana and katakana as a fallback when you cannot or don't want to use the kanji for various reasons, but normally in every situation there's a recommended script to use in order to write correct Japanese.
Some contexts might call for all hiragana variables, some all katakana, and some using the most likely/appropriate form of the word, including kanji. And in the third case, you’re still going to end up with discrepancies since not everyone agrees on when to use kanji.
変数
へんすう
ヘンスウ (or even ヘンスウ)
variable
VARIABLE
variable
VARIABLE
…and all the additional snakes and camels varying the notations further.It's a short article but maybe capitals have been useful overall