It doesn't fully answer your question, but here's a TED talk from Terry Moore on how "x" came to represent a variable quantity.