Find the derivative of the following functions from first principle:
(i) \(-x\) (ii) \((-x)^{-1}\) (iii) \(\sin (x + 1)\) (iv) \(\cos \left(x - \frac{\pi}{8}\right)\)
Show solutionHide solution
The derivative from first principles is defined by
\[f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h},\]provided this limit exists.
(i) \(f(x)=-x\)
\[f'(x)=\lim_{h\to 0}\frac{-(x+h)-(-x)}{h} =\lim_{h\to 0}\frac{-x-h+x}{h} =\lim_{h\to 0}\frac{-h}{h} =\lim_{h\to 0}(-1)=-1.\]So the derivative is \(-1\).
(ii) \(f(x)=(-x)^{-1}=-\dfrac{1}{x}\)
This function is defined for \(x\neq 0\), so we differentiate at any \(x\neq 0\).
\[f'(x)=\lim_{h\to 0}\frac{\dfrac{-1}{x+h}-\left(-\dfrac{1}{x}\right)}{h} =\lim_{h\to 0}\frac{\dfrac{1}{x}-\dfrac{1}{x+h}}{h}.\]Combine the fractions:
\[\frac{1}{x}-\frac{1}{x+h}=\frac{(x+h)-x}{x(x+h)}=\frac{h}{x(x+h)}.\]Hence
\[f'(x)=\lim_{h\to 0}\frac{1}{h}\cdot\frac{h}{x(x+h)} =\lim_{h\to 0}\frac{1}{x(x+h)}=\frac{1}{x^2}.\]So the derivative is \(\dfrac{1}{x^2}\), valid for \(x\neq 0\).
(iii) \(f(x)=\sin(x+1)\)
\[f'(x)=\lim_{h\to 0}\frac{\sin(x+h+1)-\sin(x+1)}{h}.\]Use \(\sin A-\sin B=2\cos\dfrac{A+B}{2}\sin\dfrac{A-B}{2}\) with \(A=x+h+1\) and \(B=x+1\):
\[\sin(x+h+1)-\sin(x+1)=2\cos\!\left(x+1+\frac{h}{2}\right)\sin\frac{h}{2}.\]Therefore
\[f'(x)=\lim_{h\to 0}2\cos\!\left(x+1+\frac{h}{2}\right)\cdot\frac{\sin(h/2)}{h}.\]Write \(\dfrac{\sin(h/2)}{h}=\dfrac{1}{2}\cdot\dfrac{\sin(h/2)}{h/2}\). Since \(\lim_{t\to 0}\dfrac{\sin t}{t}=1\) and cosine is continuous,
\[f'(x)=2\cos(x+1)\cdot\frac{1}{2}\cdot 1=\cos(x+1).\]So the derivative is \(\cos(x+1)\).
(iv) \(f(x)=\cos\left(x-\dfrac{\pi}{8}\right)\)
\[f'(x)=\lim_{h\to 0}\frac{\cos\left(x+h-\dfrac{\pi}{8}\right)-\cos\left(x-\dfrac{\pi}{8}\right)}{h}.\]Use \(\cos A-\cos B=-2\sin\dfrac{A+B}{2}\sin\dfrac{A-B}{2}\) with \(A=x+h-\dfrac{\pi}{8}\) and \(B=x-\dfrac{\pi}{8}\):
\[\cos\left(x+h-\frac{\pi}{8}\right)-\cos\left(x-\frac{\pi}{8}\right) =-2\sin\!\left(x-\frac{\pi}{8}+\frac{h}{2}\right)\sin\frac{h}{2}.\]Thus
\[f'(x)=\lim_{h\to 0}-2\sin\!\left(x-\frac{\pi}{8}+\frac{h}{2}\right)\cdot\frac{\sin(h/2)}{h} =-2\sin\!\left(x-\frac{\pi}{8}\right)\cdot\frac{1}{2}\cdot 1 =-\sin\!\left(x-\frac{\pi}{8}\right).\]So the derivative is \(-\sin\left(x-\dfrac{\pi}{8}\right)\).
Answers: (i) \(-1\); (ii) \(\dfrac{1}{x^2}\) for \(x\neq 0\); (iii) \(\cos(x+1)\); (iv) \(-\sin\left(x-\dfrac{\pi}{8}\right)\).