# Statistical Thermodynamics and Rate Theories/Lagrange multipliers

## Constrained Optimization

When constraints are imposed on a system, Lagrange multipliers can be incorporated to determine the maximum of the multivariable function. The new process for determining maximum of this function within the constraint becomes:

1. Write the constraint as a function. i.e., $g(x,y)=c$
2. Define a new equation. $f(x,y)+{\alpha }({g(x,y)}-{c})$  where $\alpha$  is an undefined constant
3. Solve this set of equations to find the maximum, using the previous three steps for determining the maximum of an unconstrained system.

For example, suppose we have a function $f(x,y)=-{2x}^{2}-{y}^{2}-{xy}-{10y}$  and we impose the following constraint upon the function: $y=x+5$

The constraint would be written as $g(x,y)=x+y=5$

We would then define the new equation following the constraint as $(-{2x}^{2}-{y}^{2}-{xy}-{10y})+{\alpha }({x}+{y}-{5})$

Next, we take the partial derivative with respect for both x and y, set it to zero, and solve for x and y.

First of all taking the partial derivative with respect for x set to zero:

${\frac {\partial }{\partial x}}[(-{2x}^{2}-{y}^{2}-{xy}-{10y})+{\alpha }({x}+{y}-{5})]=0$

Evaluating this will give:

${\alpha }-4x-y=0$

${\alpha }=4x+y$

Now, the partial derivative with respect for y set to zero will be taken:

${\frac {\partial }{\partial y}}[(-{2x}^{2}-{y}^{2}-{xy}-{10y})+{\alpha }({x}+{y}-{5})]=0$

${\alpha }-x-2y-10=0$

${\alpha }=x+2y+10$

This leads to the following system of equations that can be solved to determine the maximum:

${\alpha }=4x+y$

${\alpha }=x+2y+10$

$x+y=5$

From Solving this set of equations the maximum subjected to the constraint of $x+y=5$  is found to be:

$(x,y)=\left({\frac {-35}{8}},{\frac {5}{8}}\right)$

## Unconstrained Optimization

Determining the maximum of an unconstrained system follows very similar steps it just will not have a lagrange multiplier as the system is not subjected to the

maximum along a given line, rather the maximum of the system itself. The steps to solve an unconstrained system becomes:

1. Calculate the partial derivatives
2. set them to zero
3. solve for the variables

For example given the same function of $f(x,y)=-{2x}^{2}-{y}^{2}-{xy}-{10y}$  first the partial derivatives will be calculated to be:

$({\frac {\partial f}{\partial x}})_{y}=-4x-y$

$({\frac {\partial f}{\partial y}})_{x}=-2y-x$

Let both partial derivatives be zero:

$-4x-y=0$

$-2y-x=0$

Finally the variables will be solved for. Giving a maximum that is different than that of the constrained system:

$(x,y)=\left({\frac {10}{7}},{\frac {-40}{7}}\right)$