2

I have two polynomial equasions, is there a simple way to check if they intersect and if yes determine the exact X value of intersection. Right now i wrote an algorythm that simply bruteforces all the Xs from zero to some approximate intersection point, but i feel like there's a more simple solution.

daw
  • 49,113
  • 2
  • 38
  • 76
  • 7
    One word: subtraction. – Dan Uznanski Aug 05 '22 at 12:06
  • And then take roots. But, finding exact expressions for roots isn’t always possible – FShrike Aug 05 '22 at 12:08
  • 2
    If $f(x)$ and $g(x)$ intersect at some value of $x$, that is saying that $f(x)=g(x)$ for some value of $x$. That is saying that $f(x)-g(x)=0$ for some value of $x$. You can treat $f(x)-g(x)$ as a polynomial itself... call it $h(x)$ if you like. There are standard techniques to determine if there are any values for which $h(x)=0$ and what they are. That is one of the main focal points of what is taught in elementary algebra. – JMoravitz Aug 05 '22 at 12:09
  • 1
    How to solve for the values of $x$ such that $h(x)=0$? You would have heard of things like the quadratic formula... that if $h(x)=ax^2+bx+c$ the values of $x$ such that $h(x)=0$ will be $\frac{-b\pm\sqrt{b^2-4ac}}{2a}$. There exists a generalized solution up to quartics (though hardly anyone bothers memorizing it)... however for quintics and above the Abel-Ruffini theorem shows that no such generic formula with radicals can exist and you might be stuck using numerical methods. – JMoravitz Aug 05 '22 at 12:16
  • As an example, the polynomials $f(x)=x^3-2x^2+4x-21$ and $g(x)=x^2+2x-15$ have in common the root $x=3$. This is equivalent to the fact that the determinant of order $5=3+2$ $$\left|\begin{array}{cc}1&-2&4&-21&0\0&1&-2&4&-21\1&2&-15&0&0\0&1&2&-15&0\0&0&1&2&-15\end{array}\right|$$ be equal to $0$. I just wanted to give this pertinent result here which is not well known by beginners. – Piquito Aug 06 '22 at 13:00

1 Answers1

0

It is pretty simple once you realize you are actually solving for a value of x where both equations are equal, and then you can simply take the 2 functions, or graphs, and then put them in an equation where they are equal to each other. Now, you can solve for x or prove that there is no such solution.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Aug 05 '22 at 21:06