looks like optimization is workig. the problem was that I forgot to change bounds on current
objective changed to double integral. also got rid of By2 (as it is 0 always)
dx calculation fixed
merged: dx fixed, double integral objective