# How can I find the minimum value of an algebraic expression as a function of some parameters?

Minimize[
{
(2 a (a^2 - c^2))/(a^2 - c^2 Cos[θ]^2),
0 <= θ < π, a > 0, c > 0, a > c
}, {a, c, θ}
] // FullSimplify


The expected result would be:

(2 a (a^2 - c^2))/(a^2 - c^2 Cos[θ]^2)


This formula contains three parameters, but $$a$$ and $$c$$ are considered constants, so the sought after results will still contain $$a$$ and $$c$$. I want to find the minimum value of this expression as a function of $$a$$ and $$c$$, but I have been unable to find it using the above code.

When θ== π/2, I get the correct answer: (2 (a^2 - c^2))/a.

Minimize[{(2 a (a^2 - c^2))/(a^2 - c^2 cos^2), -1 <= cos <= 1, a > 0,
c > 0, a > c}, {cos}]


Note that theta only appears in Cos. Therefore, you can do without Cos and define another variable, call it cos with -1<=cos<=1. With this you get:

Maximize[{(2 a (a^2 - c^2))/(a^2 - c^2 cos^2), -1 <= cos <= 1, a > 0,
c > 0, a > c}, {a, c, cos}]


This produces the warning:

Maximize::natt: The maximum is not attained at any point satisfying the given constraints.


Well, note further, that 1/(a^2 - c^2 cos^2) achieves the largest value under the given constrains for cos= +/- 1. With this we still get the same warning.

But, note further, the target function: (2 a (a^2 - c^2))/(a^2 - c^2 ) simplifies to: 2a. Now it is clear that there is NO maximum.

• to find minimum value Commented May 30, 2023 at 10:15
• Use Minimize, and change {a, c, cos} to just {cos}. Commented May 30, 2023 at 17:02
• Minimize[{(2 a (a^2 - c^2))/(a^2 - c^2 cos^2), -1 <= cos <= 1, a > 0, c > 0, a > c}, {cos}] Commented Jun 4, 2023 at 11:50

Try

NMinimize[{(2 a (a^2 - c^2))/(a^2 - c^2 Cos[\[Theta]]^2), 0 <= \[Theta] < \[Pi] , a > c > 0}, {a, c, \[Theta]}]
{1.24647*10^-10, {a -> 1.48842, c -> 1.48842, \[Theta] -> 2.3277}}


With new parameter cda=c/a we get functional

(2 a (a^2 - c^2))/(a^2 - c^2 Cos[\[Theta]]^2)==a (2 (1 - cda^2))/(1 - cda^2 Cos[\[Theta]]^2)

to be minimized for 0<cda<1. Because a>0 it is only necessary to look at (2 (1 - cda^2))/(1 - cda^2 Cos[\[Theta]]^2)

Plot3D[(2 (1 - cda^2))/(1 - cda^2 Cos[\[Theta]]^2), {cda, 0, 1},{\[Theta], 0, Pi}, MeshFunctions -> {#3 &}]


Obviously there is no unique minimum! Minimal value is 0 at c/a==1 and 0<\[Theta]<1.

• That's not the answer. The answer must contain parameters a and c. The correct answer is:(2 (a^2 - c^2))/a Commented May 30, 2023 at 10:09
• @csn899 Minimization is done fo a ,c,\[Theta], that's why the numerical result doesn't depend on these parameters! Commented May 30, 2023 at 10:19