how to calculate cubic function - Search