Is it proper to integrate an expression such as $\displaystyle \int \frac 1 {x~\mathrm{J}} \, dx$, where $x$ is in the physical unit of Joules (J)?
The result is $\ln \dfrac x J + \text{constant}$. However, I don't know how to take the natural log of a Joule, or if that is even permitted. My safer approach would be to take the units out of the expression before integrating, by treating the unit expression as a constant:
$$1~J~\int \frac{1}{x~J~(1/J)} \, dt$$
Yet I have been told by a mathematician that this is not necessary. Do you have recommendations to proceed?