I want to have a fast way (in Matlab) of computing the following integral:(adsbygoogle = window.adsbygoogle || []).push({});

[tex] \int_0^z \cos(\theta(z))\ \mbox{d}z\ \forall z \in [0,1] [/tex]

with [tex] \theta(z) = atan(z) + e^{\int_0^z \chi^2 +a^2\ \mbox{d}\chi} [/tex]

I used an anomyous functions with a quad function to define the [itex] \theta [/itex] then I used a quadv to evalute the integral. Finally I used a for loop to get the integral for a list of discrete values for z in [0,1]. Of course this takes a lot of computation time, I think this has to do with the fact that quad is used in quadv. How can I make this a lot faster?

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab integral

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**