# Finding derivative of a split function using the definition of derivative

I have this function: $f(x) = \begin{cases} \frac{sin^2(3x)}{x}, & \text{if$x\ne0$} \\ 0, & \text{if$x=0$} \end{cases}$

How would I find the derivative of it using the definition of the derivative?

I found using wolfram alpha that the derivative is: $\frac{6sin(3x)cos(3x)}{x}-\frac{sin^2(3x)}{x^2}$

So I started with:

$\lim_{h\to 0}\frac{sin^2(3x+3h)-sin^2(3x)}{xh}$

I've no idea whatsoever to continue from here, can anyone help me or explain me what I should do?

Thanks.

• Are you allowed to use the fact that $\lim_{u\to 0}\frac{\sin u}u=1$? If so, transform your function (when $x\ne 0$) to use that fact. Also, in your limit, I think you mean $h\to 0$. – Rory Daulton Jan 31 '15 at 16:04

You can find the limit of the derivative (without $h$!), but that uses a relatively sophisticated theorem, or go back to the definition: if it exists, $$f'(0)=\lim_{h\to 0}\frac{\cfrac{\sin^2 3h}{h} -0}{h} =\lim_{h\to 0}\Bigl(\frac{\sin 3h}{h}\Bigr)^2=3^2.$$