sx is a utility written by genjix which does a whole bunch of things.
If you are asking for the math behind stealth addresses, see Peter Todd's mailing list post
http://www.mail-archive.com/bitcoin-development@lists.sourceforge.net/msg03613.htmlIIRC there is a followup by Jeremy Spilman which explains it in a slightly different way, since PT's notation is a bit awkward, so that's worth reading too.
Andrew