Good luck optimizing without being able to use the condition f'(x) = 0. You might think you can do everything numerically, but when your function has parameters you're in trouble.
Geez, I don't know why I keep arguing with you people. I've seen several examples where just integrating or derivating something gets you an analytic solution that you can compute in an instant, rather than having to start doing some 3 dimension integrals numerically.