# Find absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

## Homework Statement

Find the absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

-

## The Attempt at a Solution

I know the answer is 0 from looking at a graph, but I cannot figure out how to express my workings algebraically. The end goal of this is to do a presentation on how I figured out the answer and I don't think I can really just get up and draw a graph on sin(x)-cos(x) and then just point at 0. So far I've managed to get the first derivative and find x=-pi/4. From here I just don't know what to do.

SteamKing
Staff Emeritus
Homework Helper

## Homework Statement

Find the absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

-

## The Attempt at a Solution

I know the answer is 0 from looking at a graph, but I cannot figure out how to express my workings algebraically. The end goal of this is to do a presentation on how I figured out the answer and I don't think I can really just get up and draw a graph on sin(x)-cos(x) and then just point at 0. So far I've managed to get the first derivative and find x=-pi/4. From here I just don't know what to do.
Have you calculated f(0)? I think that x = 0 falls in your interval and f(0) < 0.

Chestermiller
Mentor
What is the equation for ##\sin (x - \pi/4)## in terms of sines and cosines of x and pi/4?

What is the equation for ##\sin (x - \pi/4)## in terms of sines and cosines of x and pi/4?

sin(x)cos(pi/4) - sin(pi/4)cos(x)

I feel like I'm missing something really obvious here.

SteamKing
Staff Emeritus
Homework Helper
sin(x)cos(pi/4) - sin(pi/4)cos(x)

I feel like I'm missing something really obvious here.
You are. Check Post #2.

Chestermiller
Mentor
sin(x)cos(pi/4) - sin(pi/4)cos(x)

I feel like I'm missing something really obvious here.
What are the values of sin(pi/4) and cos(pi/4)?

You are. Check Post #2.

Yup, I read that as something else, not sure what but thank you nonetheless.

What are the values of sin(pi/4) and cos(pi/4)?
Theyre both equal to root 2 / 2 so now you have:
root 2 / 2(sinx - cosx)
But I'm failing to see where to go from that. Do you equate it to 0 and then get x=0 or 1?

Chestermiller
Mentor
$$\sin{x}-\cos{x}=\sqrt{2}\sin\left(x-\frac{\pi}{4}\right)=\sqrt{2}\sin\theta$$
where ##\theta=x-\frac{\pi}{4}##. What is the minimum value of ##\sin\theta## between ##\theta=-\frac{\pi}{4}## and ##\theta=+\frac{3\pi}{4}##?

Last edited:
SteamKing
Staff Emeritus
Homework Helper

## Homework Statement

Find the absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

-

## The Attempt at a Solution

I know the answer is 0 from looking at a graph, but I cannot figure out how to express my workings algebraically. The end goal of this is to do a presentation on how I figured out the answer and I don't think I can really just get up and draw a graph on sin(x)-cos(x) and then just point at 0. So far I've managed to get the first derivative and find x=-pi/4. From here I just don't know what to do.
IDK what graph you were looking at which told you that the abs. minimum of f(x) = sin(x) - cos(x) was zero on [0, π], but that graph was wrong.

f(0) = sin (0) - cos (0) < 0

You can check this by using Wolfram Alpha online to plot this function, for example.

It's not what you don't know that's the problem, it's what you know that just ain't so that gets you into trouble.

Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

Find the absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

-

## The Attempt at a Solution

I know the answer is 0 from looking at a graph, but I cannot figure out how to express my workings algebraically. The end goal of this is to do a presentation on how I figured out the answer and I don't think I can really just get up and draw a graph on sin(x)-cos(x) and then just point at 0. So far I've managed to get the first derivative and find x=-pi/4. From here I just don't know what to do.

There is an easy way and a less-easy way. Chestermiller has outlined the easiest way, but if you know some calculus, there is an alternative method. The minimum will either be at an endpoint (##x = 0## or ##x = \pi##), or else at an interior point ##0 < x < \pi##. At an interior-point optimum ##x = x_0## of ##f(x) = \sin(x) - \cos(x)## you need ##df/dx|_{x=x_0} = 0##, giving ##\tan(x_0) = -1##. You ought to be able to solve that (on ##0 < x_0 < \pi##) graphically, by locating on the unit circle the corresponding ##(\cos(x_0), \sin(x_0)##. There are no other points in ##(0, \pi)## where the derivative vanishes.

So, the minimum is either at ##x = 0## or at ##x = \pi## or at ##x = x_0##. You can just go ahead and evaluate ##f(x)## at all three points, and pick the best value. Alternatively, you can perform a second-derivative test to conclude that ##x_0## maximizes ##f(x)##, so cannot be the minimizing point. That leaves just the two points ##x = 0, \pi## to check.

Last edited:
Chestermiller
Mentor
There is an easy way and a less-easy way. Steamking has outlined the easiest way, but if you know some calculus, there is an alternative method. The minimum will either be at an endpoint (##x = 0## or ##x = \pi##), or else at an interior point ##0 < x < \pi##. At an interior-point optimum ##x = x_0## of ##f(x) = \sin(x) - \cos(x)## you need ##df/dx|_{x=x_0} = 0##, giving ##\tan(x_0) = -1##. You ought to be able to solve that (on ##0 < x_0 < \pi##) graphically, by locating on the unit circle the corresponding ##(\cos(x_0), \sin(x_0)##. There are no other points in ##(0, \pi)## where the derivative vanishes.

So, the minimum is either at ##x = 0## or at ##x = \pi## or at ##x = x_0##. You can just go ahead and evaluate ##f(x)## at all three points, and pick the best value. Alternatively, you can perform a second-derivative test to conclude that ##x_0## maximizes ##f(x)##, so cannot be the minimizing point. That leaves just the two points ##x = 0, \pi## to check.
Hi Ray,

I guess you didn't like the method I suggested in post #9?

Chet

LCKurtz
Homework Helper
Gold Member

## Homework Statement

Find the absolute minimum of f(x)=sin(x)-cos(x) on [0,pi]

-

## The Attempt at a Solution

I know the answer is 0 from looking at a graph, but I cannot figure out how to express my workings algebraically. The end goal of this is to do a presentation on how I figured out the answer and I don't think I can really just get up and draw a graph on sin(x)-cos(x) and then just point at 0. So far I've managed to get the first derivative and find x=-pi/4. From here I just don't know what to do.

The first thing I would suggest is that you notice that ##x = -\frac \pi 4## is not on your interval. Can you find any critical points that are on the given interval ##[0,\pi]##? Now, others have given you hints which you don't seem to get, so, alternatively, I would remind you that you have a closed interval domain, so the min must occur at a critical point on the interval or at an end point. If you find a critical point on the interval, it and the end points are all you need to check to find both the max and min on the interval.

[Edit:] I took way too long to type this so I didn't see Ray's post.

Ray Vickson
Homework Helper
Dearly Missed
Hi Ray,

I guess you didn't like the method I suggested in post #9?

Chet

I never said anything of the sort, and I even acknowledged your approach as being the simplest. However, the OP did not seem to connect to that approach, at least not right away. Outlining an alternative is not the same thing as rejecting something. You and I both know how to solve this problem, but the OP seems unsure.

Chestermiller
Mentor
I never said anything of the sort, and I even acknowledged your approach as being the simplest. However, the OP did not seem to connect to that approach, at least not right away. Outlining an alternative is not the same thing as rejecting something. You and I both know how to solve this problem, but the OP seems unsure.
You said something about SteamKing's method, but not mine, and I just thought you had not noticed it.

Chet

Ray Vickson
Homework Helper
Dearly Missed
You said something about SteamKing's method, but not mine, and I just thought you had not noticed it.

Chet

I am truly sorry: I meant you, but mis-attributed the contribution.

I have edited the incorrect attribution.

Last edited:
Chestermiller