# How to derive all KKT points of a parametric optimization problem

Suppose we have a symbolic optimization problem where all parameters and decision variables are nonnegative like the following problem. I would be thankful to know if there is any method to find all (potential) KKT points.

Here, $$p$$ is a decision variable and all others are positive parameters.

\begin{align} \underset{p>0}{\max} Q(p)(p-k)+R(p)(f+r-p)\\ Q(p)=Qr(p)+Qk(p)\\ Qk(p)=1-\frac{p-f-\theta(\alpha+\beta)}{\theta(1-\beta)}\\ Qr(p)=\frac{p-f-\theta(\alpha+\beta)}{\theta(1-\beta)}-\frac{p+\frac{1-m}{m}f-(\alpha+\beta)}{1-\beta}\\ R(p)=(1-m)*Qr(p)\\ Qk(p),Qr(p)\ge0\\ p\le f+(1+\alpha)\theta\\ p\ge\frac{f \mu}{m(1-\theta)} \text{(rhs. is positive)} \end{align}

• Please do not post unsearchable pictures of text and equations. Instead typeset in MathJax. Jun 27, 2021 at 0:23
• At first, I wrote equations in LaTeX format, but I faced an error and then I uploaded its picture.
– Amin
Jun 27, 2021 at 0:26
• Well, then, fix the error! Jun 27, 2021 at 1:20
• Actually copy-pastable Mathematica input would be preferred. Jun 27, 2021 at 14:11

Considering the lagrangian L which follows,

Qk[p_] := 1 - (p - f - theta (alpha + beta))/theta/(1 - beta)
Qr[p_] := (p - f - theta (alpha + beta))/
theta/(1 - beta) - (p + (1 - m)/m f - (alpha + beta))/(1 - beta)
R[p_] := (1 - m) Qr[p]
Q[p_] := Qr[p] + Qk[p]

obj = Q[p] (p - k) + R[p] (f + r - p)

L = obj + l1 (p - f mu/m/(1 - theta) - s1^2)
+ l2 (p - f - (1 + alpha) theta + s2^2)
+ l3 (Qk[p] - s3^2)
+ l4 (Qr[p] - s4^2)


here, l1, l2, l3, l4 are generic lagrange multipliers and s1, s2, s3, s4 are slack variables to transform the inequalities into equivalent equations.

The potential KKT points, are the stationary points for L. Those points can be calculated as follows:

grad = Grad[L, {p, l1, l2, l3, l4, s1, s2, s3, s4}]
sols = Solve[grad == 0, {p, l1, l2, l3, l4, s1, s2, s3, s4}]
results = Union[{obj, p, l1, l2, l3, l4, s1^2, s2^2, s3^2, s4^2} /. sols]


and we will consider to qualify, only the points with s1^2 >= 0 && s2^2 >= 0 && s3^2 >= 0 && s4^2 >= 0

• I really appreciate.
– Amin
Jun 28, 2021 at 0:50
• Based on the results,  p = f +(1 + alpha) theta is not a KKT point, but based on the paper that I am studying, it seems that this point is a KKT point, too. How can I verify it? Thanks
– Amin
Jun 28, 2021 at 0:55
• The potential KKT values are the elements of resultst = (results//Transpose)[[2]] . Applying some numerical values to the symbolic parameters can be helpful to choose the feasible KKT points. Jun 28, 2021 at 10:00