Is this how to evaluate single density function Hello can anyone help me on this,
I am wanting to solve a few things for the following ; I am hoping someone can look over my work and such and I have a few questions along the way.
Say we have a density function of a random variable $X$,
given by
$$f(x)=\begin{cases}
kxe^{-4x^2} &\text{ if } x \gt 0 \\
0 &\text{ any where else.}\end{cases}$$
And I am wanting to find the correct value of $k$, the distribution function of $X$, the $P[2 \le X \le 4]$  the $P[X \lt 4 | X \gt 2]$ and finally $E[X]$
To solve for k, I set the integral equal to 1 over the whole region of definition , and used U substitution to find that $k=8$.
To find the distribution function, I considered the integral but from $0$ to $x$, with the integral in terms of t. Same integration techniques and such leads me to $$f_{x}(X)=1-e^{-4x^2}.$$ Is that the right way to do such?
If that is correct, cant I do $P[2 \le X \le 4]$ by just doing $F(4)-F(2)?$
$$(-e^{-64})+e^{-16}$$ but this seems weird to me and I feel like I must have made some mistakes?
If that is the case then could I
$$P[X \lt 4 | X \gt 2]=\frac{P[2 \le X \le 4]}{P[X \gt 2]}$$
And for $E(x)$ I know I could consider the integral of just $x$ times the distribution function of $f_x(X)$
But I am not so confident in my work here. I hope someone can take the time to read over what I have tried and thought, and please correct anywhere or anything.
Update: No, Rayleigh distribution was not something mentioned in this course. This is only first course in probability, the answers are expected to be found using all the standard techniques, integration etc
Thanks!
 A: Depending on how much was covered in class/the textbook, you might be able to cut yourself a lot of work:

  
*
  
*Finding $k$.
  

Notice that $f_X(x)$ is almost a Rayleigh distribution. Rewriting the density gives
$$f(x) = kxe^{-4x^2} = kx\exp\left\{-\frac{1}{2}\left(\frac{x}{\sqrt{1/8}}\right)^2\right\}.$$
This implies that the parameter $\sigma = \sqrt{1/8}$. Thus
$$k = \frac{1}{{1/8}}.$$


  
*$P(X<4|X>2)$
  

Well since we recognized that this is a Rayleigh distribution, then recall that the survival is 
$$ S_X(x) = 1-F_X(x) = \exp\left\{-\frac{1}{2}\left(\frac{x}{\sigma}\right)^2\right\}.$$
Then
$$P(X<4|X>2)=\frac{P(2<X<4)}{P(X>2)} = \frac{S_X(2)-S_X(4)}{S_X(2)}.$$
I'll leave you to plug that in.


  
*$E[X]$
  

Since we noticed that $X$ is a Rayleigh distribution with parameter $\sigma^2 = 1/8$, then
$$E[X] = \sigma\sqrt{\frac{\pi}{2}} =\sqrt{\frac{\pi}{16}}.$$ 
Of course, this approach is not valid if you didn't cover a nonstandard Rayleigh. If you did cover a standard Rayleigh ($\sigma^2 = 1$), then just apply a change of variable and then apply all known properties of the standard Rayleigh. This is the usual approach to these kinds of problems: to use known properties. Of course, if you didn't over Rayleighs at all then you can't use what I have presented and so this exercise seems to be a matter of busy work and isn't very insightful.
