# Maximum and minimum values

1. Aug 26, 2012

### ronho1234

i know this is a basic calculus question, but i can't seem to get two answers.

G(x) = 1/2 x^2sin2x+1/2 xcos2x - 1/4 sin2x

find the maximum and minimum values for G(x) on the interval [0,pi/2]

i found G'(x)= x^2 cos2x and i know that there is a global max at pi/4 but i can't find the min value for G(x)...

2. Aug 26, 2012

### Mentallic

The max and min values can be found either at the turning points of the function, or on the boundaries. So from G'(x)=0 we can see we need to test x=0 and x=$\pi$/4 but we also have the boundary conditions and it's quite possible that the min or max lies on the edges, so at x=0 and x=$\pi$/2 (clearly x=0 overlaps so we aren't going to test it twice).

3. Aug 26, 2012

### ronho1234

yes i kind of understand what you mean...
but since pi/2 is a boundary how do i know if its a max or min
do i substitute it back into g(x) and g'(x) if so i get -pi/4 and -1 respectively
sorry i still don't quite get it, could you please show me hot to work it out

4. Aug 26, 2012

### Mentallic

What does the maximum and minimum value mean?

If I have some function y=f(x) then what are we given when we substitute some constant in for x, say, x=1?

What if we plug this x-value value into the derivative, y=f'(x)?

5. Aug 26, 2012

### Ray Vickson

If you want to maximize a smooth function f(x) on an interval [a,b] (that is, on the interval a ≤ x ≤ b that includes both endpoints), then: (i) in order that x=a be a (local) max it is *necessary* to have f'(a) ≤ 0 (that is, f(x) must _not be strictly increasing_ just to the right of a); (ii) in order tht x = b be a local max, it is necessary to have f'(b) ≥ 0 (so that f(x) is not strictly decreasing just to the left of b).

Of course, the conditions for a min are the opposite of the above.

Neither of these conditions is *sufficient* unless the inequalities are strict; that is, you can have f'(a) = 0, and x = a can be either a max or a min.

RGV

6. Aug 26, 2012

### Mentallic

Or you could just as simply calculate the value of f(a) and f(b) to determine whether it's the min/max for that continuous interval.

7. Aug 26, 2012

### Ray Vickson

OK, but the derivative will tell you whether nearby points are better or worse then the endpoint. Alternatively, you could compute f(x) at an endpoint and at another point very near the endpoint, to check how the function is behaving near the boundary.

RGV

8. Aug 26, 2012

### Mentallic

I'm not disagreeing with you that checking the derivative at the endpoints is usually a better method, I'm just offering the OP another (probably more simple) way of understanding how to find min/max values on an interval.

9. Aug 26, 2012

### Ray Vickson

Unfortunately, just computing f at the endpoints is not enough; we also need some information about the behaviour of f near the endpoints (is it increasing? decreasing?) One way, as I suggested, is to evaluate f'(a) and f'(b) (as well as f(a) and f(b)); another way is to reason it out: if y < b is the right-most stationary point in (a,b), then f will be decreasing between y and b if y is a max, and will be increasing between y and b if y is a min, etc. *Some* kind of information of that type is required.

Anyway, testing f' at the endpoints is included as a vital part of most standard numerical optimization routines that utilize derivative methods.

RGV

Last edited: Aug 26, 2012