Optimization
Geometric Optimization Graph
Slide a rectangle, an open box, or a cylinder while the objective and its maximum or minimum stay on the graph.
rectangle_max_area(20), rectangle_min_perimeter(36), open_box_max_volume(12,12), and min_surface_area(2*pi) draw the objective with its proven extreme. A slider beside the graph changes the feasible dimension and redraws the rectangle, the open-box net, or the cylinder cross-section without a second request.
The interactive figure is outside the exported graph, so a snapshot of the curve does not include the slider. The cylinder plot uses the horizontal axis for the radius r. The minimum surface area 6*pi occurs at r=1 and h=2.
Equation
rectangle_max_area(20)
Critical points, endpoints, and attained extrema
A single-variable optimization problem asks for the largest or smallest value of a function on an interval. The solver differentiates with the existing derivative routine, solves f'(x)=0, and also keeps points where the derivative does not exist but the function does, such as the corner of abs(x). Every candidate inside the feasible domain is evaluated together with the included endpoints. On a closed bounded interval where the function is continuous, the extreme-value theorem says the absolute maximum and minimum are among those candidates.
An open end is not automatically a maximum or a minimum. If the function only approaches a finite bound, that bound is a supremum or an infimum and the result says it is not attained. Infinity is never treated as a point that is attained. A constant function is both an absolute maximum and an absolute minimum at every feasible point. The geometric commands rectangle_max_area, rectangle_min_perimeter, open_box_max_volume, and min_surface_area build one objective, a constraint, and a feasible domain, then call the same solver. They do not read an arbitrary word problem.
Reading the input
rectangle_max_area(20)— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Other versions of this example
These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.
Maximum area
A perimeter of 20 gives the square with area 25.
rectangle_max_area(20)
Minimum perimeter
Area 36 gives the square with perimeter 24.
rectangle_min_perimeter(36)
Open box
A 12 by 12 sheet has maximum volume 128 when the cut is 2.
open_box_max_volume(12,12)
Cylinder surface
Volume 2*pi gives radius 1 and height 2, with surface area 6*pi.
min_surface_area(2*pi)
Try a change
- Edit one number in the field, then use Generate Graph. The studio opens on the homepage with the edited text and runs it.
- Use Open in DGS Studio when you want the expression loaded but not run yet.
Generate Graph draws the objective and the optimization interval on the existing board, with distinct labels for local and absolute extrema. A geometric example adds an interactive figure outside the exported graph. Zoom, pan, and export stay available.