A symbol such as an x (lowercase or uppercase) with a line on top of it does not exist as a coded character in Unicode (or any other character code standard). This is why you cannot find it in character pallettes.
However, you can enter such a symbol using a normal letter followed by a combining diacritic mark, which could be U+0304 COMBINING MACRON or U+0305 COMBINING OVERLINE. I have to check my own e-book to see which one is better... yep, overline is generally preferable here, since it is more noticeable (longer). Besides, macron is originally intended for use in linguistics (to indicate long vowel, typically), rather than part of a mathematical notation. But this may also depend on the font used, in practice.
The following image shows the letter x, in italic, with macron, then with overline, and then, for comparison, a formula constructed as suggested in @Rishabh’s answer.
You can enter a combining diacritic mark (which is always entered after the base character it should apply to) in LibreOffice using Insert → Special character, check selecting “Combining Diacritical Marks” in the “Subset” menu and proceeding as usual. When you click on a character in the pallette, you will see the Unicode number (like U+0305) on the right. This is important because the characters are often difficult to distinguish.