# Density probability function and distribution of $Y=cosX$

I have the following problem.

Let X be a random variable uniformly distributed on $[-1,1]$ and let be $Y=cos(X)$.

a) Find the function of density and distribution of Y

b) Find the espectation of Y ,E(Y).

For a), I put the following;

Let G be the function of distribution of Y, then

$$G(y)=P(Y\leq y)=P(cos(X)\leq y)$$

But from here I don't know how to proceed! This is because cos is nos strictly inceasing or decreasing functon and I dont have any idea about how to use arccos function.

Any help would be appreciated.

• You can do part (b) without knowing how to do solve part (a). Read about the law of the unconscious statistician which tells you how to find the expected value $E[g(X)]$ of a function of $X$ without first finding the pdf of $g(X)$: all that is needed is the pdf of $X$ and knowing the antiderivative of $\cos(x)$. – Dilip Sarwate Jun 19 '15 at 3:13

## 1 Answer

Sketch the graph of $y=cos(x)$ for $-1\leq x\leq 1$.

The support of $Y$ will be $(\cos 1; 1]$.   This will be a fold of two halves of the support of $X$.   We map back to these intervals by two semiinversions: $x_1={+}\arccos(y)$ and $x_2={-}\arccos y$.

Thus use the change of variable transformation: $$f_Y(y) = f_X\big({+}\arccos(y)\big)\left\lvert\frac{{+}\mathrm d \arccos(y)}{\mathrm d y}\right\rvert + f_X\big({-}\arccos(y)\big)\left\lvert\frac{{-}\mathrm d \arccos (y)}{\mathrm d y}\right\rvert$$

Then : $\; \mathsf E(Y) = \int_{\cos 1}^1 y\;f_Y(y)\operatorname d y = \ldots$

And : $\; F_Y(y) = \int_{\cos 1}^y f_Y(t)\operatorname d t \mathbf 1_{y\in(\cos 1;1]}+\mathbf 1_{y\in(1;\infty)}$

Alternatively, we note that: \begin{align} F_Y(y) & = \mathsf P(Y\leq y) \\[1ex] & = \mathsf P( X\leq -\arccos (y) \cup X\geq \arccos (y)) \\[1ex] & = \left(\frac{-\arccos (y) +1}{2}+\frac{1-\arccos (y)}{2}\right)\mathbf 1_{y\in[\cos 1; 1]}+\mathbf 1_{y\in(1;\infty)} \\[1ex] & = 1-\arccos y \end{align}

Hint: $\frac{\mathrm d \arccos y}{\mathrm d y} = \frac {-1}{\sqrt{1-y^2}}$