In a typical $\cos(x)$ or $\sin(x)$ function, each successive crest or trough is equidistant from the next.
How can I represent a function where as $x$ increases, the next crest or trough may not be equidistant (slightly more or less than what it should)?
I want to plot this on a graph, so I would prefer it if it is the form $y=\cos(x)$ or something else easy to calculate when I feed it into the computer.
EDIT: Is it possible for this the crests to neither get closer or further as $x$ tends to infinity? (the distance between crests and trough should keep varying, but neither get successively closer or further).
In this example, every two maxima have a unique distance, but the average distance stays constant:
$$f(x)=\cos(g_\epsilon (x)), \qquad g_\epsilon (x)=x+\epsilon \sin(\sqrt{2}\cdot x), \qquad \epsilon=0.4$$
Edit: To understand the idea, first draw the unperturbed inner function $g_0(x)=x$ on a sheet of paper. Whenever this diagonal line crosses the equidistant lines $y=n\pi$, the $\cos(\cdot)$ has a maximum. If we perturb $g_0$ by the small $\sin(\cdot)$-term, it will never be in sync with the lines $y=n\pi$, due to the irrational frequency $\sqrt{2}$. So that should be exactly what you want.