Differentiate by first principle,$f(x)=\frac{x^2}{\sin x}$ Differentiate by first principle,$f(x)=\frac{x^2}{\sin x}$

$$f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$$
$$f'(x)=\lim_{h\to0}\frac{\frac{(x+h)^2}{\sin(x+h)}-\frac{x^2}{\sin x}}{h}$$
$$f'(x)=\lim_{h\to0}\frac{\frac{(x+h)^2\sin x-x^2\sin(x+h)}{\sin(x+h)\sin x}}{h}$$
$$f'(x)=\lim_{h\to0}\frac{(x+h)^2\sin x-x^2\sin(x+h)}{h\sin x\sin(x+h)}$$
$$f'(x)=\lim_{h\to0}\frac{x^2}{\sin x}\frac{(1+\frac{h}{x})^2\sin x-\sin(x+h)}{h\sin(x+h)}$$
I am stuck here.
 A: \begin{eqnarray}
\dfrac{f(x+h)-f(x)}{h}&=&\dfrac{1}{h}\left[\dfrac{(x+h)^2}{\sin(x+h)}-\dfrac{x^2}{\sin x}\right]\\
&=&\dfrac{(x+h)^2\sin x-x^2\sin(x+h)}{h\sin x\sin(x+h)}\\
&=&\dfrac{[(x+h)^2-x^2]\sin x+x^2\sin x-x^2\sin(x+h)}{h\sin x\sin(x+h)}\\
&=&\dfrac{[(x+h)^2-x^2]\sin x-x^2[\sin(x+h)-\sin x]}{h\sin x\sin(x+h)}\\
&=&\dfrac{1}{\sin x\sin(x+h)}\left[\dfrac{(x+h)^2-x^2}{h}\cdot\sin x-x^2\cdot\dfrac{\sin(x+h)-\sin x}{h}\right]
\end{eqnarray}
Since
\begin{eqnarray}
\lim_{h\to0}\dfrac{1}{\sin x\sin(x+h)}&=&\dfrac{1}{\sin^2x}\\
\lim_{h\to0}\dfrac{(x+h)^2-x^2}{h}&=&\lim_{h\to0}\dfrac{x^2+2xh+h^2-x^2}{h}=\lim_{h\to0}\dfrac{2xh+h^2}{h}=\lim_{h\to0}(2x+h)=2x\\
\lim_{h\to0}\dfrac{\sin(x+h)-\sin x}{h}&=&\dfrac{d}{dx}(\sin x)=\cos x
\end{eqnarray}
it follows that
$$
\lim_{h\to0}\dfrac{f(x+h)-f(x)}{h}=\dfrac{1}{\sin^2x}[2x\cdot\sin x-x^2\cdot\cos x]=\dfrac{2x\cdot\sin x-x^2\cdot\cos x}{\sin^2x}
$$


Added:
  Using the limits
  $$
\lim_{h\to0}\dfrac{\cos h-1}{h^2}=-\frac12,\quad \lim_{h\to0}\dfrac{\sin h}{h}=1,
$$
  we get:
  \begin{eqnarray}
\lim_{h\to0}\dfrac{\sin(x+h)-\sin x}{h}
&=&\lim_{h\to0}\dfrac{\sin x\cos h+\cos x\sin h-\sin x}{h}\\
&=&\lim_{h\to0}\left[\dfrac{\sin x\cos h-\sin x}{h}+\dfrac{\cos x\sin h}{h}\right]\\
&=&\sin x\cdot\lim_{h\to0}\dfrac{\cos h-1}{h}+\cos x\cdot\lim_{h\to0}\dfrac{\sin h}{h}\\
&=&\sin x\cdot 0+\cos x\cdot 1\\
&=&\cos x
\end{eqnarray}

A: Note that $$\lim _{ h\to 0 } \frac { 2\sin ^{ 2 }{ \frac { h }{ 2 }  }  }{ h } =\lim _{ h\to 0 } \frac { \sin { \frac { h }{ 2 } \cdot \sin { \frac { h }{ 2 }  }  }  }{ \frac { h }{ 2 }  } =\lim _{ h\to 0 } \frac { \sin { \frac { h }{ 2 }  }  }{ \frac { h }{ 2 }  } \sin { \frac { h }{ 2 }  } =0$$
so
$$
\begin{align}
f'(x)&=\lim _{ h\to 0 } \frac { (x+h)^{ 2 }\sin  x-x^{ 2 }\sin  (x+h) }{ h\sin  x\sin  (x+h) }\\&=\lim _{ h\to 0 } \frac { { x }^{ 2 }\sin  x+2xh\sin { x+{ h }^{ 2 }\sin { x }  } -x^{ 2 }\sin  x\cos { h } -{ x }^{ 2 }\sin { h\cos { x }  }  }{ h\sin  x\sin  (x+h) }\\ &=\lim _{ h\to 0 } \frac { { x }^{ 2 }\sin  x\cdot \left( 1-\cos { h }  \right) +h\sin { x\cdot \left( 2x+h \right)  } -{ x }^{ 2 }\sin { h\cos { x }  }  }{ h\sin  x\sin  (x+h) }\\&=\lim _{ h\to 0 } \frac { { x }^{ 2 }\sin  x\cdot \frac { 2\sin ^{ 2 }{ \frac { h }{ 2 }  }  }{ h } +\sin { x\cdot \left( 2x+h \right)  } -{ x }^{ 2 }\frac { \sin { h }  }{ h } \cdot \cos { x }  }{ \sin  x\sin  (x+h) }\\& =\frac { 2x\sin { x-{ x }^{ 2 }\cos { x }  }  }{ \sin ^{ 2 }{ x }  } 
\end{align}$$
A: Let's go back to here:
$$f'(x)=\lim_{h\to0}\frac{(x+h)^2\sin x-x^2\sin(x+h)}{h\sin x\sin(x+h)} =$$
$$\lim_{h\to0}\frac{x^2(\sin x - \sin(x+h)) + (2xh+h^2)\sin x}{h\sin x\sin(x+h)} =$$
$$\lim_{h\to0}\left(\frac{x^2(\sin x - \sin x\cos h - \cos x\sin h)}{h\sin x\sin(x+h)}+\frac{2x+h}{\sin(x+h)}\right) =$$
$$\lim_{h\to0}\left(\frac{hx^2}{\sin(x+h)}\cdot\frac{1-\cos h}{h^2} -\frac{x^2\cos x}{\sin x\sin(x+h)}\cdot\frac{\sin h}{h}+\frac{2x+h}{\sin(x+h)}\right) =$$
$$0 - \frac{x^2\cos x}{\sin^2x} + \frac{2x}{\sin x} =$$
$$\frac{2x\sin x - x^2\cos x}{\sin^2x}$$
