In Mathematics, we know the following is true:
$$\int \frac{1}{x} \space dx = \ln(x)$$
Not only that, this rule works for constants added to x: $$\int \frac{1}{x + 1}\space dx = \ln(x + 1) + C{3}$$ $$\int \frac{1}{x + 3}\space dx = \ln(x + 3) + C$$ $$\int \frac{1}{x - 37}\space dx = \ln(x - 37) + C$$ $$\int \frac{1}{x - 42}\space dx = \ln(x - 42) + C$$
So its pretty safe to say that $$\int \frac{1}{x + a}\space dx = \ln(x + a) + C$$ But the moment I introduce $x^a$ where $a$ is not equal to 1, the model collapses. The integral of $1/x^a$ is not equal to $\ln(x^a)$. The same goes for $\cos(x)$, and $\sin(x)$, and other trig functions.
So when are we allowed or not allowed to use the rule of $\ln(x)$ when integrating functions?