Solve Cubic Functions