\underline{} not working when trying to underline maths

Things I have tried

What I’m trying to do

I am trying to underline in math mode like this: $k[\underline{x}]$ but no underline appears