Pdf of $y = - \log(X)$ when $X$ is beta distributed The expected value of $Y$ I want find the PDF of $Y = - \log(X)$ and $X$ has a beta distribution.  I found the below formula as the answer but i think there should be (1-ey)b-1 part should added to this.
Is that correct ?  I also wanna know how to calculate $\text{E}(Y)$. 
$f_Y(y) = e^y$, $f_X(e^{−y})=e^{−y} 1 B(a,1)(e^{−y})^{a−1}=ae^{−ay}$, $0 \leq y < \infty$
 A: Let $Y=-\ln X,\quad X \sim Beta(\alpha,\beta)$ then
$$
F_Y(y)=P(Y<y)=P(-\ln X < y)=P(X > e^{-y})=\int_{e^{-y}}^1\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1}dx
$$
$$
f_Y(y)=\frac{d}{dy}F_Y(y)=\frac{d}{dx}\int_{e^{-y}}^1\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1}dx
=\frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}[(e^{-y})^{\alpha-1}(1-e^{-y})^{\beta-1}(e^{-y})]=e^{-y}f_X(e^{-y})
$$
The expected value
$$
E(Y)=E(-\ln X)=-E(\ln X)
$$
$$
\begin{align}
\operatorname{E}(\ln X) 
&= \int_0^1 \ln x\, f(x;\alpha,\beta)\,dx \\
&= \int_0^1 \ln x \,\frac{ x^{\alpha-1}(1-x)^{\beta-1}}{B(\alpha,\beta)}\,dx \\
&= \frac{1}{B(\alpha,\beta)} \, \int_0^1 \frac{\partial x^{\alpha-1}(1-x)^{\beta-1}}{\partial \alpha}\,dx \\
&= \frac{1}{B(\alpha,\beta)} \frac{\partial}{\partial \alpha} \int_0^1 x^{\alpha-1}(1-x)^{\beta-1}\,dx \\
&= \frac{1}{B(\alpha,\beta)} \frac{\partial B(\alpha,\beta)}{\partial \alpha} \\
&= \frac{\partial \ln B(\alpha,\beta)}{\partial \alpha} \\
&= \frac{\partial \ln \Gamma(\alpha)}{\partial \alpha} - \frac{\partial \ln \Gamma(\alpha + \beta)}{\partial \alpha} \\
&= \psi(\alpha) - \psi(\alpha + \beta)
\end{align}
$$
$$
E(Y)=-E(\ln X)=\psi(\alpha + \beta)-\psi(\alpha)
$$
where $\psi$ is the digamma function.
