Let $ X \sim U[-1,2]$ and let Y:
$$ Y=\begin{cases} \frac{1}{X^2} && X \ne 0 \\ 0 && X=0 \end{cases} $$
Find the distribution of Y.
What I did was:
$F_Y(t)=P(Y\leq t)=P(\frac{1}{X^2}\leq t)$
Obviously, if $t<0$ then $F_Y(t)=0$
Since $X^2$ is non negative, $P(\frac{1}{X^2}\leq t)=P(X^2\geq \frac{1}{t})=1-P(X^2 \leq \frac{1}{t})=1-P(-\frac{1}{\sqrt{t}}\leq X \leq \frac{1}{\sqrt{t}})$
Now I wonder. The simplest thing I can do here is to simply integrate over the region:
$=1-\int_{-\frac{1}{\sqrt{t}}}^{\frac{1}{\sqrt{t}}}\frac{1}{3}dx=1-\frac{1}{3}(\frac{1}{\sqrt{t}}+\frac{1}{\sqrt{t}})=1-\frac{2}{3\sqrt{t}}$
Is that correct?
Is there a reasonable way to do that without integration? I mean by using the fact that$P(-\frac{1}{\sqrt{t}}\leq X \leq \frac{1}{\sqrt{t}}) = F_X(\frac{1}{\sqrt{t}}) - F_X(-\frac{1}{\sqrt{t}})$ but then I'll have to consider every case for $\frac{1}{\sqrt{t}}$ and $-\frac{1}{\sqrt{t}}$ which is pretty much a mess, no?
Thanks.
HINTS: Your calculation of $\mathbb{P}\left(-1/\sqrt{t}\leq X \leq 1/\sqrt{t}\right)$ has assumed that $-1/\sqrt{t}\geq -1$ and $1/\sqrt{t}\leq 2$. It is correct if these inequalities hold, but you should separately consider what happens if one or more of them do not hold.
Basically when computing something like $\mathbb{P}(a \leq X\leq b)$, if $a < -1$ or $b > 2$, you will want to truncate these bounds to the bounds of the interval that $X$ is uniform on ($-1$ and $2$). For example, if $a < -1$, then $\mathbb{P}(a \leq X \leq 1)$ would become $\mathbb{P}(-1\leq X \leq 1)$. Once you have $[a',b']\subseteq [-1,2]$, you will be able to use $\mathbb{P}(a'\leq X \leq b') =(b'-a')/3$.