# What is the derivative of $x\sin x$?

Ok so I know the answer of $\frac{d}{dx}x\sin(x) = \sin(x)+ x\cos(x)$...but how exactly do you get there? I know $\frac{d}{dx} \sin{x} = \cos{x}$. But where does the additional $\sin(x)$ (in the answer) come in?

• What's the product rule for the derivative? Jul 14, 2013 at 17:26
• en.wikipedia.org/wiki/Product_rule Jul 14, 2013 at 17:28
• Wolframalpha.com with "show steps" option will write out a derivation for this and many other routine problems.
– zyx
Jul 14, 2013 at 18:03

A bit of intuition about the product rule:

Suppose that you have a rectangle whose height at time $t$ is $h(t)$ and whose width at time $t$ is $w(t)$. Then the area at time $t$ is $A(t)=h(t)w(t)$. Now, as the time changes, how does the area change?

(Please, forgive my use of paint here.)

Say the white rectangle was from time $t$, and the larger rectangle at time $t+\Delta t$. We gain three new regions of area: the green one, the blue one, and the gray one.

The green area is $\Delta h\cdot w(t)$, where $\Delta h$ is the change in height from time $t$ to time $t+\Delta t$; the blue area is, similarly, $\Delta w\cdot h(t)$, and the gray area is $\Delta h\cdot\Delta w$. So, we have $$\Delta A=\Delta h\cdot w(t)+\Delta w\cdot h(t)+\Delta h\cdot\Delta w.$$ Now, when $\Delta t$ is really small, we expect $\Delta h$ and $\Delta w$ to be really small as well; so, their product is tiny. Hence $$\Delta A\approx \Delta h\cdot w(t)+\Delta w\cdot h(t),$$ or $$\frac{\Delta A}{\Delta t}\approx\frac{\Delta h}{\Delta t}\cdot w(t)+\frac{\Delta w}{\Delta t}\cdot h(t).$$ Does this look at all like the product rule? Letting $\Delta t\rightarrow0$, this approximation (properly formalized, of course) leads us to the formula $$\frac{d}{dt}\left[w(t)\cdot h(t)\right]=\frac{dA}{dt}=\frac{dh}{dt}\cdot w(t)+\frac{dw}{dt}\cdot h(t)$$

Hint: Use the product rule for derivatives.

Alternately, proceed by definition, using trig properties (continuity, angle sum):

\begin{align}\frac{d}{dx}[x\sin x] &= \lim_{h\to 0}\frac{(x+h)\sin(x+h)-x\sin x}h\\ &= \lim_{h\to 0}\frac{h\sin(x+h)}h+x\lim_{h\to 0}\frac{\sin(x+h)-\sin x}h\\ &= \lim_{h\to 0}\sin(x+h)+x\lim_{h\to 0}\frac{\sin x\cos h+\sin h\cos x-\sin x}h\\ &= \sin x+x\cos x\lim_{h\to 0}\frac{\sin h}h+x\sin x\lim_{h\to 0}\frac{\cos h-1}h.\end{align} It then remains to show that $\lim\limits_{h\to 0}\frac{\sin h}h=1$ and $\lim\limits_{h\to 0}\frac{\cos h-1}h=0,$ either as "special limits" or by some other means.

• explanation please? Jul 14, 2013 at 17:27
• Check out the link. Have you seen that rule before? Jul 14, 2013 at 17:29
• oh ok...i think i see. i use f'(x) = f(x)*d/dx g(x) + g(x)*d/dx f(x)? Jul 14, 2013 at 17:35
• Exactly. There are other ways to go, too. (Updating my answer now with one alternative.) Jul 14, 2013 at 17:41
• By the way $\frac{\cos h-1}{h}=\frac{(\cos h-1)(\cos h+1)}{h(\cos h+1)}=\frac{-\sin^2 h}{h(\cos h+1)}=\frac{-\sin h}{h}\frac{\sin h}{\cos h+1}\to 0$ as $h\to 0$. So this limit folows from $\lim_{h\to 0}\frac{\sin h}{h}$. Jul 14, 2013 at 19:43

Depending on how familiar you are with the chain rule and derivative of logarithmic functions, you could differentiate $x \sin{x}$ using this alternate method that doesn't directly use the product rule,

\begin{align} y &= x \sin{x} \\ \ln(y) &= \ln( x \sin{x}) \\ \ln(y) &= \ln(x) + \ln(\sin{x}) \\ \frac{1}{y} \frac{dy}{dx} &= \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \\ \frac{dy}{dx} &= \left( \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \right) \cdot y \\ \frac{dy}{dx} &= \left( \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \right) \cdot x \sin{x}\\ \frac{dy}{dx} &= \sin{x} + x \cos{x}. \\ \end{align}

You are probably expected to do this by the product rule, which says:

$(v \cdot w)'=vw'+v'w$

Setting $v=x$ and $w=\sin x$ (it doesn't matter which is which)

$v'=1$ and $w'=\cos x$ . Substituting into the formula:

$(v \cdot w)'=x \cos x+(1) \cdot \sin x$

$x \cos x+ \sin x$

$x\sin(x)$ is the product of two functions. It's easier to see that there are two functions here if you rewrite components of the problem as $f(x)=x$ and $g(x)=\sin(x)$. If the two functions $f(x)$ and $g(x)$ are differentiable (the derivative exists), then their product is also differentiable.
Now apply the product rule: ${(fg)}' = {f}'g+f{g}'$ to get $x\cos(x)+\sin(x)$.