# Differentiate xsinx using first principles?

Feb 6, 2018

$f ' \left(x\right) = x \cos x + \sin x$

#### Explanation:

Derivation from first principles tells us that for a function $f \left(x\right)$, $f ' \left(x\right) = {\lim}_{h \to 0} \frac{f \left(x + h\right) - f \left(x\right)}{h}$

In this case, $f \left(x\right) = x \sin x$, so we have:
$f ' \left(x\right) = {\lim}_{h \to 0} \frac{\left(x + h\right) \sin \left(x + h\right) - x \sin x}{h}$

We can use the identity $\sin \left(A + B\right) = \sin A \cos B + \sin B \cos A$

$\textcolor{w h i t e}{f ' \left(x\right)} = {\lim}_{h \to 0} \frac{\left(x + h\right) \left(\sin \left(x\right) \cos \left(h\right) + \cos \left(x\right) \sin \left(h\right)\right) - x \sin x}{h}$

$\textcolor{w h i t e}{f ' \left(x\right)} = {\lim}_{h \to 0} \frac{x \sin \left(x\right) \cos \left(h\right) + x \cos \left(x\right) \sin \left(h\right) + h \sin \left(x\right) \cos \left(h\right) + h \cos \left(x\right) \sin \left(h\right) - x \sin x}{h}$

$\textcolor{w h i t e}{f ' \left(x\right)} = {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right)}{h} + \frac{x \cos \left(x\right) \sin \left(h\right)}{h} + \frac{h \sin \left(x\right) \cos \left(h\right)}{h} + \frac{h \cos \left(x\right) \sin \left(h\right)}{h} - \frac{x \sin x}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right)}{h} + \frac{x \cos \left(x\right) \sin \left(h\right)}{h} + \sin \left(x\right) \cos \left(h\right) + \cos \left(x\right) \sin \left(h\right) - \frac{x \sin x}{h}\right)$

It is known that:
${\lim}_{h \to 0} \frac{\sinh}{h} = 1$

$\textcolor{w h i t e}{f ' \left(x\right)} = {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right)}{h} + x \cos \left(x\right) + \sin \left(x\right) \cos \left(h\right) + \cos \left(x\right) \sin \left(h\right) - \frac{x \sin x}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) \cos \left(0\right) + \cos \left(x\right) \sin \left(0\right) + {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right)}{h} - \frac{x \sin x}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) + {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right)}{h} - \frac{x \sin x}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) + {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \cos \left(h\right) - x \sin x}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) + {\lim}_{h \to 0} \left(\frac{x \sin \left(x\right) \left(\cos \left(h\right) - 1\right)}{h}\right)$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) + x \sin \left(x\right) {\lim}_{h \to 0} \frac{\cos \left(h\right) - 1}{h}$

It is also known that:
${\lim}_{h \to 0} \frac{\cos \left(h\right) - 1}{h} = 0$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right) + x \sin \left(x\right) 0$

$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos \left(x\right) + \sin \left(x\right)$

Proof:
$f \left(x\right) = x \sin x$

$f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left[x\right] \sin x + x \frac{d}{\mathrm{dx}} \left[\sin x\right]$
$\textcolor{w h i t e}{f ' \left(x\right)} = 1 \sin x + x \cos x$
$\textcolor{w h i t e}{f ' \left(x\right)} = x \cos x + \sin x$

Feb 6, 2018

$\frac{d}{\mathrm{dx}} x \sin x = x \cos x + \sin x$

#### Explanation:

Let us define:

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

Using the limit definition of the derivative, we compute the derivative using:

$f ' \left(x\right) = {\lim}_{h \rightarrow 0} \frac{f \left(x + h\right) - f \left(x\right)}{h}$

$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = {\lim}_{h \rightarrow 0} \frac{\left(x + h\right) \sin \left(x + h\right) - x \sin x}{h}$

$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = {\lim}_{h \rightarrow 0} \left\{x \frac{\left(\sin \left(x + h\right) - \sin x\right)}{h} + \sin \left(x + h\right)\right\}$

$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = x {\lim}_{h \rightarrow 0} \frac{\left(\sin \left(x + h\right) - \sin x\right)}{h} + {\lim}_{h \rightarrow 0} \sin \left(x + h\right)$

$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = x \left\{{\lim}_{h \rightarrow 0} \frac{\sin \left(x + h\right) - \sin x}{h}\right\} + \sin x$

So we only need to calculate the limit:

$L = {\lim}_{h \rightarrow 0} \frac{\sin \left(x + h\right) - \sin x}{h}$

Which, coincidentally, is the limit arising from the derivative of $\sin x$ (by definition). Now using the trigonometric multiply angle identity:

$\sin \left(A + B\right) \equiv \sin A \cos B + \cos A \sin B$

We get:

$L = {\lim}_{h \rightarrow 0} \frac{\sin x \cos h + \cos x \sin h - \sin x}{h}$

$\setminus \setminus \setminus = {\lim}_{h \rightarrow 0} \frac{\sin x \left(\cos h - 1\right)}{h} + \frac{\cos x \sin h}{h}$

$\setminus \setminus \setminus = \sin x \setminus \left\{{\lim}_{h \rightarrow 0} \frac{\cos h - 1}{h}\right\} + \cos x \setminus \left\{{\lim}_{h \rightarrow 0} \frac{\sin h}{h}\right\}$

Both of these limits are standard calculus limits, and providing $x$ is in radians, we have:

${\lim}_{h \rightarrow 0} \frac{\cos h - 1}{h} = 0 \setminus \setminus$ and $\setminus \setminus {\lim}_{h \rightarrow 0} \frac{\sin h}{h} = 1$

With these results, we get the result:

$L = \cos x \implies f ' \left(x\right) = x \cos x + \sin x$