Pergunta de entrevista da empresa I-Con Systems

Asked a question on how to get some calculation based on a given function. There are multiple parts to this simple problem. Easy to solve.