# [SOLVED] Use Newton's Method for Intersection of 2 Curves

• Mar 31st 2010, 06:48 PM
smv1172
[SOLVED] Use Newton's Method for Intersection of 2 Curves
How do I go about using newton's method to approximate the intersection of the curves:

y = sin(pi*x) and y = 1-x
or a similar problem if you prefer. I have been using newton's method to find the zero of one polynomial but have no idea how to use it to find the intersection of two separate functions. I am also not overly strong with the trig functions so if you do change the problem please keep the format so I can see how to do it like it is.
• Mar 31st 2010, 06:59 PM
Jhevon
Quote:

Originally Posted by smv1172
How do I go about using newton's method to approximate the intersection of the curves:

y = sin(pi*x) and y = 1-x
or a similar problem if you prefer. I have been using newton's method to find the zero of one polynomial but have no idea how to use it to find the intersection of two separate functions. I am also not overly strong with the trig functions so if you do change the problem please keep the format so I can see how to do it like it is.

I assume you are familiar with the method itself, here is how you apply it to this problem.

To approximate the intersection of two curves, you can use Newton's method to approximate the root(s) of their difference.

That is, if the two curves are \$\displaystyle h(x)\$ and \$\displaystyle g(x)\$, then solving for their intersection points requires finding all x-values such that \$\displaystyle h(x) = g(x)\$ which is the same as solving for \$\displaystyle h(x) - g(x) = 0\$.

So let \$\displaystyle f(x) = h(x) - g(x)\$. We can use Newton's method to approximate the zeros of \$\displaystyle f(x)\$, which will be the x-values for our intersection points. Got it?

Also see: Newton's method - Wikipedia
• Mar 31st 2010, 07:07 PM
smv1172
Thanks!
I had tried something similar to that earlier but I must have just entered the formula wrong in the calculator because I was getting wildly different results at each iteration, but I polished it up a little using your advice, and wham I'm getting the results I was anticipating from the graph of the lines thanks!