Given is the density function

$f(x)=\left\{\begin{matrix} \frac{1}{\pi}\frac{1}{1+x^2}\text{ if }x\geq 0\\ \frac{1}{2}e^x \;\;\;\;\text{ else} \end{matrix}\right. \;\;\;\;$

Determine the (cumulative) distribution function from this density function.

I'm not quite sure how this is done correctly but I need to know it because I need this for another thing I wanted calculate :p

If I understood correctly, you determine the distribution function by taking the integral of the density function.

So we have that $$F(x) = \int_{-\infty}^{x}f(t) dt$$

Now we need to cover all cases:

$x < 0$: $$F(x) = \int_{-\infty}^{0}\frac{1}{2}e^t dt = \left[\frac{1}{2}e^t\right]_{-\infty}^{0}=\frac{1}{2}-(0)=\frac{1}{2}$$

$x \geq 0$: $$F(x)=\int_{0}^{\infty}\frac{1}{\pi} \cdot \frac{1}{1+t^2}dt = \left[\frac{1}{\pi} \cdot \arctan(t)\right]_{0}^{\infty}=\left(\frac{1}{\pi} \cdot \frac{\pi}{2}\right)- \left(\frac{1}{\pi} \cdot 0\right)=\frac{1}{2}$$

Is it really correct like that? Because if this is wrong my next calculation will be wrong too! :(


As you write: $$F(x)=\int_{-\infty}^xf(t)dt.$$ So if $x < 0$ you have that $$F(x)=\int_{-\infty}^xf(t)dt=\int_{-\infty}^x\frac{1}{2}e^tdt=\frac12 e^x$$ If $x \ge 0$ you have that $$F(x)=\int_{-\infty}^xf(t)dt=\int_{-\infty}^0\frac{1}{2}e^tdt+\int_0^x\frac1\pi\frac{1}{1+t^2}dt=\frac12 + \frac{1}{\pi}\arctan(x).$$ So

$$F(x)=\begin{cases} \frac12e^x & \mbox{if }x < 0 \\ \frac12+\frac1\pi \arctan (x) & \mbox{if } x \ge0 \end{cases}$$


For $x<0:$$$F(x)=\int_{-\infty}^{x}f(u)du=\int_{-\infty}^{x}\dfrac{1}{2}e^udu=\dfrac{1}{2}e^x$$and for $x>0$$$F(x)=\int_{-\infty}^{x}f(u)du=\int_{-\infty}^{0}f(u)du+\int_{0}^{x}f(u)du=\dfrac{1}{2}+\int_{0}^{x}\dfrac{1}{\pi}\dfrac{1}{1+u^2}=\dfrac{1}{2}+\dfrac{1}{\pi}\tan^{-1}(x)$$

  • $\begingroup$ For the second case it needs to be $x \geq 0$ instead of $x>0$, right? $\endgroup$
    – cnmesr
    Jan 27 '18 at 19:16
  • 3
    $\begingroup$ @cnmesr - either of the cases can be used here to find $F(0)=\frac12$, the first with $x \le 0$ and the second with $x \ge 0$. It makes little difference here integrating a density, but might matter more for a non-continuous cumulative distribution function $\endgroup$
    – Henry
    Jan 27 '18 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.