Which Function spends more time above the other in a given timeframe? And by how much?

31 Views Asked by At

To make things easier to understand, let's use an example: Function 1: y = x Function 2: y = 5sin(5x)/(x) Interval: 0 to 2

Graph via FooPlot

What I'm looking for is the percentage of time one is greater than the other (i.e. Function 2 is greater than Function 1 60% of the time).

I don't care much greater it is than the other function; just over the entire interval, which one was greater more often than the other.

A real-life application would be comparing your investment portfolio to a benchmark & seeing how often you were beating/losing to it (assuming you are crossing over/under it often).

1

There are 1 best solutions below

2
On BEST ANSWER

Let f(x) = Function1 - Function2 and create a sign graph.

Example:

Let f(x) = x - 5sin(5x)/x. Roots to this function between 0 and 2 (found with any graphing calculator) are 0.61, 1.33, and 1.75. So

       -         +         -        +        f(x) 

<----|---------|-------------|---------------|-----------|----> x

   0     0.61      1.33       1.75       2

If f(x) is positive, then Function1 > Function2. If f(x) is negative, then Function2 > Function1.

The intervals over which f(x) is negative are 0 to 0.61 and 1.33 to 1.75. Sum these intervals to get f(x) is negative for 1.03 units over the interval from 0 to 2 or 51.5% (100 * 1.03 / 2) of the interval. So Function2 is greater than Function1 51.5% of the time.

For the question of how much greater or less, you may need to be more specific in your question. I would say that the average value of the function ( $\frac{1}{b - a} \cdot \int_a^b f(x) \, dx$ ) would answer your question. If the $\int_0^2 x - \frac{sin(5x)}{x} \, dx $ is positive, then Function1 has more area than Function2. If the integral is negative, then Function2 has more area that Function1. In this case, the average value of f(x) is equal to -6.29 / 2 = -3.145 units. So Function2 is greater than Function1 by 3.145 units.

This answer assumes you are familiar with the concepts of sign graphs, definite integrals, and the average value of a function over an interval.