## Optimization

Optimization problems require you to find the best option from a set of alternatives, based on some criteria. In general, you have some function f(x) that you want to maximize or minimize by choosing the value of x that results in the optimal (maximal or minimal) value.

Often, your equation for f(x) will contain another variable other than x. This is where the constraint comes in. It is a different equation that has both variables in it, so you can solve it for the other variable and substitute that into the original function.

Here is the basic strategy for solving optimization problems:

1. Draw a sketch of the problem, if applicable.
2. Introduce variables (as few as possible).
3. Develop a formula for the constrained quantity.
4. Develop a formula for the quantity to optimize.
5. Substitute (3) into (4) and simplify.
6. Take the derivative, set it equal to zero, and solve.
7. Compare the function values for each solution and for the endpoints.
8. Choose the optimal value and determine any remaining variables.

### Example

Given two nonnegative integers a and b that sum to 9, find the maximum value of asqrt(b) assuming a > b.

Since a + b = 9, we have

b = 9 - a.

Now we can rewrite the function that we want to maximize:

f(a) = asqrt(b) = asqrt(9-a).

Taking the derivative gives us

f'(a) = sqrt(9-a) - a/(2sqrt(9-a),

and now we can set it equal to zero to find the turning point:

0 = sqrt(9-a) - a/(2sqrt(9-a)) = (2(9-a))/(2sqrt(9-a)) - a/(2sqrt(9-a)).

Assuming that a != 9, we can drop the denominator, since zeros come from the numerator of a rational:

0 = 2(9-a) - a qquad => qquad a = 6.

If a = 6, then b = 9 - 6 = 3. The values that maximize this function are 6 and 3. They result in a value of 6sqrt(3) ~~ 10.392.

I chose an abstract problem because I didn’t feel like drawing a sketch, but most of the time you will want a sketch. Also, you really should graph the function to verify your answer (that’s how I knew that a = 6 was a maximum and not a minimum).