I write my notes in Latex and when dealing with properties of real scalar functions (usually almost everywhere continuous and with at least first and second derivative) I often have to draw an example, which is not "too regular". For instance I may not want an odd/even function, or not want a minimum or inflection point. This usually ends up with me trying different combinations (addition, multiplication, composition) of the more basic functions ($x^n, \exp(x), \sin(x)$ and related functions). This does produce a "natural result", i.e. something a professor might draw during their lecture, but it can take more time than I'd like.
My question is: is there some way to generate a "natural function" or something akin to this? I imagine this requires some kind of algorithm involving random number generators, which is why I'm asking here.
EDIT: Here are some examples of the functions I have used. First one is $x^3 + \sin(x)/2 + 1$ on $[-1,1]$ (here I needed an invertible function); second one is $\sin(x) e^{-x^2} + 1$ on $[-0.5,1.5]$ (here I needed a function completely inside the rectangle and sufficiently regular); for the third figure I needed an "asymmetric" version of the gaussian (bell-shaped, going to zero rapidly).
I guess another way to ask the question would also be how to "modify" existing functions in a way that suits the occasion, but this might be even more of a broad question than what I've already asked.
I think a series with random coefficients might be the one I'm looking for, although I'm not sure how to implement it in practice (be it in Latex or elsewhere) and thus how it would actually look. I'll leave the post up for a bit more to see if there are more specific answers.



You might consider using a high-degree polynomial, and randomly generating the coefficients. However, this may be too 'regular' for your purposes.