The way you can tell if the graph is going to cross the x-axis or just touch the x-axis is by looking at the power of factor
(x-5)^3 has a power of 3 which is an ODD number. An ODD power means that the graph will cross through the x-axis
(x+2)^2 has the power of 2 which is an EVEN number. An Even power means that the graph will touch the x-axis
To find where it will touch the axis set the factor equal to zero and solve .
(x + 2) = 0
Subtract 2 from both sides
x=-2