The following exercises serves as a guided walkthrough for computing the rate of change of a function in the direction of a given line. Suppose that and suppose that we want to find the rate of change of at in the direction of , where is a vector in the positive -direction that is parallel to the line .

We want to use the result

To do so, we must calculate the gradient and find a unit vector in the direction of the line with positive -component.

  • To compute the gradient, note that .

    Thus, .

  • To find the unit vector , we first will find a vector that is in the appropriate direction, then scale it appropriately.

    We can do this two different ways. Both are presented below, and you can choose your favorite way in future problems.

    • Method 1: Use the equation of the line to find a normal vector.

      From the equation of the line , a normal vector to the line is . To find a vector parallel to the line, we can flip the components and negate one of them (which force the dot product of this vector and the original to be ). Our options doing this are thus or . The one that points in the appropriate direction is .

    • Method 2: Parameterize the line, then extract a parallel vector.

      From the equation of the line , we can solve for easily to find . Setting , we find . Thus, a parametric description of the line is

      If we write this in the form , we can use to find . We find that .

    Hence, a unit vector that points in the appropriate direction is thus

    We now can use the formula to compute and find

    From this, we see that at , increasesdecreasesdoes not change in the -direction.