# directional derivative unit vector

I just recently learned about directional derivatives and I am really lost on how they come up with unit vector or direction. I get that they come up with partial derivatives for each function and to each partial derivative multiply by its unit vector but what I dont understand is how they come up with that unit vector. For example I have a solved question below that puzzles me on how they found its unit vector.

-
If you have an angle $\theta$, the unit vector in that direction is $(\cos \theta, \sin \theta)$. – Javier Mar 8 '12 at 20:24

The direction is something you can change at whim, independently of the function itself, so there's no place it "comes" from in this problem any more than there is a place the function itself "comes" from. Of course given the angle of the direction we want to investigate, we can explicitly write the direction with unit vector $(\cos\theta,\sin\theta)$; here $\theta$ is $\pi/4$, representing a perfect Northeast direction, but it could have been chosen to be anything else.

Visually, you can understand a function of two variables to be "elevation" and the two coordinates locally as longitude/latitude (or whatever), in which case the function defines a sort of geography with rolling hills and praires stretching out all over the place. The directional derivative tells us how steep the geography is in a particular direction at a particular point; if you're on the side of a hill then the direction up the hill is steep, the direction down the hill is the steep in the reverse way, and if you were in the middle of a praire all of the directions would look flat in the immediate vicinity.

-
is the unit vector always costheta,sintheta? – Raynos Mar 8 '12 at 21:04
@Raynos: Take a look. – anon Mar 8 '12 at 21:06

The direction is given by the angle $\theta=\pi/4$. One vector in this direction is $(1,1)$. But you can't use this for the direction vector in the definition of the directional derivative. You need a vector of length one. So, take $(1,1)$ and divide it by its length: $\sqrt{ 1^2+1^2}=\sqrt 2$. This gives a "proper" direction vector (that is a unit vector):$$\textstyle{1\over\sqrt2}(1,1)= ({1\over\sqrt2},{1\over\sqrt2}) =({\sqrt2\over2},{\sqrt2\over2}).$$

I imagine, though, in the answer in you post, they recalled from memory the values of $\cos$ and $\sin$ for $\theta=\pi/4$ to obtain the (unit) direction vector.

-