Contour plot 2026-10-14
A contour plot displays several level curves of a real-valued function of two variables, usually with labels indicating their values. It represents a surface's height on a flat page. Closely spaced level curves indicate a large change per unit distance only when the gaps between their labeled values are comparable.
Derivative along a curve Created 2026-10-14 Updated 2026-10-20
If is differentiable at the point of a differentiable parametric curve, the multivariable chain rule gives
The gradient supplies the local spatial rates; the velocity vector supplies the direction and rate of movement. Their dot product is the change in the sampled scalar field per unit parameter. If the parameter is time, this is a rate per unit time; a directional derivative per unit distance instead uses a unit vector.
Take and the unit circle path . Along the path,
At , the gradient is , the velocity vector is , and their dot product is . The sampled value is and increases at rate one, even though one coordinate is decreasing. This is why a moving observation must combine every coordinate's contribution.
Figure 1.
The gradient and path velocity combine to give the rate of change along a curve
. Left: level curves of , the unit circle path, and arrows at for its velocity vector and a scaled gradient. Right: the sampled function and its tangent line, of slope one at that parameter. The displayed gradient arrow is scaled for readability, without changing its direction. Details.
For a level curve, is constant, so the derivative along a curve is zero and its velocity vector is orthogonal to the gradient. Along other paths, the same formula combines a field's geometry with the observer's motion. [ref].
Gradient Created 2026-09-24 Updated 2026-10-14
In Cartesian coordinates on Euclidean space, the gradient of a scalar-valued differentiable function is the vector of its first partial derivatives. It converts a scalar field, such as temperature or a height, into a vector field describing its local change.
For a unit vector , the directional derivative is . The Cauchy-Schwarz inequality gives . At a point where , the greatest increase per unit distance occurs along , while the opposite direction gives the greatest decrease. These are first-order statements at the current point; they do not predict how the function behaves far along a straight path.
For at , . Moving in the direction gives rate and moving in the direction gives rate , but the steepest direction is , with
The direction has rate zero and is tangent to the level curve through that point. More generally, differentiating along a regular level curve gives , so the gradient is its normal vector.
Figure 1.
A gradient is normal to level curves and determines the directional derivative for every unit direction
. Details.
This is useful when navigating a measured scalar field or applying gradient descent: one collection of partial derivatives predicts every infinitesimal directional change. The derivative assumes a differentiable function, not merely the existence of all directional derivatives. [ref].
Level curve Created 2026-10-07 Updated 2026-10-20
A level curve is the planar level set of a scalar function. Where the gradient does not vanish, the implicit function theorem makes it locally a smooth curve. At a critical point, branches may cross, narrow into a cusp or shrink to a point, so a plot should be interpreted with the local critical-point analysis.
The gradient is and at it is . The directional derivative along a unit vector is maximal in the gradient direction. Therefore
The direction is radially outward from the origin, perpendicular to the circular level curve through the point.
A stationary direction at the point has zero directional derivative, hence is perpendicular to . The two opposite unit directions are
They are tangents to the circular level curve. “Stationary” here means zero first-order change. A finite straight move in a tangent direction gives squared radius and therefore a positive second-order change ; following the curved level set instead keeps exactly constant.
The gradient is and at it is . For a unit vector , the directional derivative is . The Cauchy-Schwarz inequality bounds its absolute value by , with equality in the parallel or antiparallel direction. Thus
The plus sign gives greatest increase; the minus sign gives greatest decrease, with the same magnitude. Stationary directions at the specified point have zero first derivative, so they are perpendicular to the gradient:
These are tangents to the local level curve, not a claim that is itself a stationary point of the two-variable function.
The gradient vanishes when . Put . The Hessian matrix is , so the second-derivative test gives:
The positive-definite and negative definite cases give small closed level curves around the minimum and maximum. At each saddle, the zero contour crosses itself. In fact,
so the entire zero level curve is the union of the line and the ellipse . This factorization fixes the topology of a rough contour sketch. Neither local extremum is global, since the cubic is unbounded above and below.
Figure 1.
Contours of the cubic surface, with its two local extrema, two saddles and exact zero contour
. Details.
For a two-dimensional incompressible flow , the continuity equation is . Locally, or globally on a simply connected fluid region, this permits a streamfunction with
Indeed, the one-form is closed by incompressibility and hence is locally the differential of . Conversely these expressions automatically give zero divergence by equality of mixed derivatives.
A streamline at a fixed time is tangent to the instantaneous velocity field. Along it,
Thus streamlines are connected curves on which the streamfunction is constant; wherever , the level curves have exactly the required tangent direction. At a stagnation point, the tangent is degenerate and distinct branches of a level set need not form a single streamline. For unsteady flow this argument fixes time: it does not identify streamlines with particle pathlines.
For this quartic potential with fourfold symmetry, the first derivatives factor:
The critical points are the origin, the four axis points , and four points with both coordinates nonzero. At the latter, . Subtracting and using gives . Thus the complete list is
where the two signs in the final group are chosen separately.
The Hessian is
At the origin it is , so there is a strict local minimum with value zero. At an axis point its eigenvalues are and , giving a saddle point of a scalar function if and a strict local maximum if . All four axis values are .
At a diagonal point the Hessian has eigenvalues
Hence these four points are strict local maxima for and saddle points of a scalar function for . Their value is . None of these critical points is degenerate when .
To describe the level curves precisely, use polar coordinates and write
For a level , the possible radii satisfy
retaining only real, nonnegative values. This formula, together with reflection in each axis and interchange of the coordinates, determines the level curves. The radial maximum in a direction is , attained at . It also proves that the local maxima identified above are global: the largest directional value is on the diagonals if , and on the axes if .
For negative only the plus sign gives a positive radius, producing one outer closed level curve. At there is the isolated origin and the outer curve . For , where is the saddle value, both radial branches exist in every direction, giving an inner loop around the origin and an outer loop. At they meet at the four saddle points of a scalar function. Above the saddle value, four separate loops surround the four maxima; they shrink to those points at the maximum value. There are no level curves above it.
For , the saddle value is and the four high-level loops lie along the diagonals. For , and the four high-level loops lie along the coordinate axes. The sketches show representative values in both regimes; the highlighted level curve is the saddle level.
Figure 1.
Contours of the fourfold quartic potential, with diagonal maxima for b less than one and axis maxima for b greater than one
. Details.
Finally, at the expression depends only on radius:
Consequently The maximum set is the whole unit circle, not merely four isolated points.
Expand the function into separated terms: , where and . Then
Put and . The nine critical points are all pairs from and . The diagonal Hessian matrix has entries and .
At both entries are positive, giving strict local minima of value . At they have opposite signs, giving four saddle points of value zero. At the three points on the Hessian is degenerate, so its sign alone does not classify them. Use the higher-order test for separated extrema: is negative for small nonzero . At the positive term and negative term give a saddle. At , , so every sufficiently small nonzero displacement decreases and these are strict local maxima.
There are two maxima at , two minima at , and five saddle points: and .
For the level curves, the exact zero set consists of the two parabolas and the oval . They cross at the four nondegenerate saddle points. Small positive levels enclose each maximum; small negative levels enclose each minimum. The degenerate central saddle has quartic narrowing, locally . Far along the axis the function is negative, while far along the axis it is positive. These signs and zero curves determine the connectivity shown in the sketch.
Figure 1.
Level curves, exact zero set and all nine classified critical points of the separated quartic-octic function
. Details.
Put and . The gradient has components and , so a stationary point requires . In the closed square, and , and the compatible possibilities are precisely the four corners and .
The Hessian matrix is
Its eigenvectors and have eigenvalues and . The second-derivative test gives the following classification:
Point || || Hessian eigenvalues || Classification | | | Minima | | | Maxima | | | Saddle point of a scalar function
The corner classifications also hold for the smooth extension beyond the square, and hence for the restricted region. The global bounds show that the stated minima and maxima are global within it. The central point has opposite curvature along the two diagonal directions.
Figure 1.
Energy contours show two minima, two maxima and a central saddle
. The contour crosses at the saddle. Filled markers locate all five points where the gradient vanishes; color and labeled level curves show how the energy changes between them. Details.
Set . The gradient of never vanishes, so the Lagrange multiplier equations apply at a constrained stationary point. They are , , and . Eliminating gives
With , this becomes . The quadratic factor is , so the only real possibility is . Therefore
The level curve through this point is the ellipse , meeting the coordinate axes at and . Its tangent line at has slope , equal to the derivative of the constraint parabola there. The two curves are tangent.
Figure 1.
The smallest elliptical contour meeting the constraint is tangent at the minimum
. The highlighted contour is and the constraint is . Its four axis intercepts and the unique contact point are marked. Details.
The parabola touches this ellipse from outside; every other point on the constraint lies on a larger contour. An exact check of this geometric argument is
with equality only at . Thus the point is the unique constrained global minimum.
Write , where . Because this hyperbolic function has strictly positive derivative , stationary points under an increasing outer function have the same positions and types for and . For ,
The first equation requires or . If , the second gives . If , it gives . These are all the nonzero stationary points. At the origin, , so its gradient is ; the origin is not stationary.
At the Hessian matrix of is , and at it is . At and its Hessian matrices are respectively and . Therefore
The extrema are local: is unbounded above and below on the full plane.
For the level curve geometry, a level is . In particular, the zero level curve is the union of the entire axis and the circle , crossing at the two saddle points. Inside the circle, above the axis and below it; outside, these signs reverse. Levels between and zero have closed loops around the upper minimum as well as unbounded lower-half-plane components. Reflection across the axis reverses the sign and gives the loops about the lower maximum. At the two extremal heights, the corresponding closed loop shrinks to its extremum. These features determine the sketch.
Put . In the right half-plane,
The last two cancel, so . The possible singular point lies outside the open domain .
For , a level curve of value has . These are rays from the origin, restricted to the right half-plane. For positive , the values increase with angle from on the lower boundary to on the upper boundary. If , the function is identically zero. The left panel of the figure in (c) shows these ray-shaped level curves.
With , integrate the coefficient with respect to :
Its other partial derivative is . Matching the coefficient gives . Therefore the differential equation is , and its implicit general solution is
These are level curves of the potential of a conservative vector field. Where , they give the usual graph solution . At , the implicit description retains possible vertical tangents instead of dividing by zero.
Writing the two coefficients as , their mixed derivatives satisfy , so the smooth form is exact on . Integrating the first coefficient with respect to gives . Matching gives . One potential is therefore
The integral curves of are its level curves. Absorbing a factor of two into the constant gives
on real graph branches. The initial condition fixes and selects the positive branch:
This is the maximal smooth graph interval containing ; at either endpoint the level curve has a vertical tangent, so cannot remain finite.
The zero level set is especially simple:
The two axes and the unit circle divide the plane into regions where the signs alternate. Inside the circle, has the opposite sign to ; outside it has the same sign. Closed level curves surround the two interior local minima and two interior local maxima; the zero curves cross at the five saddle points of a scalar function. Farther out, the nonzero level curves are open within the displayed square.
Figure 1.
Contours, stationary points and gradient directions of the quartic surface
. Left: signed level curves and the exact zero set consisting of both axes and the unit circle. Right: normalized gradient directions, including arrows on the zero curves. The nine stationary points are marked in both panels. Details.
Near each local minimum, the gradient points outward; near each local maximum, it points inward. The five remaining points have saddle directions, determined by their indefinite Hessian matrices.
On the -axis the exact gradient is , and on the -axis it is . Thus arrows are perpendicular to the axes and reverse direction at the origin and the unit-axis stationary points.
On the unit circle, substitute into the gradient to obtain
It is radial outward in quadrants I and III, radial inward in quadrants II and IV, and zero at the four axis intersections. These arrows, together with the nearby saddle and extremum patterns, are shown in the right panel of the contour figure. The gradient is normal to every regular level curve and points toward increasing values of .
Now and the origin has stationary value zero. Near it,
The level curves therefore resemble hyperbolas near the saddle point of a scalar function. Along the -axis for , while along the -axis for . The zero level set includes the exact diagonal and another branch crossing it at the origin; this second branch is tangent to but is curved away from the origin. The right panel of the contour figure displays these features.