This technique is suitable for any high stretch fabric, Lycra is a classic very high stretch fabric that is used in many sporting and recreational garments, leotards, swimwear, cycling shorts, gym wear and track and field but the same technique can routinely be used on any stretch fabric. You need a decent elastic for this task, the type being used is a woven elastic that does not go weak over time like the older type of stranded elastic. The machinery used is an overlocker and a normal straight sewer. This is the type of stuff you would make if you have a gym junkie in the house, kids who need swimsuits, rock climbers or cyclists.
Lay your elastic at the top edge line you require and pin it in place. If you work on stretchwear on a regular basis you will feed it by hand but that does take practice.
Once you have it pinned up you run it through the overlocker taking particular attention to run the top edge of the elastic as close to the line of the cutting knife as possible.
When the elastic is overlocked onto the top edge, turn the overlocked elastic over and pin it so that the top edge is straight.
The last operation is best done from the front side of the garment, set your straight sewer to a reasonably wide zig zag, use a width reference line or a magnetic side fitting so you can accurately control the position of the zig zag in relation to the top edge. Match the thread colour to the Lycra as close as possible and when finished you can barely even see the stitching.
This technique gives you a robust smooth finished waistband for sporting style garments and by it being close fitting it fits well enough to be resistant to losing the garment when diving or swimming if it is swimwear. One of the tricks when you design the pattern is to test how long the elastic should be by trying it around the prospective wearer. Once you have the elastic tension you want, make the top edge of the patter to match so that when you elasticate the waistband the fabric stretches to the size of the original elastic at the desired stretch rate.
The slightly wavy top edge came from me giving the test piece a good stretch to make sure the zig zag would not break under a severe stretch.