Differentiation

Find the derivative of $x \sin x$ with respect to x from first principle of derivatives.


Let $f\left(x\right)=x \sin x$

$\begin{aligned} f'\left(x\right) & = \lim\limits_{h \to 0} \; \dfrac{f\left(x+h\right)-f\left(x\right)}{h} \\ & \\ & = \lim\limits_{h \to 0} \; \dfrac{\left(x+h\right)\sin \left(x+h\right)-x \sin x}{h} \\ & \\ & = \lim\limits_{h \to 0} \; \dfrac{x \sin \left(x+h\right)+h \sin \left(x+h\right)-x \sin x}{h} \\ & \\ & = \lim\limits_{h \to 0} \; \dfrac{x \left[\sin \left(x+h\right)-\sin x\right]}{h} + \lim\limits_{h \to 0} \; \dfrac{h \sin \left(x+h\right)}{h} \\ & \\ & \left[\text{Note: }\sin C - \sin D = 2 \cos \left(\dfrac{C+D}{2}\right)\sin \left(\dfrac{C-D}{2}\right)\right] \\ & \\ & = \lim\limits_{h \to 0} \; \dfrac{x \times 2 \cos \left(\dfrac{x+h+x}{2}\right) \sin \left(\dfrac{x+h-x}{2}\right)}{h} + \lim\limits_{h \to 0} \; \sin \left(x+h\right) \\ & \\ & = \lim\limits_{h \to 0} \; \dfrac{2x \cos \left(x+\dfrac{h}{2}\right) \sin \left(\dfrac{h}{2}\right)}{h} + \sin x \\ & \\ & = 2x \times \lim\limits_{h \to 0} \; \cos \left(x+\dfrac{h}{2}\right) \times \lim\limits_{\frac{h}{2} \to 0} \; \dfrac{\sin \left(\dfrac{h}{2}\right)}{\dfrac{h}{2}} \times \dfrac{1}{2} + \sin x \\ & \\ & \left[\text{Note: As }h \to 0, \; \dfrac{h}{2} \to 0 \right] \\ & \\ \therefore \; f'\left(x\right) & = x \times \cos x \times 1 + \sin x \\ & \\ & = x \cos x + \sin x \end{aligned}$