DGS Studio

Optimization

Geometric Optimization Problems

Named rectangle, open-box, and cylinder problems. Each one builds an objective and reuses the interval solver.

rectangle_max_area(20) uses A(x)=x*(10-x) on (0, 10). The maximum area is 25 square units at the square x=y=5, and the infimum 0 is not attained. rectangle_min_perimeter(36) minimizes P(x)=2*(x+36/x) for x>0. The minimum perimeter is 24 units, again at a square.

open_box_max_volume(12,12) maximizes V(x)=x*(12-2*x)^2 on (0, 6). The derivative factors as 12*(x-6)*(x-2); x=6 is excluded and x=2 gives volume 128 cubic units. min_surface_area(2*pi) is the closed cylinder S(r)=2*pi*r^2+4*pi/r. The minimum is 6*pi at r=1, where the height 2 equals the diameter. These four commands are not a parser for arbitrary word problems.

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

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 rectangle area

Perimeter 20. The maximum area is 25 for the square with side 5. The infimum 0 is not attained.

rectangle_max_area(20)

Minimum rectangle perimeter

Area 36. The minimum perimeter is 24 for the square with side 6.

rectangle_min_perimeter(36)

Open-top box

A 12 by 12 sheet. The maximum volume is 128 cubic units when the cut is 2. The critical point x=6 is outside the domain.

open_box_max_volume(12,12)

Closed cylinder

Volume 2*pi. The minimum surface area is 6*pi at radius 1, where the height equals the diameter.

min_surface_area(2*pi)

Try a change

Solve Equation shows the objective, the first derivative, the critical points, the endpoint values, and whether each extreme is attained. An open bound that is not reached is a supremum or an infimum.

Edit and generate

Solve Equation opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples