# How to make google graph the min and max value?

I can put e.g. sin(x),cos(x) in google's search box and it will plot the 2 functions. But if I only want to plot the maximum value, how do I plot something like max(sin(x),cos(x)) or the minimum ? I'm not sure but if the max and min are not implemented maybe trigonometric functions can implement the max / min functions?

## Update

I was not clear enough. I want something like max(sin(x), 0.5x) and only plot the maximum value at each x.

-
You mean like this and this? Maybe get MMA or some other CAS. –  Amzoti Mar 8 '13 at 23:56

Use $\frac{sin(x)+cos(x)+|sin(x)-cos(x)|}{2}$ or (sin(x)+cos(x)+abs(sin(x)-cos(x)))/2 for max(sin(x),cos(x)) and $\frac{sin(x)+cos(x)-|sin(x)-cos(x)|}{2}$ for min(sin(x),cos(x)).

like this.

EDIT: Seems like I wasn't clear enough, for any arbitrary f(x) and g(x) you can use 1/2*(f(x)+g(x)+abs(f(x)-g(x))) to plot max(f(x),g(x)).

EDIT 2: Note that $$\forall x, f(x) < g(x): |f(x) - g(x)| = g(x) - f(x) \implies f(x) + g(x) + |f(x) - g(x)| = 2g(x).$$

$$\forall x, f(x) > g(x): |f(x) - g(x)| = f(x) - g(x) \implies f(x) + g(x) + |f(x) - g(x)| = 2f(x).$$

$$\implies \forall x: f(x) + g(x) + |f(x) - g(x)| = 2* max(f(x),g(x)).$$

$$\square$$

-
You beat me to it by a second :) +1 –  Sasha Mar 8 '13 at 23:59
Thank you but I think I want it more general i.e. max(f(x),g(x)) and I was not clear enough in the post. –  909 Niklas Mar 9 '13 at 0:07
Just replace the sin and cos with f and g. Edited. –  Fardad Jalili Mar 9 '13 at 0:08
Proved it will work in any case :). Edited, second. –  Fardad Jalili Mar 9 '13 at 0:16
Well, it will be ugly. Use the fact that max(f,g,h) = max(f,max(g,h)). example: max(sin(x),cos(x),tan(x)) will be 1/2*(sin(x)+(1/2*(cos(x)+tan(x)+abs(cos(x)-tan(x)))+abs(sin(x)-(1/2*(cos(x)+tan‌​(x)+abs(cos(x)-tan(x))))). I don't know if google's engine will parse such a big string as a formula or not. –  Fardad Jalili Mar 9 '13 at 0:26