# Minimize function with parameters: how to properly define constraints on the parameters

I am trying to find a minimum of a function consisting of variables and parameters, where I only want to minimize with respect to the variables while defining constraints on the parameters. To illustrate, here a simple example:

I want to minimize the energy function

E = 2 A/Δ + 2 Ku Δ


with respect to Δ, assuming that A and K are positive. Here is my attempt:

Minimize[{2 A/Δ + 2 Ku Δ, {A > 0, Ku > 0, Δ > 0}}, Δ]


The code does yield a result that distinguishes between cases of A,K>0 and cases where that condition is not fulfilled, indicating to me that the constraints are not properly taken into account.

How do I properly define constraints on the parameters, such that the code yields only one solution:

{4 Sqrt[A Ku],{Δ ->Sqrt[A/Ku]}}


I could not find any documentation on minimizing functions with parameters.

In this case, the easiest approach is just to simplify the resulting expression with some assumptions noted:

Simplify[
Minimize[{2 A/Δ + 2 Ku Δ, {A > 0, Ku > 0, Δ > 0}}, Δ],
Assumptions -> {A > 0, Ku > 0, Δ > 0}]


{4 Sqrt[A Ku], {Δ -> Sqrt[A/Ku]}}

• +1 for this workaround. However, I still would like to see if there is a correct syntax for specifying the constraints such that they are properly considered already in the Minimize function. – Felix Aug 24 '16 at 18:48
• The way you have expressed it is asking Mathematica to only find values of Delta that make Ku and A positive. – mikado Aug 24 '16 at 18:50

Very similar to @user21382, but wrapping the whole expression in Assuming. For some reason, the Minimise ignores the assumptions, so a Simplification step is still required.

Note that putting the Ku>0, A>0 is unnecessary (this is like asking Mathematica to find a Δ that satisfies these constraints.

Assuming[A > 0 && Ku > 0, Simplify[Minimize[{2 A/Δ + 2 Ku Δ, {Δ > 0}}, Δ]]]

• Does that mean that it is not possible to specify assumptions on the parameters within the Minimize function? – Felix Aug 24 '16 at 19:33
• @Felix: I don't know of any way to do it. – mikado Aug 24 '16 at 19:35

To set global assumptions, you can do:

\$Assumptions = A > 0 && Ku > 0


Then, this statement:

Simplify[Minimize[{2 A/Δ + 2 Ku Δ, {Δ > 0}}, Δ]]


returns the correct results. Strangely, this does NOT work without the Simplify:

Minimize[{2 A/Δ + 2 Ku Δ, {Δ > 0}}, Δ]


I do not know why. This seems like a bug.