The questions itself is in "improper integrals" subject.
$$\int \frac{2x}{x^{2}-1}$$
Here is an antiderivative: $\ln(x^{2}-1)|_{x=-1}^{x=1}$
If I just place numbers instead of $x$ I get $\ln(0)-\ln(0)$ which is like writing number-number=zero. The teacher however said that this was a mistake and that it is not based on same principle. why? is it not like substracting a number from itself?
The map $x\mapsto\ln(x^2-1)$ is an antiderivative of $\dfrac{2x}{x^2-1}$. But if you replace $x$ by to concrete numbers and compute their difference, all you get as number, not an antiderivative of that function. Besides, $\ln(0)$ is undefined.
However, it is true that$$\lim_{t\to1^-}\int_{-t}^t\frac{2x}{x^2-1}\,\mathrm dx=0.$$That is so because, for each $t\in(0,1)$,$$\int_{-t}^t\frac{2x}{x^2-1}\,\mathrm dx=\ln(t^2-1)-\ln\bigl((-t)^2-1\bigr)=0.$$