Directional derivatives – something new again?

Krystian Karczyński

Founder and General Manager of eTrapez.

Graduate of Mathematics at Poznan University of Technology. Mathematics tutor with many years of experience. Creator of the first eTrapez Courses, which have gained immense popularity among students nationwide.

He lives in Szczecin, Poland. He enjoys walks in the woods, beaches and kayaking.

Place and time of action

Calculating directional derivatives as a subject to be covered (i.e. to be passed) is actually right after partial derivatives of functions of many variables, which most students cover in the second semester.

However, this is a topic rarely taken up that I did not include it in my Partial Derivatives Course and often enough that I will post it on the blog – for the benefit of those who need to learn directional derivatives and those who are simply curious about what’s up. However, I would like to point out that, as in the Courses, I will focus today almost exclusively on practice (“how do I do it?”) and not on theory (“what am I actually doing?”).

Directional derivatives – how do I do it?

In the case of the directional derivative, there is a simultaneous increment of the arguments x and y, which of course corresponds to a certain increment in the value of f(x,y) .

We need three things for the task:

  1. The function from which we will calculate the directional derivative.
  2. The point at which we will calculate the directional derivative.
  3. The direction given in the form of a vector.

With the above, the task boils down to converting the vector into a direction vector (something from analytic geometry, I’ll show you how to do it in a moment), and then inserting into the formula:

f'_{\vec{v}_k}(P_0)=\frac{\partial f}{\partial x}(P_0)*v_x+\frac{\partial f}{\partial y}(P_0)*v_y

Where in:

f' _{\vec{v} _k}(P_0) is the directional derivative at the point P_0 in the direction of the vector \vec{v}

P_0 is the point where we take the directional derivative

v_x, v_y are the coordinates of the directional vector \vec{v}_k

\frac{\partial f}{\partial x}(P_0), \frac{\partial f}{\partial y}(P_0) are the partial derivatives of f(x,y) at point P_0.

Example 1

Take the directional derivative of f(x,y)=x^4+y^3+2xy+1 at P(1,2) in the direction of \vec{v}=[3,-1] .


Everything is given on a tray, only from vector \vec{v} =[3,-1] you need to make a direction vector. A direction vector is a vector with the same direction (who would have thought), sense, but length 1. It is calculated from the formula:

\vec{v} _k=\frac{1}{|{\vec{v} }|}\vec{v}

So it just divides its coordinates by its length. So we calculate the length of vector \vec{v} :

|\vec{v} |=\sqrt{3^2+(-1)^2}=\sqrt{9+1}=\sqrt{10}

Then we go to the direction vector:

\vec{v}_k=\frac{1}{\sqrt{10}} [ 3,-1 ]= [ \frac{3}{\sqrt{10}} ,\frac{-1}{\sqrt{10}} ]

For the directional derivative formula, we will also need derivatives from the function f(x,y)=x^4+y^3+2xy+1 at point P(1,2):

\frac{{\partial} f}{{\partial} x}=4x^3+2y


\frac{{\partial} f}{{\partial} y}=3y^2+2x


\frac{{\partial} f}{{\partial} x}(1,2)=4*1^3+2*2=8


\frac{{\partial} f}{{\partial} y}(1,2)=3*2^2+2*1=14

And we have everything we need for the pattern:


We just substitute and we get:

f'_{\vec{v}_k}( 1,2 )= 8*\frac{3}{\sqrt{10}}+14*( \frac{-1}{\sqrt{10}} ) =\frac{10}{\sqrt{10}}


Example 2

Find the directional derivative of z=x^3-3x^2{y}+3xy^2+2 at P(3,1) in the direction from that point to Q(6,5).


The matter is so much more difficult that the direction vector is not given directly, but what does it mean for us. We’re moving from point P to point Q, the displacement vector, so it’s a vector[3,4] .

Now we’re looking for the direction vector by counting the length of the vector[3,4] :

|{\vec{v} }|=\sqrt{3^2+4^2}=5

And we have a direction vector:

\vec{v} _k={1/5} *[ 3,4 ]=[ \frac{3}{5},\frac{4}{5} ]

Now we calculate the partial derivatives at (3,1):

\frac{\partial z}{\partial x}=3x^2-6xy+3y^2


\frac{\partial z}{\partial y}=-3x^2+6xy


\frac{\partial z}{\partial x} ( 3,1 )=3*3^2-6*3*1+3*1^2=12


\frac{\partial z}{\partial y} ( 3,1 )=-3*3^2+6*3*1=-9

Now, we just plug it into the formula for the directional derivative:

f' _{\vec{v} _k} ( 3,1 )=12*\frac{3}{5} -9*\frac{4}{5} =0

 Example 3

Find the directional derivative of f( x,y )=3x^4+xy+y^4 at (1,2) in  direction making an angle with the positive X axis \frac{\pi}{3} .


The task seems to be more difficult due to the lack of a direction vector in the data. But let’s draw the whole thing:

Vector to designate

The point is to find the coordinates of any vector with a given direction. We use the fact that \tg\frac{\pi}{3}=\sqrt{3} and we can assume that our vector has coordinates [ 1,\sqrt{3} ] , as in the picture (it was enough to choose any vector with the direction of the straight line):

Designated vector

And now it’s a old story. We calculate the direction vector:

| \vec{v} |=\sqrt{1^2+( \sqrt{3} )^2}=2


\vec{v}_k=\frac{1}{2} *[ 1,\sqrt{3} ]=[ \frac{1}{2} , \frac{\sqrt{3}}{2} ]

Then the partial derivatives at (1,2):

\frac{\partial f}{\partial x}=12x^3+y


\frac{\partial f}{\partial y}=x+4y^3 \frac{\partial f}{\partial x}( 1,2 )=12*1^3+2=14 \frac{\partial f}{partial y}( 1,2 )=1+4*2^3=33

Substitute into the formula and we get the result:

f' _{\vec{v} _k}( 1,2 )=14*\frac{1}{2} +33*\frac{\sqrt{3}}{2}=7+\frac{33\sqrt{3} }{2}

Feel free to ask questions in the comments – as always 🙂

Are you looking for college or high school math tutoring? Or maybe you need a course that will prepare you for the final exam?

We are "eTrapez" team. We teach mathematics in a clear, simple and very precise way - we will reach even the most knowledge-resistant students.

We have created video courses translated in an easy, understandable language, which can be downloaded to your computer, tablet or phone. You turn on the video, watch and listen, just like during private lessons. At any time of the day or night.

Leave a Reply

Your email address will not be published. Required fields are marked *

Your comment will be publicly visible on our website along with the above signature. You can change or delete your comment at any time. The administrator of personal data provided in this form is eTrapez Usługi Edukacyjne E-Learning Krystian Karczyński. The principles of data processing and your related rights are described in our Privace Policy (polish).