Do you know what the expected value is? Expected value is the weighed average of the possible values a random variable can assume. Here is the probability density function (i.e. the weight). The analogue for a discrete probability distribution would work like this : suppose you had a random variable which took the values 1, 2, 3 with respective probabilities 0.3, 0.3, 0.4. Then the expected value would be

For a continuous probability distribution the sum is replaced by an integral

where D is the domain of the random variable. You can think of the expected value of a real random variable as the center of mass of a rod whose mass distribution is the probability density function.

To answer your other question : yes, that integral would be done by parts. Set and .