The point of a derivative, in elementary calculus at least, is to find the gradient of a function at any particular point P. Before we learn about calculus, the problem is usually solved by drawing an approximation to the tangent at the point P, forming a right-angled triangle and dividing the length of the vertical side by the length of the horizontal side. This gives the gradient of the hypotenuse of the triangle and hence an approximation to the gradient of the function at the point P.

If we think about the triangle drawing idea above and bring it to a limit, so that we're drawing an arbitrarily small triangle, then we approach the true gradient at the point. This lets us derive the formula for a derivative from first principles.

Say we have the function f and we want to find the gradient at the point x1. Then we 'draw' a horizontal line from the point (x1, f(x1)) to the point (x1 + δx, f(x1)) and a vertical line from the point (x1 + δx, f(x1)) to the point (x1 + δx, f(x1 + δx)), where δx is a small change in the x-coordinate.

Now, dividing the length of the vertical line by the length of the horizontal line, and cancelling, gives us the approximation to the gradient at the point x1:
```                          f(x1 + δx) - f(x1)
---------------------
δx
```
Now, this should give us the exact gradient if we let δx go to zero, so the formula we eventually obtain for the gradient of a function f at a point x1 is:
```                          f(x1 + δx) - f(x1)
f|(x1) = limδx->0 ---------------------
δx
```

Now for a quick example. Anyone who's taken even the most elementary of elementary calculus courses knows that the derivative of xn is nxn-1. Pumping f(x) = xn into the formula derived above gives:
```                          (x1 + δx)n - x1n
f|(x1) = limδx->0 ---------------------
δx
```

Now, by the binomial theorem: (x1 + δx)n = x1n + nx1n-1δx + (n(n-1)/2)x1n-2δx2 + o(δx3)

where o(δx3) means terms where δx is present in at least the third power.

So:
```                          x1n + nx1n-1δx + (n(n-1)/2)x1n-2δx2 + o(δx3) - x1n
f|(x1) = limδx->0 ----------------------------------------------------
δx
nx1n-1δx + (n(n-1)/2)x1n-2δx2 + o(δx3)
= limδx->0 --------------------------------------
δx
nx1n-1δx       (n(n-1)/2)x1n-2δx2        o(δx3)
= limδx->0 -------   +   -----------------   +   -------
δx                 δx                 δx
```

limδx->0 (δx2/δx) and limδx->0 (o(δx3)/δx) are both zero, so, after cancelling δx's, we are left with:

f|(x1) = nx1n-1

which is exactly the result we were looking for. Similar arguments (using expansions and cancelling) can be used to derive the derivatives of lots of functions including the trigonometric functions.
I've used the <pre> tag lots and lots and it looks fine on my system. If it looks all funny, please /msg me.