MinValue
Details and Options
- MinValue is also known as infimum.
- MinValue finds the global minimum of f subject to the constraints given.
- MinValue is typically used to find the smallest possible values given constraints. In different areas, this may be called the best strategy, best fit, best configuration and so on.
- If f and cons are linear or polynomial, MinValue will always find the global infimum.
- The constraints cons can be any logical combination of:
-
lhs==rhs equations lhs>rhs, lhs≥rhs, lhs<rhs, lhs≤rhs inequalities (LessEqual,…) lhsrhs, lhsrhs, lhsrhs, lhsrhs vector inequalities (VectorLessEqual,…) Exists[…], ForAll[…] quantified conditions {x,y,…}∈rdom region or domain specification - MinValue[{f,cons},x∈rdom] is effectively equivalent to MinValue[{f,cons∧x∈rdom},x].
- For x∈rdom, the different coordinates can be referred to using Indexed[x,i].
- Possible domains rdom include:
-
Reals real scalar variable Integers integer scalar variable Vectors[n,dom] vector variable in
Matrices[{m,n},dom] matrix variable in 
ℛ vector variable restricted to the geometric region 
- By default, all variables are assumed to be real.
- MinValue will return exact results if given exact input. With approximate input, it automatically calls NMinValue.
- MinValue will return the following forms:
-
fmin finite minimum ∞ infeasible, i.e. the constraint set is empty -∞ unbounded, i.e. the values of f can be arbitrarily small - MinValue gives the infimum of values of f. It may not be attained for any values of x, y, ….
- N[MinValue[…]] calls NMinValue for optimization problems that cannot be solved symbolically.
Examples
open all close allBasic Examples (5)
Find the minimum value of a univariate function:
MinValue[2x ^ 2 - 3x + 5, x]Find the minimum value of a multivariate function:
MinValue[(x y - 3) ^ 2 + 1, {x, y}]Find the minimum value of a function subject to constraints:
MinValue[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]Find the minimum value as a function of parameters:
MinValue[a x ^ 2 + b x + c, x]Find the minimum value of a function over a geometric region:
MinValue[x + y, {x, y}∈Disk[]]Plot3D[{x + y, %}, {x, y}∈Disk[], PlotStyle -> Opacity[0.7]]Scope (36)
Basic Uses (7)
Minimize
over the unconstrained reals:
MinValue[Sin[x] + Cos[x], x]Minimize
subject to constraints
:
MinValue[{x + 2y, x ^ 2 + 2y ^ 2 ≤ 3 && x + y == 2 && x ≥ 1}, {x, y}]Constraints may involve arbitrary logical combinations:
MinValue[{x y, x ^ 2 + y ^ 2 ≤ 1 || (x + 1) ^ 2 + (y - 1) ^ 2 ≤ 2}, {x, y}]Minimize[{x + y, x ≤ y ^ 2}, {x, y}]MinValue[{x + y, x ^ 2 + y ^ 2 < 0}, {x, y}]The infimum value may not be attained:
MinValue[Exp[x], x]Plot[Exp[x], {x, -3, 3}]Use a vector variable and a vector inequality:
MinValue[{{1, 1}.v, {{1, 2}, {1, 0}}.v{3, -1}}, v]Univariate Problems (7)
Unconstrained univariate polynomial minimization:
MinValue[x ^ 4 + 2x ^ 3 + 5x - 7, x]Constrained univariate polynomial minimization:
MinValue[{3x ^ 2 - x + 9, 2x ^ 3 + 5x - 7 ≥ 0}, x]MinValue[E ^ (2E ^ x) - Log[x ^ 2 + 1] - 20x, x]Analytic functions over bounded constraints:
MinValue[{AiryAi[x + Sin[x]] + Cos[x ^ 2], -5 ≤ x ≤ 5}, x]Plot[{AiryAi[x + Sin[x]] + Cos[x ^ 2], %}, {x, -5, 5}]MinValue[{BesselJ[2, x] / Gamma[x + 1] + (x + 1) ^ Sin[x], 0 ≤ x ≤ 10}, x]Plot[{BesselJ[2, x] / Gamma[x + 1] + (x + 1) ^ Sin[x], %}, {x, 0, 10}]MinValue[{Sin[x], -1 / 2 ≤ Cos[x] ≤ 1 / 2}, x]Combination of trigonometric functions with commensurable periods:
MinValue[Sin[E ^ (x / 3) - 3 x] + 2 Cos[2 E ^ (x / 3) - 6 x + 1] ^ 2, x]Combination of periodic functions with incommensurable periods:
MinValue[Sin[Sqrt[3] x] - Exp[Cos[3 x] + 2], x]Plot[{Sin[Sqrt[3] x] - Exp[Cos[3 x] + 2], %}, {x, -50, 50}]MinValue[{x - Floor[x + UnitStep[x - 1]], Ceiling[Abs[x]] < 5}, x]Unconstrained problems solvable using function property information:
MinValue[SinhIntegral[DawsonF[x]], x]MinValue[BesselJ[7 / 4, x ^ 2 + x + 1], x]Multivariate Problems (9)
Multivariate linear constrained minimization:
MinValue[{2x + 3y - z, 1 ≤ x + y + z ≤ 2 && 1 ≤ x - y + z ≤ 2 && x - y - z == 3}, {x, y, z}]Linear-fractional constrained minimization:
MinValue[{(2x + y - z) / (5x - 7y + 3), 0 ≤ x + y + z ≤ 1 && 1 ≤ x - y + z ≤ 2 && x - y - z == 3}, {x, y, z}]Unconstrained polynomial minimization:
MinValue[(x ^ 2 - 2y) ^ 2 - x ^ 2 + 2y - 1, {x, y}]Constrained polynomial optimization can always be solved:
MinValue[{x y - 1, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]The minimum value may not be attained:
MinValue[{x ^ 2 + 1, x y ≥ 1}, {x, y}]The objective function may be unbounded:
MinValue[{x, x y ≤ 1}, {x, y}]There may be no points satisfying the constraints:
MinValue[{x, x ^ 2 + y ^ 2 < 0}, {x, y}]Quantified polynomial constraints:
MinValue[{(x + 7)^2 + (y - 8)^2, Subscript[∀, z]Subscript[∃, w]3 z^2 w + (x + y) z^4 - 1 == (x^3 - x y + y^2 - 1) w^2}, {x, y}]MinValue[{Sqrt[x + y] + x , x Sqrt[y] ≥ 1}, {x, y}]Bounded transcendental minimization:
MinValue[{E ^ x + Log[y], x Log[y] == 2 && -10 ≤ x ≤ 10 && 1 / 10 ≤ y ≤ 10}, {x, y}]MinValue[{Max[x - y, Abs[y]], Min[x - 2, x - y ^ 2] ≥ Abs[x y - 1]}, {x, y}]MinValue[v.{-1, 1}, {VectorGreaterEqual[{{{1, 0}, {0, 1}, {-1, -2}}.v, {0, 0, -2}}, "ExponentialCone"]}, v]Minimize convex objective function
such that
is positive semidefinite and
:
MinValue[{-Log[x + y], (| | |
| ----- | ----- |
| x + y | 1 |
| 1 | x - y |)Underscript[, {"SemidefiniteCone", 2}]0 && 1 ≤ x ≤ 10 && -1 ≤ y ≤ 1}, {x, y}]Plot the function and the minimum value over the region:
Plot3D[{-Log[x + y], %}, {x, 1, 10}, {y, -1, 1}, ...]Parametric Problems (4)
Parametric linear optimization:
MinValue[{-8x - 7y, -6 x - 4 y ≤ 8 - 5 a - 7 b && 7 x + 5 y ≤ a + 4 b && -x + y ≤ 6 + 4a - 5 b && -4 x + 7 y ≤ -1 - 2 a - 7 b && 5 y ≤ 6 - 9 b}, {x, y}]The minimum value is a continuous function of parameters:
Plot3D[%, {a, -3, 3}, {b, 0, 3}]Parametric quadratic optimization:
MinValue[{(x - 1) ^ 2 + (2y - 1) ^ 2, x + 2y ≤ a + b && 2x - y ≤ a - b + 1 && x - 2y ≤ 2a - b + 1}, {x, y}]The minimum value is a continuous function of parameters:
Plot3D[%, {a, -5, 5}, {b, -5, 5}]Unconstrained parametric polynomial minimization:
MinValue[x ^ 4 + a x ^ 2 + b, x]Constrained parametric polynomial minimization:
MinValue[{x ^ 2 + y ^ 2, x ^ 3 + y ^ 2 == a}, {x, y}]Optimization over Integers (3)
MinValue[{E ^ x - x ^ 3 Log[x], x > 0}, x, Integers]MinValue[Sin[2x] + Cos[3x], x, Integers]Show[{ListPlot[Table[Sin[2x] + Cos[3 x], {x, 0, 10000}]], Graphics[{Red, Line[{{0, %}, {10000, %}}]}]}]MinValue[{2x + 3y - z, 1 ≤ x + y + z ≤ 2 && 1 ≤ x - y + z ≤ 2 && x - y - z == 3}, {x, y, z}, Integers]Polynomial minimization over the integers:
MinValue[{x ^ 2 + x y + 1, x y ≥ 1}, {x, y}, Integers]Optimization over Regions (6)
Find the minimum value of a function over a geometric region:
ℛ = Cylinder[{{1, 2, 3}, {3, 2, 1}}, 1];MinValue[z, {x, y, z}∈ℛ]Graphics3D[{Opacity[0.5], {Green, ℛ}, {Red, InfinitePlane[{{0, 0, %}, {1, 0, %}, {0, 1, %}}]}}]Find the minimum distance between two regions:
Subscript[ℛ, 1] = Disk[];
Subscript[ℛ, 2] = InfiniteLine[{{-2, 0}, {0, 2}}];MinValue[(x - u)^2 + (y - v)^2, {{x, y}∈Subscript[ℛ, 1], {u, v}∈Subscript[ℛ, 2]}]Graphics[{{LightBlue, Subscript[ℛ, 1]}, {Green, Subscript[ℛ, 2]}, {Blue, Circle[{0, 0}, 1 + Sqrt[%]]}}]Find the minimum
such that the triangle and ellipse still intersect:
Subscript[ℛ, 1] = Triangle[{{0, 0}, {1, 0}, {0, 1}}];
Subscript[ℛ, 2] = Disk[{1, 1}, {2r, r}];MinValue[{r, {x, y}∈Subscript[ℛ, 1] && {x, y}∈Subscript[ℛ, 2]}, {r, x, y}]Graphics[{LightBlue, Subscript[ℛ, 1], Subscript[ℛ, 2]} /. r -> %]Find the minimum radius of a disk that contains the given three points:
Subscript[ℛ, 3] = Disk[{a, b}, r];MinValue[{r, ({0, 0} | {1, 0} | {0, 1})∈Subscript[ℛ, 3]}, {a, b, r}]Using Circumsphere gives the same result directly:
Circumsphere[{{0, 0}, {1, 0}, {0, 1}}]Use
to specify that
is a vector in
:
ℛ = Sphere[];MinValue[x.{1, 2, 3}, x∈ℛ]Find the minimum distance between two regions:
Subscript[ℛ, 1] = Triangle[{{0, 0}, {1, 0}, {0, 1}}];
Subscript[ℛ, 2] = Disk[{2, 2}, 1];MinValue[EuclideanDistance[x, y], {x∈Subscript[ℛ, 1], y∈Subscript[ℛ, 2]}]Graphics[{{LightBlue, Subscript[ℛ, 1], Subscript[ℛ, 2]}, {Blue, Circle[{2, 2}, 1 + %]}}]Options (2)
Method (1)
Specify that MinValue should use cylindrical algebraic decomposition:
mincad = MinValue[{x ^ 2 - y ^ 3 + 2x y, x ^ 2 + y ^ 2 == 1}, {x, y}, Method -> "CAD"]minlm = MinValue[{x ^ 2 - y ^ 3 + 2x y, x ^ 2 + y ^ 2 == 1}, {x, y}, Method -> "LagrangeMultipliers"]mindef = MinValue[{x ^ 2 - y ^ 3 + 2x y, x ^ 2 + y ^ 2 == 1}, {x, y}]RootReduce[mincad] === RootReduce[minlm] === RootReduce[mindef]WorkingPrecision (1)
Finding the exact minimum takes a long time:
TimeConstrained[MinValue[{x ^ 2 + y ^ 2 + z ^ 2, x ^ 2 - 3 x y z + 9 z ^ 2 + y ^ 2 == E && x y z ≤ Pi}, {x, y, z}], 60]With WorkingPrecision->100, the result is an exact minimum value, but it might be incorrect:
MinValue[{x ^ 2 + y ^ 2 + z ^ 2, x ^ 2 - 3 x y z + 9 z ^ 2 + y ^ 2 == E && x y z ≤ Pi}, {x, y, z}, WorkingPrecision -> 100]//TimingApplications (9)
Basic Applications (3)
Find the minimal perimeter among rectangles with a unit area:
MinValue[{2x + 2y, x y == 1 && x > 0 && y > 0}, {x, y}]Find the minimal perimeter among triangles with a unit area:
triangle = a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a;
s = 1 / 2(a + b + c);MinValue[{a + b + c, triangle && Sqrt[s(s - a)(s - b)(s - c)] ^ 2 == 1}, {a, b, c}]Find the distance to a parabola from a point on its axis:
MinValue[{Sqrt[x ^ 2 + (y - c) ^ 2], y == a x ^ 2}, {x, y}]Assuming a particular relationship between the
and
parameters:
Assuming[0 < 1 / (2c) < a, Refine@ MinValue[{Sqrt[x ^ 2 + (y - c) ^ 2], y == a x ^ 2}, {x, y}]]Geometric Distances (6)
The distance of a point p to a region ℛ is given by MinValue[EuclideanDistance[p,q],q∈ℛ]. Find the distance of {1,1} to the unit Disk[]:
p = {1, 1};
q = {q1, q2};
ℛ = Disk[];d = MinValue[EuclideanDistance[p, q], q∈ℛ]Graphics[{{LightBlue, EdgeForm[Gray], ℛ}, {Green, Circle[p, d]}, {Red, Point[p]}}]Find the distance of the point {1,3/4} to the standard unit simplex Simplex[2]:
p = {1, 3 / 4};
q = {q1, q2};
ℛ = Simplex[{{0, 0}, {1, 0}, {0, 1}}];d = MinValue[EuclideanDistance[p, q], q∈ℛ]Graphics[{{LightBlue, EdgeForm[Gray], ℛ}, {Green, Circle[p, d]}, {Red, Point[p]}}]Find the distance of the point {1,1,1} to the standard unit sphere Sphere[]:
p = {1, 1, 1};
q = {q1, q2, q3};
ℛ = Sphere[];d = MinValue[EuclideanDistance[p, q], q∈ℛ]Graphics3D[{{Opacity[0.5], ℛ}, {Opacity[0.3], Green, Sphere[p, d]}, {Red, Point[p]}}]Find the distance of the point {-1/3,1/3,1/3} to the standard unit simplex Simplex[3]:
p = {-1 / 3, 1 / 3, 1 / 3};
q = {q1, q2, q3};
ℛ = Simplex[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];d = MinValue[EuclideanDistance[p, q], q∈ℛ]Graphics3D[{{Opacity[0.5], ℛ}, {Opacity[0.3], Green, Sphere[p, d]}, {Red, Point[p]}}]The distance between regions and can be found through MinValue[EuclideanDistance[p,q],{p∈,q∈}]. Find the distance between Disk[{0,0}] and Rectangle[{3,3}]:
𝒫 = Disk[{0, 0}]; 𝒬 = Rectangle[{3, 3}];MinValue[EuclideanDistance[p, q], {p∈𝒫, q∈𝒬}]Find the distance between Line[{{0,0,0},{1,1,1}}] and Ball[{5,5,0},1]:
𝒫 = Line[{{0, 0, 0}, {1, 1, 1}}]; 𝒬 = Ball[{5, 5, 0}, 1];MinValue[EuclideanDistance[p, q], {p∈𝒫, q∈𝒬}]Properties & Relations (5)
Minimize gives both the value of the minimum and the minimizer point:
Minimize[{x - 2y, x ^ 2 + y ^ 2 ≤ 1}, {x, y}]MinValue gives an exact global minimum value of the objective function:
f = Expand[Product[(x - i)(x - 100 - i), {i, 5}]];MinValue[f, x]Plot[f, {x, 0, 100}, Epilog -> {Green, Dashing[Medium], Line[{{0, %}, {100, %}}]}]NMinValue attempts to find a global minimum numerically, but may find a local minimum:
NMinValue[f, x]Plot[f, {x, 0.5, 5.5}, Epilog -> {Red, Dashing[Medium], Line[{{0.5, %}, {5.5, %}}]}]FindMinValue finds local minima depending on the starting point:
FindMinValue[f, {x, #}]& /@ {1, 50}Plot[f, {x, 0, 100}, Epilog -> {Dashing[Medium], {Red, Line[{{0, %[[1]]}, {100, %[[1]]}}]}, {Green, Line[{{0, %[[2]]}, {100, %[[2]]}}]}}]MinValue can solve linear programming problems:
MinValue[{2x + 3y - z, 1 ≤ x + y + z ≤ 2 && 1 ≤ x - y + z ≤ 2 && x - y - z == 3}, {x, y, z}]LinearProgramming can be used to solve the same problem given in matrix notation:
c = {2, 3, -1};
m = {{1, 1, 1}, {1, 1, 1}, {1, -1, 1}, {1, -1, 1}, {1, -1, -1}};
b = {{1, 1}, {2, -1}, {1, 1}, {2, -1}, {3, 0}};c.LinearProgramming[c, m, b, -Infinity]Use RegionDistance to compute the minimum distance from a point to a region:
ℛ = Cone[{{1, 2, 3}, {4, 5, 6}}, 3];
p = {5, 4, 3};RegionDistance[ℛ, p]//RootReduceCompute the distance using MinValue:
MinValue[Norm[{x, y, z} - p], {x, y, z}∈ℛ]//RootReduceUse RegionBounds to compute the bounding box:
f = x^4 + 3 x^2 y + 2 x^2 y^2 - y^3 + y^4 ≤ 0;
ℛ = ImplicitRegion@@{f, {x, y}}RegionBounds[ℛ]Use MaxValue and MinValue to compute the same bounds:
{{x1, x2}, {y1, y2}} = {MinValue[#, {x, y}∈ℛ], MaxValue[#, {x, y}∈ℛ]}& /@ {x, y}Show[{Graphics[{LightBlue, Rectangle[{x1, y1}, {x2, y2}]}], RegionPlot[f, {x, x1 - 1, x2 + 1}, {y, y1 - 1, y2 + 1}]}]Possible Issues (1)
MinValue requires that all functions present in the input be real valued:
MinValue[{x + y, Sqrt[x] - Sqrt[y] == 0}, {x, y}]Values for which the equation is satisfied but the square roots are not real are disallowed:
{Sqrt[x] - Sqrt[y] == 0, Sqrt[x], Sqrt[y]} /. {x -> -1, y -> -1}Related Guides
History
Introduced in 2008 (7.0) | Updated in 2014 (10.0) ▪ 2021 (12.3)
Text
Wolfram Research (2008), MinValue, Wolfram Language function, https://reference.wolfram.com/language/ref/MinValue.html (updated 2021).
CMS
Wolfram Language. 2008. "MinValue." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/MinValue.html.
APA
Wolfram Language. (2008). MinValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MinValue.html
BibTeX
@misc{reference.wolfram_2026_minvalue, author="Wolfram Research", title="{MinValue}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/MinValue.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_minvalue, organization={Wolfram Research}, title={MinValue}, year={2021}, url={https://reference.wolfram.com/language/ref/MinValue.html}, note=[Accessed: 12-June-2026]}