I have the following code:
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
$$\hat{x}_n(t)=\left\{ \begin{array}{cc}
1 & -1\leq t \leq -\frac{1}{n+1} \\
-(n+1) t & -\frac{1}{n+1} \leq t \leq \frac{1}{n+1} \\
-1 & \frac{1}{n+1} \leq t \leq 1.
\end{array}\right.$$
\end{document}
This looks like this:
The problem is that the size of the fractions is too small, if I try to change it using \dfrac, the size is too big and they end up overlapping, because the spaces between each line are the same. Is there an easy way to change this? Thanks.