Derivative of a function using definition at a point I'm trying to find the derivative of the function $f(x)=x^2\sin x$ at $x=\pi/2$. Using the definition of the derivative, I got:
$$\lim_{x\to(\pi/2)} \frac{x^2\sin x-(\frac{\pi}{2})^2}{x-\frac{\pi}{2}}$$
I can't seem to be able to come up with any of the common factorising methods that can be used to remove the indeterminable denominator. Is there any way to manipulate this?
 A: You have$$x^2\sin(x)-\left(\frac\pi2\right)^2=x^2\sin(x)-x^2+x^2-\left(\frac\pi2\right)^2,$$and therefore it is enough to check that both limits$$\lim_{x\to\pi/2}\frac{x^2\sin(x)-x^2}{x-\pi/2}\quad\text{and}\quad\lim_{x\to\pi/2}\frac{x^2-(\pi/2)^2}{x-\pi/2}$$exist. And this is easy, since$$\lim_{x\to\pi/2}\frac{x^2\sin(x)-x^2}{x-\pi/2}=\lim_{x\to\pi/2}x^2\frac{\sin(x)-\sin(\pi/2)}{x-\pi/2}$$and$$\lim_{x\to\pi/2}\frac{x^2-(\pi/2)^2}{x-\pi/2}=\lim_{x\to\pi/2}\left(x+\frac\pi2\right)\frac{x-\pi/2}{x-\pi/2}.$$
A: Note that $$f'(\pi /2)= \lim_{h\to0} \frac{(\pi /2 +h)^2 \sin(\pi /2 +h)-(\pi ^2 /4 )\sin(\pi /2)}{h}=$$
$$\lim_{h\to0} \frac{(\pi /2 +h)^2 -\pi ^2 /4 }{h}=\pi $$
A: I would suggest using the equivalent alternative form of the definition of derivative, which is often easier to simplify in practice:
$$f'(a)=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}=\lim_{\Delta x\to0}\frac{f(a+\Delta x)-f(a)}{\Delta x}.$$
Then in this example, the quotient whose limit you need to find takes the form:
$$\begin{aligned}
\frac{\left(\frac{\pi}{2}+\Delta x\right)^2\sin\left(\frac{\pi}{2}+\Delta x\right)-\left(\frac{\pi}{2}\right)^2}{\Delta x} &= \frac{\left(\frac{\pi}{2}+\Delta x\right)^2\cos(\Delta x)-\left(\frac{\pi}{2}\right)^2}{\Delta x} = \\
&= \frac{\left(\frac{\pi}{2}\right)^2\left(\cos(\Delta x)-1\right)+\pi\Delta x\cos(\Delta x)+(\Delta x)^2\cos(\Delta x)}{\Delta x} = \\
&= \left(\frac{\pi}{2}\right)^2\cdot\frac{\cos(\Delta x)-1}{\Delta x}+\pi\cos(\Delta x)+\Delta x\cos(\Delta x),
\end{aligned}$$
and then use the special limit for $\lim\limits_{\Delta x\to0}\dfrac{\cos(\Delta x)-1}{\Delta x}$.
A: Hint: Let's observe that now we can use the L'Hospital's Rule:
$$\lim_{x\to\pi/2}\frac{x^2\sin(x)-x^2}{x-\pi/2}=\lim_{x\to\pi/2}x^2\frac{\sin(x)-\sin(\pi/2)}{x-\pi/2} = (L.H.R.) = \lim_{x\to\pi/2}2x\cos(x) + x^2 \sin(x) - 2x $$ and$$\lim_{x\to\pi/2}\frac{x^2-(\pi/2)^2}{x-\pi/2}=\lim_{x\to\pi/2}\left(x+\frac\pi2\right)\frac{x-\pi/2}{x-\pi/2} (L.H.R.) = \lim_{x\to\pi/2} 2x$$
Can you finish from this?
