Answer
$1000$, $1500$, and $2500$ dollars for $2\%$, $3\%$, and $4\%$ respectively.
Work Step by Step
1. Assume the amount invested are $x$, $y$, and $z$ dollars for $2\%$, $3\%$, and $4\%$ rates.
2. Based on the given conditions, we have $\begin{cases} x+y+z=5000 \\ z=x+y \\ 0.02x+0.03y+0.04z=165 \end{cases}$ or $\begin{cases} x+y+z=5000 \\ z=x+y \\ 2x+3y+4z=16500 \end{cases}$
3. Use the second equation in the other two to get $\begin{cases} x+y=2500 \\ 6x+7y=16500 \end{cases}$
4. Multiply $-6$ to the first equation and add the result to the second to get $y=16500-6(2500)=1500$
5. Use back-substitution to get $x=2500-y=1000$ and $z=x+y=2500$
6. the amount invested are $1000$, $1500$, and $2500$ dollars for $2\%$, $3\%$, and $4\%$ rates.