If I have an exponential random variable $X$ with mean $\theta =2$, and I need to find the mean and variance of $X$, given that $X<3$, I started with $$E[X|X<3]=\int_{0}^{3}[1-\frac{F(x)}{F(3)}]dx$$
That was not that hard to do. I just found $F(x)$ by integrating the distribution of $X$ from zero to $x$ and substituted that in. However, to find the variance, I'm going to need $E[X^2|X<3]$ and I'm not exactly sure how to do that. Can I modify the formula that I used to find the mean of $X$, or do I need to do something different?
First find the probability distribution of $X$ given that it is less than $3$:$$P(X|X<3)P(X<3) = P(X)\implies P(X|X<3) = \frac{P(X)}{P(X<3)} = \frac{P(X)}{\int_0^3 P(X) dX}.$$ Now, the conditional expected values are: $$E[X|X<3] = \int_0^3 X\, P(X|X<3) dX,$$ $$E[X^2|X<3] = \int_0^3 X^2 P(X|X<3) dX.$$