The derivative of a function measures its instantaneous rate of change — the slope of the tangent to the curve at a point. It is defined as a limit of average rates of change, known as the first principle (or $ab\,initio$) definition:
$$f'(x) = \lim_{h \to 0}\dfrac{f(x + h) - f(x)}{h}$$
The quotient $\dfrac{f(x+h) - f(x)}{h}$ is the slope of the secant joining the points $(x,\, f(x))$ and $(x+h,\, f(x+h))$. As $h \to 0$ the second point slides towards the first, and the secant pivots into the tangent; its slope is the derivative.
Derivative at a point vs derivative as a function. Two related quantities share the name "derivative". The derivative at a point $a$ is a single number, the slope there:
$$f'(a) = \lim_{h \to 0}\dfrac{f(a + h) - f(a)}{h} = \lim_{x \to a}\dfrac{f(x) - f(a)}{x - a}$$
The derivative as a function, $f'(x)$, is the rule that returns that slope at every $x$. You differentiate once to get $f'(x)$, then substitute a value to read off $f'(a)$.
Derivatives from first principles. Applying the definition to the basic functions gives results worth knowing on sight:
The six trigonometric derivatives are easiest remembered in pairs: the three "co-" functions ($\cos$, $\csc$, $\cot$) all carry a minus sign, and each pair differs only by that sign and a swap of $\tan \leftrightarrow \cot$, $\sec \leftrightarrow \csc$.
Rules of differentiation. Once the basics are known, four rules let you combine them. For differentiable functions $u$ and $v$:
$$(u \pm v)' = u' \pm v' \qquad (k\,u)' = k\,u'$$
$$\textbf{Product rule: } (uv)' = u'\,v + u\,v'$$
$$\textbf{Quotient rule: } \left(\dfrac{u}{v}\right)' = \dfrac{u'\,v - u\,v'}{v^{2}}, \;\; v \ne 0$$
A frequent slip is to assume $(uv)' = u'v'$ — it is not. The product rule keeps both cross terms, and the quotient rule subtracts (order matters: it is $u'v - uv'$ on top, never the reverse). The product rule extends to three factors as $(uvw)' = u'vw + uv'w + uvw'$ — differentiate one factor at a time and add.
Deeper Insight — the derivative is a limit of slopes: Everything in this topic rests on one picture. The fraction $\dfrac{f(x+h)-f(x)}{h}$ is just "rise over run" between two points on the curve — an average rate of change across a step of width $h$. Shrinking $h$ towards zero is what converts that average into an instantaneous rate, and geometrically it is the secant line rotating until it rests as the tangent. This is also why first principles repeatedly throw up the standard limits of the previous topic: differentiating $\sin x$ forces $\lim_{h\to 0}\tfrac{\sin h}{h}=1$ to surface, and differentiating $e^x$ forces $\lim_{h\to 0}\tfrac{e^h-1}{h}=1$. The table of derivatives and the four rules are simply the compiled, reusable output of this limit process; understanding that they come from a limit — rather than appearing by decree — is what makes the whole of differential calculus cohere.
Find the derivative of $f(x) = x^2$ from first principles.
Solution- Apply the definition: $f'(x) = \lim_{h \to 0}\dfrac{(x+h)^2 - x^2}{h}$.
- Expand the numerator: $(x+h)^2 - x^2 = x^2 + 2xh + h^2 - x^2 = 2xh + h^2$.
- $f'(x) = \lim_{h \to 0}\dfrac{2xh + h^2}{h} = \lim_{h \to 0}(2x + h)$.
- Let $h \to 0$: $f'(x) = 2x$.
Answer: $f'(x) = 2x$.
Find the derivative of $f(x) = \sin x$ from first principles.
Solution- $f'(x) = \lim_{h \to 0}\dfrac{\sin(x+h) - \sin x}{h}$.
- Use $\sin(x+h) - \sin x = 2\cos\!\left(x + \dfrac{h}{2}\right)\sin\dfrac{h}{2}$.
- $f'(x) = \lim_{h \to 0}\cos\!\left(x + \dfrac{h}{2}\right)\cdot\dfrac{\sin(h/2)}{h/2}$.
- As $h \to 0$: $\dfrac{\sin(h/2)}{h/2} \to 1$ and $\cos\!\left(x+\dfrac{h}{2}\right) \to \cos x$.
Answer: $f'(x) = \cos x$.
Differentiate $y = 4x^3 - 7x^2 + 5x - 9$.
Solution- Differentiate term by term using $(x^n)' = n\,x^{n-1}$ and the constant-multiple rule.
- $\dfrac{d}{dx}(4x^3) = 12x^2$, $\dfrac{d}{dx}(-7x^2) = -14x$, $\dfrac{d}{dx}(5x) = 5$, $\dfrac{d}{dx}(-9) = 0$.
- Add: $\dfrac{dy}{dx} = 12x^2 - 14x + 5$.
Answer: $\dfrac{dy}{dx} = 12x^2 - 14x + 5$.
Differentiate $y = x^2 \sin x$ using the product rule.
Solution- Let $u = x^2$ and $v = \sin x$; then $u' = 2x$ and $v' = \cos x$.
- Product rule: $\dfrac{dy}{dx} = u'v + uv' = 2x\sin x + x^2\cos x$.
Answer: $\dfrac{dy}{dx} = 2x\sin x + x^2\cos x$.
Differentiate $y = \dfrac{\sin x}{x}$ using the quotient rule.
Solution- Let $u = \sin x$ and $v = x$; then $u' = \cos x$ and $v' = 1$.
- Quotient rule: $\dfrac{dy}{dx} = \dfrac{u'v - uv'}{v^2} = \dfrac{x\cos x - \sin x}{x^2}$.
Answer: $\dfrac{dy}{dx} = \dfrac{x\cos x - \sin x}{x^2}$.
Find the slope of the tangent to $y = x^3$ at the point $x = 2$.
Solution- The slope of the tangent is the derivative evaluated at the point.
- $\dfrac{dy}{dx} = 3x^2$.
- At $x = 2$: $3(2)^2 = 3 \times 4 = 12$.
Answer: The slope of the tangent at $x = 2$ is $12$.
Find the derivative of $f(x) = \dfrac{1}{x}$ from first principles.
Solution- $f'(x) = \lim_{h \to 0}\dfrac{\frac{1}{x+h} - \frac{1}{x}}{h}$.
- Combine the numerator: $\dfrac{1}{x+h} - \dfrac{1}{x} = \dfrac{x - (x+h)}{x(x+h)} = \dfrac{-h}{x(x+h)}$.
- Divide by $h$: $\dfrac{-1}{x(x+h)}$.
- Let $h \to 0$: $\dfrac{-1}{x \cdot x} = -\dfrac{1}{x^2}$.
Answer: $f'(x) = -\dfrac{1}{x^2}$.
If $f(x) = 2x^2 - 3x + 4$, find $f'(1)$ using the derivative function.
Solution- Differentiate: $f'(x) = 4x - 3$.
- Substitute the point $x = 1$.
- $f'(1) = 4(1) - 3 = 1$.
Answer: $f'(1) = 1$.
Differentiate $y = \tan x$ by writing it as $\dfrac{\sin x}{\cos x}$ and applying the quotient rule.
Solution- Let $u = \sin x$, $v = \cos x$; then $u' = \cos x$, $v' = -\sin x$.
- Quotient rule: $\dfrac{dy}{dx} = \dfrac{u'v - uv'}{v^2} = \dfrac{\cos x \cos x - \sin x(-\sin x)}{\cos^2 x}$.
- Numerator $= \cos^2 x + \sin^2 x = 1$.
- So $\dfrac{dy}{dx} = \dfrac{1}{\cos^2 x} = \sec^2 x$.
Answer: $\dfrac{d}{dx}(\tan x) = \sec^2 x$.
Differentiate $y = e^x \cos x$ using the product rule.
Solution- Let $u = e^x$ and $v = \cos x$; then $u' = e^x$ and $v' = -\sin x$.
- Product rule: $\dfrac{dy}{dx} = u'v + uv' = e^x \cos x + e^x(-\sin x)$.
- Factor $e^x$: $\dfrac{dy}{dx} = e^x(\cos x - \sin x)$.
Answer: $\dfrac{dy}{dx} = e^x(\cos x - \sin x)$.
Differentiate $y = \dfrac{2x + 1}{x - 1}$ using the quotient rule.
Solution- Let $u = 2x + 1$, $v = x - 1$; then $u' = 2$, $v' = 1$.
- Quotient rule: $\dfrac{dy}{dx} = \dfrac{u'v - uv'}{v^2} = \dfrac{2(x-1) - (2x+1)(1)}{(x-1)^2}$.
- Numerator $= 2x - 2 - 2x - 1 = -3$.
- So $\dfrac{dy}{dx} = \dfrac{-3}{(x-1)^2}$.
Answer: $\dfrac{dy}{dx} = \dfrac{-3}{(x-1)^2}$.
Differentiate $f(x) = \sqrt{x}$ from first principles.
Solution- $f'(x) = \lim_{h \to 0}\dfrac{\sqrt{x+h} - \sqrt{x}}{h}$; rationalise with the conjugate $\sqrt{x+h} + \sqrt{x}$.
- Numerator becomes $(x+h) - x = h$, so the expression is $\dfrac{h}{h\big(\sqrt{x+h} + \sqrt{x}\big)} = \dfrac{1}{\sqrt{x+h} + \sqrt{x}}$.
- Let $h \to 0$: $\dfrac{1}{\sqrt{x} + \sqrt{x}} = \dfrac{1}{2\sqrt{x}}$.
Answer: $f'(x) = \dfrac{1}{2\sqrt{x}}$.