Ma · Mathematics

How to Find the Steepest Slope of a Mountain

Updated 13 October 2026

At a glance

  1. 1. Model the elevation

    Write the mountain’s height as a function h(x,y) of horizontal position.

  2. 2. Find the gradient

    Calculate the partial derivatives h_x and h_y, then evaluate them at the location.

  3. 3. Get the slope and direction

    The gradient’s magnitude gives the maximum rise per horizontal run; the gradient points uphill.

  4. 4. Convert units

    Use consistent distance units to report the result as a grade or an angle.

If a mountain is described by an elevation function h(x,y), its local steepest slope depends on where you are standing. The gradient gives both the direction of the steepest climb and the greatest rate at which elevation increases per unit of horizontal distance.

The method below assumes x and y are perpendicular horizontal coordinates measured on the ground, and h gives elevation. If you mean the steepest slope anywhere on a mapped region, you must also compare the local slopes at different locations.

The gradient gives the steepest uphill direction

At a point (x,y), the gradient of the elevation function is

∇h=(hx,hy)=(∂h∂x,∂h∂y).∇h=(h_x,h_y)=\left(\frac{∂h}{∂x},\frac{∂h}{∂y}\right).

Each component describes how the elevation changes as you move along one coordinate direction. To see how the terrain changes in a particular horizontal direction, represent that direction by a unit vector u=(u₁,u₂). The directional derivative is

Duh=∇h⋅u.D_u h=∇h·u.

Because u has length 1, this dot product is largest when u points in the same direction as ∇h. Therefore:

  • Steepest uphill direction: along ∇h.
  • Maximum rise per unit horizontal distance: the magnitude |∇h|=√(h_x²+h_y²).
  • Steepest downhill direction: opposite ∇h, with the same slope magnitude.

If ∇h=(0,0), the local first-order slope is zero in every direction. That does not mean the entire mountain is flat; it only describes that particular point.

Work through an example

Suppose a simplified mountain model gives elevation in metres, while x and y are horizontal distances in kilometres:

h(x,y)=1800+120x−30x2+80y−20y2.h(x,y)=1800+120x-30x^2+80y-20y^2.

Find the steepest slope at (1,1). First compute the partial derivatives:

hx=120−60x,hy=80−40y.h_x=120-60x,\qquad h_y=80-40y.

At (1,1), these are h_x=60 m/km and h_y=40 m/km. Thus

∇h(1,1)=(60,40) m/km.∇h(1,1)=(60,40)\text{ m/km}.

The maximum rise per kilometre of horizontal travel is

∣∇h(1,1)∣=602+402=5200≈72.11 m/km.|∇h(1,1)|=\sqrt{60^2+40^2}=\sqrt{5200}\approx72.11\text{ m/km}.

The uphill direction is the normalized gradient:

(60,40)/5200=(3/13,2/13)≈(0.832,0.555).(60,40)/\sqrt{5200}=(3/\sqrt{13},2/\sqrt{13})\approx(0.832,0.555).

In words, move in a direction with those x- and y-components to climb most rapidly from that point. The downhill direction is the negative of this vector.

To report the slope as a percent grade, convert the horizontal distance to the same unit as the elevation: 72.11 m per 1000 m is a rise/run ratio of about 0.07211. So the grade is about 7.21%. The angle above the horizontal is arctan(0.07211), or about 4.12°. Grade and angle are different ways of describing the same slope.

If you need the steepest point on the whole mountain

The gradient gives the steepest slope at a specified point. To find the steepest location in a region R, calculate |∇h(x,y)| across the region and find its largest value. If h is continuously differentiable on a neighborhood of a closed, bounded region R, then |∇h| is continuous and attains a maximum there. To locate it, check interior candidates and the boundary, including corners if the boundary has corners. The maximum can occur at the edge rather than at an interior point.

For a one-variable profile h(x), such as a cross-section taken along a trail, use h′(x). Its absolute value is the local rise or fall per unit horizontal distance along that profile. This only finds the steepest slope along the chosen cross-section, not among all possible directions across a two-dimensional mountain.

Common mistakes

  • Using only one partial derivative: h_x or h_y measures slope in one coordinate direction. The steepest direction can lie between the axes, so combine both components using the gradient’s magnitude.
  • Reporting the derivative as an angle: a derivative gives rise per run. For an angle, first form a dimensionless rise/run ratio and take its arctangent. For percent grade, multiply that ratio by 100.
  • Mixing units: if elevation is in metres and horizontal coordinates are in kilometres, the derivative is in metres per kilometre. Convert before treating it as a ratio or calculating an angle.
  • Ignoring coordinate scaling: the simple magnitude formula assumes perpendicular horizontal coordinates with the same distance scale. If the coordinates are map-grid values, degrees of latitude and longitude, or have unequal scales, convert them to physical ground distances before interpreting the result.

References

  1. Calculus: Early Transcendentals — James Stewart, Daniel Clegg, and Saleem Watson

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.