# Help understand chain rule derivative

I was verifying a larger function derivative on wolfram alpha and came across this derivative:

$\frac{d}{dx} (1-x)^2 = 2(x -1)$

Using the chain rule, I was expecting to get:

$2(1 - x)$

Instead. I trust wolfram alpha can differentiate better than me, so what am I missing?

## 3 Answers

You actually didn't use the chain rule correctly: To use the chain rule, you need to also multiply $2(1 - x)$ by $\frac d{dx}(1 - x)= -1$.

In other words, we have $$f(x) = (1 - x)^2 \implies f'(x) = 2(1 - x)\cdot \frac{d}{dx}(1 - x) = -2(1 - x) = 2(x - 1)$$

• Thanks, I mistakenly thought the derivative of 1-x was 1 instead of -1. – Oscar Dec 10 '13 at 21:59
• Not a problem. I presumed it was a simple lapse of thought involved here. – Namaste Dec 10 '13 at 22:00
• @amWhy: Could use another UV +1 – Amzoti Dec 12 '13 at 4:38

In more detail: $$\frac{d\left[(1-x)^2\right]}{dx} = 2 (1-x) \frac{d[1-x]}{dx} = 2 (1-x) (-1) = 2 (x-1).$$

$\frac{d (1-x)^2}{dx} =2(1-x) \frac{d (1-x)}{dx}=2(1-x)(-1)=2(x-1)$