We know that $$\int f(ax + b)\,\mathrm dx = \frac1aF(ax + b) + C$$
so while solving $$\int x^2\,\mathrm dx = \frac13x^3 + C$$
also, $$\int (x + 3)^4\,\mathrm dx = \frac15(x + 3)^5 + C$$
but for trig functions like, $$\int \sin^2x\,\mathrm dx \neq \frac13\sin^3x + C$$
Instead, we have to simplify it first algebraically. So why does the intuition fail here?
Update: I seem to be confused with f. Till now $$\int \sin^2(1*x+0)\,\mathrm dx \ $$, I have assumed f = (sin(x))^2 with a=1 and b=0. There seems something wrong with my understanding.
The main reason why you can't apply your formula here is because with your example:
$$\int (\sin x)^2 \,\mathrm dx$$
Here, $f(x) = x^2$ but the input, $\sin x$, does not fit the format of $ax + b$.
More generally, this is because of the chain rule. It states that:
$$\left(f(g(x)\right)' = f'(g(x)) \cdot g'(x)$$
In each of your examples, the chain rule creates a situation where you don't necessarily see it, but it's there. For example when $f(x) = 3x^2$ and $g(x) = x + 3$, we try to find the derivative of $f(g(x))$:
$${\mathrm d \over \mathrm dx} {(x+3)^3\over 3} = 3(x + 3)^2 \cdot {\mathrm d \over \mathrm dx} (x + 3)$$
Since the derivative of $x + 3$ is $1$, you can simply apply the reverse power rule for integration. But when the inside does not have a derivative of $1$ (or a constant for that matter), you run into problems. For example when $f(x) = \frac 13 x^3$ and $g(x) = \sin x$:
$${\mathrm d \over \mathrm dx} \frac 13 (\sin x)^3 = \frac 13 \cdot 3(\sin x)^2 \cdot {\mathrm d \over \mathrm dx} \sin x = \sin^2 x \cos x$$
You'll notice that $\sin^2 x \cos x\neq \sin^2 x$. The chain rule always applies, because you must measure the change in every intermediary function with respect to some variable. See $u$-substitution, which is a technique for integration that essentially undoes the chain rule.