1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I Find the function of overlap?

  1. May 10, 2016 #1
    ummm, silly question I suppose(and one with likely no answer), and I don't know which Maths subforum to put it in. It's not a pressing thing, just a curiosity.
    How do I find the equation of a section that is the overlap of two functions? Not the area of such a section(which would be using Integral), but the equation for it.

    e.g I have two functions

    Now I can tell a program to draw this overlap using

    But I would much rather have an equation proper.
    Is this at all possible?
  2. jcsd
  3. May 10, 2016 #2


    Staff: Mentor

    Can you explain a little more by what you mean?

    The equation you are looking for will return what values?

    These functions can be combined in an infinite number of ways:

    ##y=y1(x) + y2(x)##
    ##y=y1(x) * y2(x)##

    where y1 and y2 refer to your two equations.

    Is this for some project?
  4. May 10, 2016 #3


    Staff: Mentor

    By "overlap" I assume you mean the bounded region in the plane that lies above the graph of ##y = x^2 - 4x + 5## and below the graph of ##y = -x^2 + 6x - 4##.

    There is no equation that represents this region, but if you project this region onto the x-axis, you can represent this interval by an inequality.

    For the two equations you gave, both of whose graphs are parabolas, the bounded region is such that ## -x^2 + 6x - 4 \ge x^2 - 4x + 5##. You can use algebraic techniques to rewrite this as a quadratic inequality, and eventually as in equality of the form ##A \le x \le B##.
  5. May 10, 2016 #4

    Well for instance the above example would have results such as:
    f(1.5)=1.25 or 2.75
    f(2.5)=1.25 or 4.75
    f(3.5)=3.25 or 4.75

    So you're saying that it's not possible? Even with the use of complex Numbers or some such?
  6. May 10, 2016 #5
    Yes, you can write a program to do that. The thing you would have to clear up is when you say "or" in your examples.
    For example, you say: f(1.5)=1.25 or 2.75

    Does this mean the program should return either 1.25 or 2.75 randomly? Like one time you call the function and it returns 1.25 and the next time it might say 2.75?
  7. May 11, 2016 #6


    Staff: Mentor

    Generally speaking there is no equation that represents the interval you're interested in, but an inequality can be used to represent an interval, which is what I said in post #3. And complex numbers don't change things and aren't some magical fix.

    A couple of examples...
    ##x^2 = 4##
    Solution set: x = 2 or x = -2

    ##x^2 < 4##
    Solution set: -2 < x < 2, all of the numbers between -2 and 2, excluding the two endpoints
  8. May 11, 2016 #7
    You may have noticed in my response to jedishrfu that I clarify this, and even provide examples.
    f(1.5)=1.25 or 2.75
    f(2)=1 or 4
    i.e. f(2) = 1, or f(2) = 4 using the system you have above.
    Not 1 <= f(2) <= 4

    I used inequalities to show that i wanted the shape(Perimeter(P)) of the area, not the 'area'(A) of the area.
  9. May 11, 2016 #8


    Staff: Mentor

    This doesn't make sense. A function has to have one output, not two. That's in the basic definition of a function.

    I can't even guess at what you're trying to do here. The question, as I understand it, is to find the interval over whiich two graphs overlap (i.e., the two graphs completely bound some region).
    I'm not calculating the area. I'm showing the that graphs of the two parabolas you gave as examples "overlap" over some interval of the form ##A \le x \le B##.

    The shape of the area has almost nothing to do with anything, other than the two graphs bound a specific region. The perimeter of this region isn't pertinent, nor is the area.

    Here is the question you asked in the first post:
    The answer is: You don't find an equation. What you're calling the "overlap" of the two functions is an interval. I'm assuming that by "overlap" you mean the two-dimensional, finite-area region that is bounded above and below by the two curves. Again, the interval is NOT an equation; it's an inequality, with a left endpoint and a right endpoint, like what I wrote above.

    If that's not what you're asking about, please clarify your question.
  10. May 11, 2016 #9
    I've tried clarifying, a couple times!
    I want the equation/function to give the perimeter points of an area that is the overlap of two functions. I really don't want to quote myself as I have repeated a list of outputs and you have even quoted said list.

    As for "This doesn't make sense. A function has to have one output, not two. That's in the basic definition of a function."
    Last edited: May 11, 2016
  11. May 11, 2016 #10


    Staff: Mentor

    There are an infinite number of points on the perimeter of the region we're talking about.

    Your clarification in post 7 was anything but clear. One of the examples you gave was "f(1.5)=1.25 or 2.75". This makes no sense. A function has to have a single output, not two (or more).
    The graph of this relation does not represent a function (assuming that the x and y axes are in the usual places). For a given x value, there are two y values paired with it. That's not a function.
  12. May 11, 2016 #11
    Thank you for explaining to me the definition of "function" that you are working with. Whereas I was raised/taught with what you call a "relation" being called a "function". Now, given we've gotten past this hurdle, do you understand my question or not?

    And there is not an infinite number of points on the perimeter of this region. The perimeter of a region that is the overlap of two 'equations' is by definition the values returned by the two 'equations'.
  13. May 11, 2016 #12
    I already told you this could be done easily. If you answer the question I asked, I can give you a simple code that will do it...
  14. May 11, 2016 #13
    Sure, I apologise, i mean to return both values at once :D
  15. May 11, 2016 #14
    No worries. It is easy to do what you want with a computer. Here is an example I made in MATLAB. I have shown the code which produces the values, how it is called and a plot made from the function.

  16. May 12, 2016 #15


    Staff: Mentor

    I disagree. I don't think you understand the definition of the word "perimeter" or the fact that any line segment or curve is made up of an infinite number of points.

    The perimeter of a region of overlap consists of an infinite number of points. See the graph that mfig posted, labeled Fig 1. The curve that makes up the upper boundary consists of an infinite number of points. The curve that makes up the lower boundary also consists of an infinite number of points. An equation doesn't return values other than true or false. The equation is "true" some pair of numbers (x, y) makes it a true statement.

    In the matlab code that mfig posted, he's setting idx to an inequality of the form ##A \le x \le B## (in his code values for A and B are stated, and the inequality takes the form ##A < x \text{ and } B > x##, with A and B the constants he wrote). His version and mine are equivalent -- we're saying the same thing.

    I said this twice before, so this makes the third time. To find the region of overlap, you need an inequality, which gives you the interval. For each x value in this interval, the graph of one of the functions lies above the graph of the other, so the two graphs form the upper and lower boundaries for a close region. Outside that interval the graphs don't overlap, at least in the sense that they enclose a bounded region.
    Last edited: May 12, 2016
  17. May 12, 2016 #16
    Sure, the line is an infinite number of points. but in the case of
    y=f(x) there is only a finite number of options for y.

    for f(x) where x=2 in the example equations I gave, y can ONLY be 1 and 4. not 1,1.00000000001,1.00000000002, etc. because 1.00000000001 and 1.00000000002 are part of the area not the perimeter.
  18. May 12, 2016 #17


    Staff: Mentor

    For a function, there is only one option for y, for each input value x.

    The matlab code that mfig showed calculates two function values for each x value within the interval: ##f_1() = x^2 - 4x + 5## and ##f_2(x) = -x^2 + 6x - 4##. His code calculates the two function values at x values in the interval ##\frac{5 - \sqrt{7}}{2} < x < \frac{5 + \sqrt{7}}{2}##, an interval that he had to use algebra to get.

    mfig's matlab code calculated a bunch of points on each graph, above this interval, and graphed them to get Fig 1.

    In answer to the question you asked in the first post, there is no equation that represents the two-dimensional bounded region where the two parabolas overlap.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted