# Maximum and minimum functions

I want to let f and g be functions to be defined on a common domain D. Then the maximum and minimum functions are defined as follows for any x belonging to D....

max(f,g)(x) = f(x), if f(x) >= g(x)
max(f,g)(x) = g(x), if g(x) > f(x)

and

min(f, g)(x) = f(x), if f(x) <= g(x)
min(f, g)(x) = g(x), if g(x) < f(x)

How do I define my max(sinx, cosx) and min(x, x^2)?

think about it: when is cos greater than sin over the same domain? clearly the min and max functionals will depend upon the value of theta.

same for x and x^2 - clearly x is greater than x^2 for values less than 1, and less than x^2 for values greater than 1.

lurflurf
Homework Helper
irony of truth said:
I want to let f and g be functions to be defined on a common domain D. Then the maximum and minimum functions are defined as follows for any x belonging to D....

max(f,g)(x) = f(x), if f(x) >= g(x)
max(f,g)(x) = g(x), if g(x) > f(x)

and

min(f, g)(x) = f(x), if f(x) <= g(x)
min(f, g)(x) = g(x), if g(x) < f(x)

How do I define my max(sinx, cosx) and min(x, x^2)?
|f-g|=max(f,g)-min(f,g)
so
max(f,g)=(f+g+|f-g|)/2
min(f,g)=(f+g-|f-g|)/2
also the functions you are considering are continuous so if you find when they are equal, you can find which is greater on an interval where they are always not equal by considering any point in that interval.
for example
f=3x+2
g=2x-3
f=g->x=-5
so we consider
x<-5 then g>f
x>-5 then f>g
or we could try
max(f,g)=(3x+2+2x-3+|3x+2-(2x-3)|)/2
=(5x-1+|x+5|)/2
=(6x+4)/2=3x+2 x>-5
=(4x-6)/2=2x-3 x<-5

• Aryan kumar
lurflurf said:
|f-g|=max(f,g)-min(f,g)
so
max(f,g)=(f+g+|f-g|)/2
min(f,g)=(f+g-|f-g|)/2
also the functions you are considering are continuous so if you find when they are equal, you can find which is greater on an interval where they are always not equal by considering any point in that interval.
for example
f=3x+2
g=2x-3
f=g->x=-5
so we consider
x<-5 then g>f
x>-5 then f>g
or we could try
max(f,g)=(3x+2+2x-3+|3x+2-(2x-3)|)/2
=(5x-1+|x+5|)/2
=(6x+4)/2=3x+2 x>-5
=(4x-6)/2=2x-3 x<-5

I want to know how you got |f-g|=max(f,g)-min(f,g)....

Also, will that example you posted be my guide to solve this? So, I have to say the interval in which the two functions are as designated....

quetzalcoatl9,

You mentioned that "think about it: when is cos greater than sin over the same domain? clearly the min and max functionals will depend upon the value of theta"

The graph seems to look like "lots of McDonald's M"

You also mentioned that "same for x and x^2 - clearly x is greater than x^2 for values less than 1, and less than x^2 for values greater than 1. "

x > x^2 when 0 < x < 1... not less that 1.. :D
x < x^2 when x > 1 or x < 0.

x = x^2 when x = 0 or 1.

rachmaninoff
irony of truth said:
Also, will that example you posted be my guide to solve this? So, I have to say the interval in which the two functions are as designated....

Sine and Cosine are uniquely defined by their behavior on [0, 2pi ). So if you define the behavior of max(Sin(x), Cos(x)) on that interval, by extension you know what it looks like everywhere.

lurflurf
Homework Helper
irony of truth said:
I want to know how you got |f-g|=max(f,g)-min(f,g)....

Also, will that example you posted be my guide to solve this? So, I have to say the interval in which the two functions are as designated....

max(f,g)=min(f,g)->f=g
max(f,g)>=min(f,g)
so max(f,g)-min(f,g)>=0
and either max(f,g)-min(f,g)=f-g or max(f,g)-min(f,g)=g-f
hence
max(f,g)-min(f,g)=|f-g|
There are two easy ways to do these.
They are easy because the functions are continuous and because they are equal only on discrete sets. That is for every x such that f(x)=g(x) there exist a positive number h so that x is the only point of equality in (x-h,x+h).
Method 1: piecewise definition
here we aim to partition the real numbers into intervals and specify which function to use on the interval. ie
x<a
a<x<b
b<x<c
c<x
with f(x)=g(x) if x=a,b,c
so on any interval where f and g are continuous and never equal |f-g| never changes sign thus if f>g for any point in such an inteval f>g for all points.
method 2: absolute value
max(f,g)=(f+g+|f-g|)/2
min(f,g)=(f+g-|f-g|)/2
allow us to right out the min and max right away
sometimes further simplification is possible
sometimes we use this to give the min and max as piecewise defined functions

Hmm, thank you for the help...

If I were to define my function, can I just "plugged in" the f(x) and g(x) with their corresponding functions.. then just analyze the behavior of their graphs, of course, I will have to find those intervals?

max(sinx, cosx)

max(f,g)(x) = sinx, if sinx >= cosx
max(f,g)(x) = cosx, if cosx > sinx

lurflurf
Homework Helper
irony of truth said:
Hmm, thank you for the help...

If I were to define my function, can I just "plugged in" the f(x) and g(x) with their corresponding functions.. then just analyze the behavior of their graphs, of course, I will have to find those intervals?

max(sinx, cosx)

max(f,g)(x) = sinx, if sinx >= cosx
max(f,g)(x) = cosx, if cosx > sinx
find out when sin(x)=cos(x)
then show sin(x)-cos(x) changes sigh at all of its zeros
then which function (sin(x) or cos(x)) is used in each interval can be found by finding which is used for any point in the interval
as has been said you can do any interval of length 2pi and then extend to all numbers.
max(f,g)(x) = sinx, if sinx >= cosx
max(f,g)(x) = cosx, if cosx > sinx
is a fine definition
as is
max(f,g)(x)=(sin(x)+cos(x)+|sin(x)-cos(x)|)/2
but you probably what to express the conditions
sin(x) > cos(x)
cos(x) > sin(x)
in a more useful form
what properties of max(sin(x),cos(x)) do you want to highlight?

Ok... I got it... thank you for the help