# Calculating c constant for continuous random variable PDF

This question was given to me as a review for an upcoming exam.

Calculate the constant $$c$$:

$$f_X(x) =\begin{cases} c * \ln(x) & 1 \leq x \leq 2 \\ 0 & \text{otherwise} \end{cases}$$

My work:

$$f_X(x) = 1$$

$$\int_1^2c*\ln(x) dx = 1$$

$$c *\int_1^2\ln(x) dx = 1$$

$$c * (2\ln(2) -1) = 1$$

$$c = \frac{1}{2\ln(2) -1}$$

Did I do this correctly?

• It looks ok to me. – paw88789 Apr 1 at 18:20
• Save that the start should clearly be $\int_\Bbb R f_X(x)~\mathrm d x=1$ – Graham Kemp Apr 1 at 22:17