# Doubt in composite function derivative

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?

• $(f(g(x)))'=f'(g(x))g'(x)$ and $f'(g(x))=1$ because $f(x)=x+1$ Mar 24 '18 at 11:53

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.

• +1 - from Review. Mar 24 '18 at 12:08

There's a conflict of the roles of $f$ in the question. To avoid ambiguity, write $h(x) = x+1$ and $g(x) = 2x$ so that $f = h \circ g$.

Then $h'(x) = 1$ and $g'(x) = 2$

Apply Chain Rule.

$$f'(x) = h'(g(x)) g'(x) = 1 \cdot 2 = 2$$