this is a problem in my math book, and I really need to know how to solve these kinds of problems, so any help would really be appreciated.
This is the problem: In a cylinder with the volume a, you pour the volume $X$ of a liquid. (If $X>a$ then of course some of the liquid will pour out.). Here X is a Random variable with Probability density function $f_X(x)=(x+1)^{-2}, x\geq 0$. Let $Y$ be the volyme of the liquid that is in the cylinder after it has been filled. Calculate $E(Y)$.
All I know is that the answer is $ln(a+1)$. I have no idea how to get there though.
Thanks in advance.
It's a simple partition. $Y=X~\mathbf 1_{X< a}+a~\mathbf 1_{ X>a}$, and so Linearity of Expectation says: $$\begin{align}\mathsf E(Y) ~=~& \mathsf E( X~\mathbf 1_{X\leq a})+\mathsf E(a~\mathbf 1_{ X>a}) \\[1ex] =~& \mathsf E(X\mid X\leq a)~\mathsf P(X\leq a) + a~\mathsf P(X > a) \\[1ex] =~& \int_0^a x~f_X(x)\operatorname d x + a\int_a^\infty f_X(x)\operatorname d x\end{align}$$
NB: $\mathbf 1_{x\leq a}= \begin{cases}1 & : & x\leq a\\0 &:& \text{otherwise}\end{cases}\\\mathbf 1_{x> a}= \begin{cases}1 & : & x> a\\0 &:& \text{otherwise}\end{cases}$