This is a basic algebraic question and probably a very simple one, but I'm a bit stuck.
$$\matrix{f(x) = 1/x & \text{for x}\in [a,b]}$$
I've found that $\int (1/x)dx = -(1/x)$
The expression I've got with the rule of the average with integration: $$\frac{(-1/b)+(1/a)}{b-a}$$
How do I shorten this expression (given it's the right one)?
well, if you really mean that the function is $f(x) = \frac{1}{x}$ then the integral is actually $\ln (x)$ and so the average is $$\frac{1}{b-a}(\ln b-\ln a)=\frac{\ln \frac{b}{a}}{b-a}$$
if you mean that the function is $f(X)=\frac{1}{x^2}$ then your average is correct, and then$$\frac{1}{b-a}\cdot (-\frac{1}{b}+\frac{1}{a})=\frac{1}{b-a}\cdot \frac{b-a}{ab}=\frac{1}{ab}$$