What function do you have to minimise to find the minimum in the function I(p) subject to the constraint C(p)=K?
To find the optimum value of a function, I(p), subject to some constraints, (C(p)-K) you introduce the set of Lagrange multipliers and look for the unconstrained optimum of the extended function:
$F(\mathbf{p},\{\lambda_j\}) = I(\mathbf{p}) + \sum_j \lambda_j( C_j(\mathbf{p}) - K_j )$
In other words, you try to find a point where:
$\frac{\partial F(\mathbf{p},\{\lambda_j\})}{\partial p_i} = 0 \qquad \forall \quad i \qquad \textrm{and} \qquad \frac{\partial F(\mathbf{p},\{\lambda_j\})}{\partial \lambda_j } = 0 \qquad \forall \quad j$
The basis of this technique is the recognition that, at a constrained optimum the gradients of the constraint functions are either parallel or antiparallel to the gradient of the target function.
This method is explained in:
https://www.youtube.com/watch?v=ivxdxpv0oQU&ab_channel=GarethTribello
<aside> 📌 SUMMARY:
</aside>