Differentiate from the first principle x^2sin(x)?

1 Answer
Feb 25, 2018

(df)/dx = 2xsin(x) + x^2cos(x)dfdx=2xsin(x)+x2cos(x) from the definition of the derivative and taking some limits.

Explanation:

Let f(x) = x^2 sin(x)f(x)=x2sin(x). Then
(df)/dx = lim_{h \to 0} (f(x+h) - f(x))/h
= lim_{h \to 0} ((x + h)^2sin(x + h) - x^2sin(x))/h
= lim_{h \to 0} ((x^2 + 2hx + h^2)(sin(x)cos(h) + sin(h)cos(x)) - x^2sin(x))/h
=
lim_{h \to 0} (x^2sin(x)cos(h) - x^2sin(x))/h +
lim_{h \to 0} (x^2sin(h)cos(x))/h +
lim_{h \to 0} (2hx(sin(x)cos(h) + sin(h)cos(x)))/h +
lim_{h \to 0} (h^2(sin(x)cos(h) + sin(h)cos(x)))/h
by a trigonometric identity and some simplifications. On these four last lines we have four terms .

The first term equals 0, since
lim_{h \to 0} (x^2sin(x)cos(h) - x^2sin(x))/h
= x^2sin(x) ( lim_{h \to 0}(cos(h) - 1)/h)
= 0,
which can be seen e.g. from Taylor expansion or L'Hospital's rule.

The Fourth term also vanishes because
lim_{h \to 0} (h^2(sin(x)cos(h) + sin(h)cos(x)))/h
= lim_{h \to 0} h(sin(x)cos(h) + sin(h)cos(x))
= 0.

Now the second term simplifies to
lim_{h \to 0} (x^2sin(h)cos(x))/h
=x^2cos(x)(lim_{h \to 0} (sin(h))/h)
= x^2cos(x),
since
lim_{h \to 0} (sin(h))/h = 1, as shown here, or e.g. L'Hospital's rule (see below).

The third term simplifies to
lim_{h \to 0} (2hx(sin(x)cos(h) + sin(h)cos(x)))/h
= lim_{h \to 0} 2xsin(x)cos(h) + 2xsin(h)cos(x)
= 2xsin(x),

which after adding to the second term gives that
(df)/dx = 2xsin(x) + x^2cos(x).

Note: By L'Hospital's rule, since \lim_{h \to 0} sin(h)=0 and \lim_{h \to 0} h=0 and both functions are differentiable around h=0, we have that
\lim_{h \to 0} sin(h)/h = \lim_{h \to 0} ((d/(dh))sin(h))/(d/(dh) h) = \lim_{h \to 0} cos(h)=1.
The limit lim_{h \to 0}(cos(h) - 1)/h =0 can be shown similarly.