1. ## Laplace distribution

I have equation that:
$\displaystyle f(x)=(\lambda/2)exp(-\lambda|x-a|)$
I need to find $\displaystyle F(x)$.
I think the answer is $\displaystyle F(x)=(\lambda/2)exp(-\lambda|x-a|)$
but math book shows me that answer:
$\displaystyle F(x)=\left\{\begin{array}{cc}0.5exp(\lambda(x-a)),&\mbox{ if } x<a\\1-0.5exp(\lambda(a-x)), & \mbox{ if } x\geq a\end{array}\right.$
There are two different answers taking into account cases where $\displaystyle x<a$ and $\displaystyle x\geq a$. Where do these considerations come from?
What I did wrong?

2. Usually $\displaystyle F(x)$ stand for the primitive of the function.
Using the definition of derivative, you can find $\displaystyle \frac{d(e^u)}{dx} = e^u \frac{du}{dx}$
You know that for $\displaystyle x<a$ than $\displaystyle |x-a| \implies -(x-a)$ and $\displaystyle x>a$ than $\displaystyle |x-a| \implies (x-a)$ Draw the graph of $\displaystyle y = |x-a|$ for example it will appear clear to you.
You thus have
$\displaystyle f(x)=(\lambda/2)e^{(\lambda(x-a))}$ if $\displaystyle x<a$ and $\displaystyle f(x)=(\lambda/2)e^{-(\lambda(x-a))}=(\lambda/2)e^{(\lambda(a-x))}$ if $\displaystyle x>a$
Now you fin the primitive of these. For example the seconde is $\displaystyle F(x)=\frac{-1}{2}e^{(\lambda(a-x))}+C$ With initial condition you find that C = 1

3. Originally Posted by totalnewbie
I have equation that:
$\displaystyle f(x)=(\lambda/2)exp(-\lambda|x-a|)$
I need to find $\displaystyle F(x)$.
I think the answer is $\displaystyle F(x)=(\lambda/2)exp(-\lambda|x-a|)$
but math book shows me that answer:
$\displaystyle F(x)=\left\{\begin{array}{cc}0.5exp(\lambda(x-a)),&\mbox{ if } x<a\\1-0.5exp(\lambda(a-x)), & \mbox{ if } x\geq a\end{array}\right.$
There are two different answers taking into account cases where $\displaystyle x<a$ and $\displaystyle x\geq a$. Where do these considerations come from?
What I did wrong?
$\displaystyle f(x) = \frac{\lambda}{2} \, e^{-\lambda (x - a)}$ if $\displaystyle x - a \geq 0 \Rightarrow x \geq a$.

$\displaystyle f(x) = \frac{\lambda}{2} \, e^{-\lambda (a - x)}$ if $\displaystyle x - a < 0 \Rightarrow x < a$.

Both cases have to be considered seperately when calculating F(x).

4. what initial conditions give you C=1?

5. Wait never mind, I see it.

6. $\displaystyle F'(x)=0.5exp^{(\lambda x-\lambda a)}\frac {d}{dx}=0.5e^{(\lambda x- \lambda a)}*\lambda=0.5\lambda e^{(\lambda(x-a))}$
$\displaystyle F'(x)=-0.5exp^{(\lambda a-\lambda x)}\frac {d}{dx}=-0.5e^{( \lambda a- \lambda x)}*{(- \lambda)=0.5\lambda}e^{(\lambda(a-x))}$
Funny, taking the derivative of the primitive function doesn't give to me the right answer.

And inital condition is that $\displaystyle \int f(x) dx = 1$
And:
$\displaystyle \int 0.5\lambda e^{(\lambda(x-a))}dx= 0.5exp^{(\lambda x-\lambda a)} -1$
$\displaystyle \int 0.5\lambda e^{(\lambda(a-x))}dx= -0.5exp^{(\lambda a-\lambda x)} -1$

7. Originally Posted by mr fantastic
$\displaystyle f(x) = \frac{\lambda}{2} \, e^{-\lambda (x - a)}$ if $\displaystyle x - a \geq 0 \Rightarrow x \geq a$.

$\displaystyle f(x) = \frac{\lambda}{2} \, e^{-\lambda (a - x)}$ if $\displaystyle x - a < 0 \Rightarrow x < a$.

Both cases have to be considered seperately when calculating F(x).

Read this: Laplace distribution - Wikipedia, the free encyclopedia
$\displaystyle x \geq a$:

$\displaystyle F(x) = \int_{-\infty}^{x} \frac{\lambda}{2} \, e^{-\lambda (t - a)} \, dt = 1 - \int_{x}^{+\infty} \frac{\lambda}{2} \, e^{-\lambda (t - a)} \, dt$

Substitute $\displaystyle u = t - a$:

$\displaystyle = 1 - \frac{\lambda}{2} \, \int_{x-a}^{+\infty} \, e^{-\lambda u} \, du = 1 - \frac{1}{2} \, \left[ e^{-\lambda u} \right]_{x-a}^{+\infty}$

$\displaystyle = 1 - \frac{1}{2} \, e^{-\lambda (x - a)}$.

$\displaystyle x < a$:

$\displaystyle F(x) = \int_{-\infty}^{x} \frac{\lambda}{2} \, e^{-\lambda (a - t)} \, dt$

Substitute $\displaystyle u = t - a$:

$\displaystyle = \frac{\lambda}{2} \, \int^{x-a}_{-\infty} \, e^{\lambda u} \, du = \frac{1}{2} \, \left[ e^{\lambda u} \right]^{x-a}_{-\infty}$

$\displaystyle = \frac{1}{2} \, e^{\lambda (x - a)}$.