The overall goal of my current code is to get J[x] to run. I can get it get to run but the problem is that I need the variable segments to be around 10. When I run 2 segments it takes about 33 seconds, 4 segments 122 seconds, 6 segments 544 seconds. (I'm only interested in part I right now.)
When I try to run anything higher, I give up because it takes so long.
I've read that I could use NDsolve to evaluate the NIntegration once but I don't know how to implement it with two variables.
Thanks for any help.
Attachment: Assignment 2.nb, URL: ,