# How to find the moment generating function of this distribution

If $f(x) = 0.5 e^{-|x|}$ for $-\infty < x < \infty$, how would you find the moment generating function for this? Also how would you find the distribution of $Y = |X|$?

Attempt:

$$E(e^{tX}) = \int_{-\infty}^\infty f(x) e^{tx} \; dx.$$

• Hint: continue your attempt, separating the integral into an integral on $x\lt0$, where $f(x)=\frac12\mathrm e^x$, and an integral on $x\gt0$, where $f(x)=\frac12\mathrm e^{-x}$. – Did Feb 28 '12 at 13:52
• I get (1/(t-1))*(e^infinity -1) when x is positive. I am not sure what I am doing wrong. – lord12 Feb 28 '12 at 14:11
• The pdf doesn't integrate to one. I think there is a .5 in the exponential term. – Stuck_pls_help Feb 28 '12 at 15:01

As Didier Piau stated: \begin{align} E(e^{tX}) & = \int_{-\infty}^\infty f(x) e^{tx} \ dx=\int_{-\infty}^0 f(x) e^{tx}\ dx+\int_0^\infty f(x) e^{tx}\ dx \\ \\ & =\int_{-\infty}^0 0.5e^x e^{tx}\ dx + \int_0^\infty 0.5 e^{-x} e^{tx}\ dx \\ \\ & = 0.5\left(\int_{-\infty}^0 e^{(t+1)x}\ dx+\int_{0}^\infty e^{(t-1)x} \ dx\right) = \frac{0.5}{t+1}-\frac{0.5}{t-1},\quad t\in (-1,1) \end{align}
For the distribution of $Y=|X|$ we have the general rule for a transformation of the form $y=h(x)$ in our case $Y=|X|$ with $Y\in [0,+\infty)$: $g(y)=f(h^{-1}(y))|\frac{d(h^{-1}(y))}{dy}|$. Applying this rule to your problem will give you the distribution of Y.
• One can simplify $E(\mathrm e^{tX})$ to $1/(1-t^2)$. – Did Feb 28 '12 at 15:53
{"ft_lang_label":"__label__en","ft_lang_prob":0.66053754,"math_prob":0.9999876,"size":1321,"snap":"2019-35-2019-39","text_gpt3_token_len":505,"char_repetition_ratio":0.15034169,"word_repetition_ratio":0.36548224,"special_character_ratio":0.41256624,"punctuation_ratio":0.096551724,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999925,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-22T20:11:56Z\",\"WARC-Record-ID\":\"<urn:uuid:a7c78090-66d3-46a2-81db-220486cd6838>\",\"Content-Length\":\"139104\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:77bc5177-f40b-4833-bd32-d0cdf67d0786>\",\"WARC-Concurrent-To\":\"<urn:uuid:d7c8b137-f691-4b02-b43a-fe3cf1479100>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/114426/how-to-find-the-moment-generating-function-of-this-distribution/114447\",\"WARC-Payload-Digest\":\"sha1:OLLUKHECEVYGLEO73VBZZOXHQ5F4FIZN\",\"WARC-Block-Digest\":\"sha1:SXQG4V7TTCDPSMTETBA7SWTJJTGVV4LQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514575674.3_warc_CC-MAIN-20190922201055-20190922223055-00491.warc.gz\"}"}