solution for session 'Playing with mathematical functions'