The best way to do this is divide everything by x^2 ( top and bottom )

lim (3x^2 - x-2)/(5x2 +4x +1)

x->infinity

lim (3x^2 - x-2)/(x^2) /(5x2 +4x +1)/(x^2)

x->infinity

lim (3 - 1/x-2/x^2)/(5 +4/x +1/x^2)

x->infinity

As x ---> inifinity

1/x --> 0

4/x --- > 0

2/x^2 --- > 0

1/x^2 --> 0

3 ---> 3

5---> 5

lim (3 - 1/x-2/x^2)/(5 +4/x +1/x^2) = 3/5

x->infinity