Find an overlapping X coordinate between 2 functions

65 Views Asked by At

just wondering if there is a theorem or method i'm not aware of to satisfy the following without iterating over X :

Given 2 RANDOM functions on a graph, let's say : y=sin(x) and y=sin(3.14159x/3)

Find any occurence of X where both functions share the same polarity. (Polarity means Sign in this context)

Please take note that the functions are completely random : it could as much be a simple y=4 as a complex y=tanh(x/2.13454) + cos(1.938x) + sin(3.444) + ...
However, they all share the origin [0,0].

Thanks !

1

There are 1 best solutions below

5
On BEST ANSWER

Greg Martin's answer is "Multiply the two functions together and try to determine where the product is positive. This can be easy or hard depending on the functions, but it is a standard task when dealing with graphs of functions."