# Question about the substitution rule. Where did I go wrong?

$\int (f(x))' dx = f(x) + c$

if $u=g(x)$ then

$\int (f(u))'du = f(u)+c$

But

$\int (f(g(x)))'dx = f(g(x))+c$

Where did I go wrong?

-
You replaced $u = g(x), du = dx.$ If $u = g(x)$ then $du = g'(x) dx.$ –  user2468 Aug 3 '12 at 4:10

In short, you forgot the chain-rule. That is to say that if $u = g(x)$, then $du = g'(x)dx$. It is this that let's us say that
$$\int [f(g(x))]'dx =\int f'(g(x))g'(x)dx = f(g(x)) + C$$