Solve Complex Math Problem