# Find max/min values of f(x)=cos(x)-sin(x)

1. Mar 3, 2009

### ugeous

Find max/min values of f(x)=cos(x)-sin(x) in the interval of -pi (smaller or equals)x(smaller or equals)pi

I took the derivative and ended up with f`(x)=-sin(x)-cos(x). By setting it equals to zero, i get sin(x)=-cos(x). This is where I'm stuck. Don't know where to go from here.

thx!

2. Mar 3, 2009

### Dick

Divide both sides by cos(x). Remember the definition of tan.

3. Mar 3, 2009

### carlodelmundo

Hi ugeous. Good work so far.

From the equation, sin (x) = - cos (x)... you have to interpret the answer from a "unit circle" stand point.

Ignore the signs. Pretend the equation reads sin(x) = cos(x). When is sin equal to cos? That's simple... whenever they have the same coordinates (found in Q1 and Q3 at pi/4 and 7pi/4).

Your equation sin (x) = - cos (x) dictates that the sin(x) and cos(x) differ by a difference in sign. For what values will sin (x) and cos(x) have the same numerical value but different sign? (ie: when is it -sqrt(2)/2 for one and sqrt(2)/2 for the other).

4. Mar 3, 2009

### lurflurf

I would have started with
f(x)=cos(x)-sin(x)=2sin(pi/4)cos(x+pi/4)
sin(x)=-cos(x)
sin(x)^2=cos(x)^2
sin(x)^2+cos(x)^2=1
sin(x)^2=1/2
|sin(x)|=1/sqrt(2)
cos(x)^2=1/2
|cos(x)|=1/sqrt(2)

Last edited: Mar 3, 2009
5. Mar 3, 2009

cute
Which one?

6. Mar 3, 2009

### Dick

The one that defines tan in terms of sin and cos, I think. Or maybe it's a theorem depending on how you define things.

7. Mar 3, 2009

### carlodelmundo

Can you explain this line:

sin(x)^2+cos(x)^2=1
sin(x)^2=1/2 --> How did you jump from the former to this line?

and by squaring both sides of the equation, are you not adding "false roots?"

he's talking about tan x = sin x / cos x

8. Mar 3, 2009

### lurflurf

(1) sin(x)^2+cos(x)^2=1
Is true for all x
(2) sin(x)^2=cos(x)^2
is true for the unknown x
thus
sin(x)^2+sin(x)^2=1
(replace cos(x)^2 in (1) by sin(x)^2 as allowed by (2))
2sin(x)^2=1
sin(x)^2=1/2
|sin(x)|=1/sqrt(2)
find all such x (hint obvious)
then exclude those that do not satisfy
sin(x)=-cos(x)

9. Mar 3, 2009

### carlodelmundo

Thanks sir. that makes sense

10. Mar 4, 2009

### ugeous

OK, I see. I used Dick's method (seems to be the fastest), and got the correct answer for maximum value(check with calculator), but how would I find the minimum value here? Equation that gave me max value was tan (x) = -1. Do I just need to use a different method for min value?

11. Mar 4, 2009

### Dick

You should have found two critical points where f'(x)=0 on the interval [-pi,pi]. Check the values at both of them and don't forget to check the values at the endpoints as well. Draw a rough graph of the function to keep it clear in your head.

12. Mar 4, 2009

### ugeous

This question is driving me crazy.......

I did find critical point, but I can't seem to find the second one. I know that usually you have more than one critical point when x can be more then one value, and still satisfy the equation. In this case, I had sin(x)=-cos(x). By dividing both sides by cos(x) i got sin(x)/cos(x)=-cos(x)/cos(x) which gives me tan(x)=-1. That's how I found the first x value. I found the second x value by using graphing calculator, and even when i plug it into tan(x)=-1, the equation is still valid. I'm just missing a step where I need to get to that x value algebraically. I'm not sure how I can do that.

13. Mar 4, 2009

### Dick

You know exact values for trig functions at certain angles because you know the relations between the sides of a 45-45-90 triangle and a 30-60-90 triangle. A graphing calculator not telling you this. Look at a graph of sin and cos. sin(-pi/4)=(-sqrt(2)/2), cos(-pi/4)=sqrt(2)/2. So tan(-pi/4)=-1. What are the values at 3*pi/4?

14. Mar 4, 2009

### ugeous

-sqrt2/2, sqrt2/2 i believe.

15. Mar 4, 2009

### Dick

Sure. And -pi/4 and 3*pi/4 are your critical points, right?

16. Mar 4, 2009

### ugeous

Right!

17. Mar 4, 2009

### ugeous

Finally got it! Thank You!!!