# Get equation for a curve which intersects x at seemingly randomly distributed points?

Is there any type of function that when graphed would show a curve which intersects the x axis multiple times, with each point being an arbitrary distance from the last?

I mean, not like a trig function where each intersect is the same distance from the last. (2,0); (4,0); (6,0); (8,0). And not like a spiral where the distance gets bigger and bigger (or smaller) (2,0); (4,0); (8,0); (16,0);

But for example, some curve which intersects x-axis at (2,0); (6,0); (14,0); (15,0); (20,0); (122,0)...

Does that type function exist?

If so, is it possible to solve/get the equation, given only those intersect points?

I wouldn't need the exact equation of any particular curve. Just the equation of any curve that happens to intersect x-axis at whatever given arbitrary x values. Is that at least that possible to do?

• Are you looking for something more complicated than just... $y=(x-x_0)(x-x_1)...(x-x_N)$? Jun 16, 2012 at 5:37
• Yes. If I'm given a list of points along the x-axis. Now how can I get an equation to describe a curve (any curve) which touches or crosses the x-axis at those points? Jun 16, 2012 at 19:50
• It would, by the way, be an interesting question to ask whether a polynomial with randomly chosen coefficients has randomly distributed zeros (and, given the pdf for the coefficients, what is the pdf for the zeros). Same for Fourier sine or cosine series with randomly chosen coefficients. Jun 16, 2012 at 22:24
• If you have the points, the equation in my first comment does exactly what you want. As Prof. Bangerth mentioned in his answer below, however, if the number of zeros becomes too large, it may become unstable to evaluate the polynomial in this way. Jun 17, 2012 at 1:48

If the number of zeros you're interested in is relatively small (say, less than 20), then use a random number generator to draw these zeros $x_i$ and then use the function $f(x)=\prod_i (x-x_i)$ -- and voila, you have a function that is zero at a collection of random points $x_i$.
If the number $N$ of zeros becomes large, then a high order polynomial becomes instable to evaluate, and you'll probably want to use a different approach. For example, you could put a low-order polynomial through each set of $n \ll N$ adjacent random zeros and connect them in a $C^1$ way as you would do with splines, for example.
For a set zero points $x_i$ you can always find a function which is zero in all the points, but there is not just one function which fullfills this. This is obvious because any solution which is zero at any point can be multiplied with an arbitrary constant.