Consider this function:
$$f(x) = 2x +1$$
it can be seen as a composite function: $f(g(x))$ with
$$f(x) = x + 1$$ $$g(x) = 2x$$
Using the chain-rule to derive the original $f(x)$ I got:
$$f'(x) = d(2x + 1) \cdot 2 $$
Denoting with $d(\cdot)$ the derivative operation respect to $x$
But then solving $d(2x + 1)$ simply distributing derivative operator over sum I got:
$$f'(x) = 2 \cdot 2 = 4$$
Which is wrong.
What is my mistake? What I was getting wrong?
I can't consider $f(x)$ as a composite function?
You have a problem with your composition. You should instead have: $$ f(x) = x + 1 $$ and $$ g(x) = 2x, $$ which would then both imply that $ f(g(x)) = 2x + 1 $.
Then clearly, $$ \frac{d(2x + 1)}{dx} = 2, $$ and by the chain rule: $$ \frac{df(g(x))}{dx} = \frac{df(g(x))}{dg(x)}\frac{dg(x)}{dx} = 1 \times 2 = 2, $$ which is as expected.
Hope this helps.