First, you will need a common denominator.
1) multiple the top and bottom of the first expression by (x+1):
[(x+2) * (x+1)] / [ (x-4) * (x+1) ]
2) multiply top and bottom of the second expression by (x-4):
[ x * (x-4) ] / [ (x+1) * (x-4) ]
As you can see, the two expressions have the same denominator now. So we are able to add them.
I am going to ignore the denominator for now since that will stay until the end (unless you would like to expand it which is not necessary).
The numerator would be: (x+2)(x+1)+x(x-4) = [(x^2)+x+2x+2] + [(x^2)-4x]
simplifying you will get: 2*(x^2) -x+2
so the final answer would be: [2*(x^2) -x+2] / [(x+1)*(x-4)]