Hey johnsy123.

The peaks and troughs for your final function should occur when the derivative is equal to 0. So you will have a maximum at the first point when the derivative = 0, a minimum at the next point the derivative = 0, a maximum after that and so on (all are local minimums and maximums).

You've done the above in the graph and really the rest of the details is getting fine-control of the shape but that's not really easy in all situations.