This can be done with partial fractions, but this will be done with a trigonometric substitution.
First, we need to add #dx# to the integral:
#I=int1/(x^2-4)dx#
Recall that #sec^2theta-1=tan^2theta#.
Because of that identity, let #x=2sectheta#.
Importantly, this implies that #x^2-4=4sec^2theta-4=4(sec^2theta-1)=4tan^2theta#.
Furthermore, #dx=2secthetatanthetad theta#.
Then:
#I=int(2secthetatantheta)/(4tan^2theta)d theta=1/2intsectheta/tanthetad theta=1/2intcscthetad theta#
Which is a commonly known integral:
#I=-1/2lnabs(csctheta+cottheta)#
From our original substitution #x=2sectheta# we see that #sectheta=x/2#. This is a right triangle where #2# is the side adjacent to #theta#, #x# is the hypotenuse and then the side opposite theta is #sqrt(4-x^2)#.
Then, #csctheta=x/sqrt(4-x^2)# and #cottheta=2/sqrt(4-x^2)#. So:
#I=-1/2lnabs(x/sqrt(4-x^2)+2/sqrt(4-x^2))=1/2lnabs(sqrt(4-x^2)/(x+2))#
Expanding further:
#I=1/4lnabs(4-x^2)-1/2lnabs(x+2)=1/4lnabs(2+x)+1/4lnabs(2-x)-1/2lnabs(x+2)#
#I=1/4lnabs(2-x)-1/4lnabs(x+2)#
We can combine these and switch the order of #2-x# to #x-2# since we're working with absolute values:
#I=1/4lnabs((x-2)/(x+2))+C#
This would be much quicker if done with partial fractions.