Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I am struggling so much with optimization.

  1. Apr 19, 2010 #1
    Is anyone able to give me some pointers. I am trying to brush up on my calculus I for my next calc class and I can't grasp optimization. I hated it then and I hate it now. I can do everything else in calculus I except this and it's so irritating. I can learn every integration rule in Calc I in a day but it's been a week and I am still not able to look at a blank question and buckle down and answer it. I understand (but haven't memorized) the formulas but when it gets to it and I see the work being done I just get lost. Is there a step-by-step system people use for solving these?
     
  2. jcsd
  3. Apr 19, 2010 #2
    Write the function you want to optimize, take the derivative with respect to the variable you want optimize, set it equal to zero.
     
  4. Apr 19, 2010 #3
    Yes, that is one type of optimization. Optimization is a collection of techniques. Like a subject rather than a formula. It's about finding "optimum" values of a function.

    The best way to see what you are doing is is to graph the problem and solution. You have to understand what the optimization excercise is going to really do before you do it. Are you looking for a minimum of the function? Are you looking for the "x" that makes the function minimum but don't care what the function value is there? Are you looking for where the function is a maximum? Etc. Understand the meaning of the optimization question first. Then start looking for the right solutions. It will go from a painful chore into a cool puzzle.
     
  5. Apr 20, 2010 #4

    hotvette

    User Avatar
    Homework Helper

    Can you provide an example problem that is causing you trouble?
     
  6. Apr 20, 2010 #5

    DaveC426913

    User Avatar
    Gold Member

    I read the title as I'm struggling so much with optimism. I thought maybe it was a cry for help.

    Apologies. Carry on. :biggrin:
     
  7. Apr 21, 2010 #6
    Optimization is finding which value(s) of x maximize (or minimize) a function f(x).

    Given a number x, it's easy to find f(x). If you have two numbers, x1 and x2, you can tell which of f(x1) and f(x2) is bigger. But how can you find x_max, where f(x_max) >= f(x) for all other values for x?

    The answer is found in calculus. The intuition is pretty simple. Let's talk mountains instead of functions. Mountains have little peaks and valleys. As you scale a mountain, your elevation rises and falls.

    You can feel when you're ascending and when you're descending. You close your eyes. Is it possible to tell when you've reached a peak on the mountain?

    The answer is yes, and here's how. Just before you reach the peak, you can feel you are ascending. Just after you step off the peak, you can feel you are descending. In other words, you make a transition from ascending to descending.

    Let's relate it back to calculus. The lateral distance (longitude or latitude, your choice) you've traveled across the mountain is x. Your altitude is f(x). The mountain is the graph of the function.

    Your eyes being closed is indicative of the fact you only know the value of f where you are standing. (You can't "look" at nearby parts of the mountain for reference... and you don't need to).

    Ascending and descending are related to your derivative. When you're ascending, you have a positive derivative. When you're descending, you have a negative derivative.

    So the "peak" of a function is when the sign of the derivative changes from positive to negative. And the only way for it to be able to do that is by going from positive to zero to negative. So the first step of looking for maximums is to look for the zeroes of the derivative.

    In notation, what you're trying to solve is: f'(x) = 0.

    Now, f' (for first and second year calculus) is going to be something simple -- usually a polynomial. Finding the zeroes of a polynomial is the most important topic you learn about in algebra.

    Once you find the zeroes of f', you're half way there. You can name the zeroes x1, x2, ..., xN (there might be multiple zeroes, there might be one.... sometimes there are none at all).

    The next step after finding the zeroes is making sure that you are in fact going from positive to negative. It's entirely possible for a function's derivative to go from negative to positive instead -- in this case, you have found a valley, not a peak (a minimum, not a maximum). You can also have negative to negative and positive to positive, or from zero to zero (these are all different kinds of plateau-ish things).

    Up to this point, you're almost done. You've identified all the peaks of your function. But often what you want to find isn't just "any peak", but rather, you want the TALLEST peak. The summit of the mountain. This is usually as easy as comparing all the peaks you found and seeing which is the biggest.

    There are some sneaky cases I've glossed over. A function could have multiple summits that are all the same height (sin x has an infinite number of maximums, for example). Other functions have no peaks (f(x) = x^2 only has a valley, but no peaks, f(x) = x^3 has neither). Everything I said above applies only to "well behaved" functions that you'll find in physics classes. (Mathematicians have more precise rules, and they can invent functions which "technically" obey the rules, but break our expectations).

    Good luck!
     
  8. Apr 23, 2010 #7
    I would advise you to resist cook-book ways of solving problems. That's not what calculus is about. Students typically struggle with word-problems and that's what most optimization problems are. Anyone can find derivatives...after while it's not even interesting. What you can DO with them...that's what's interesting.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook