(x^2-7)=(x-sqrt(7))(x+sqrt(7)) and x^2-4=(x-2)(x+2) so the expression becomes (x-sqrt(7))(x+sqrt(7))/(x(x-2)(x+2)). The general rule is to factorise polynomials where possible and see if the numerator and denominator have any factors in common. They can usually by cancelled given that the factor is not zero.