How to make google graph the min and max value?

2k Views Asked by At

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.

2

There are 2 best solutions below

9
On BEST ANSWER

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 $$

1
On

You can use Wolfram Alpha to get this