<s>[INST] Random variable with exponential distribution. Let $X$ be random variable with exponential distribution $\mathcal{E}(2)$ and let $Y$ be another random variable such that $$Y=\max\left(X^2, \frac{X+1}{2} \right).$$
Find the distribution for random variable $Y$.

Distribution for $X$ is $f_X(x)= 2e^{-2x}, x>0$ and zero otherwise.
Now, for variable $Y$ we have that it's distribution is zero whenever $y \leq \frac{1}{4}$
For $y=t> \frac{1}{2}$ we have the following:
$F_Y(t)=\int_0^{2t-1} f_X(x)dx= 1- e^{2-4t}$
Similarly, for $y=t>1$ we have 
$F_Y(t)=\int_0^{\sqrt{t}} f_X(x)dx= 1- e^{-2\sqrt{t}}$
But, i cannot understand what happens in case that $y$ takes random value on interval $(\frac{1}{4}, \frac{1}{2})$. It's the black line on the graph. How can i handle situations like this? Any help appreciated!
 [/INST] Let's compute the CDF of $Y$ firstly: $$\begin{align}P(Y \le y) &= P(\max\left(X^2, \frac{X+1}{2}\right) \le y) \\&= P(X^2 \le y, \frac{X+1}{2} \le y) \\&= P(X^2 \le y, X \le 2y - 1) \\&= P(-\sqrt{y} \le X \le \sqrt{y}, X \le 2y - 1) \\&= \begin{cases} P(X \le \sqrt{y}) , y > 1 \\ P(X \le 2y - 1), \frac{1}{2} \le y \le 1 \\ 0, \text{otherwise}\end{cases}\end{align}$$
As we can see $Y$ can't be less than $\frac{1}{2}$ because $max(X^2, \frac{X+1}{2})$ always $\ge \frac{1}{2}$
</s>