vectorize a function

Sure you are right. I had a large code with several issues so please let me see how to simplify the code to focus only on the core function to vectorize. Many thanks. In the meantime i posted a question indirectly but got in addition to the vectorize problem a problem of integration , this is why i seperate the points. If you want you can have a look here (*) at the three last threads. Many thanks.