Integral:$$I=\int_{0.3}^{2.0}\frac{e^{-x}\text{dx}}{(2+x-x^2)^{1/4}}$$
The function is not defined for $x=2$ ,which lies in the interval $[0.3,2.0]$. All the functions I've previously approximated were continuous over the entire interval $[a,b]$ where $a$ and $b$ were the bounds of the integral. How should one go about approximating integrals with discontinuities?
The idea is to note that the singularity at $2$ is an integrable singularity, so that we can find a bound for $\int_{2-\delta}^2 f(x) dx$ which goes to zero as $\delta$ goes to zero. In this case $(2+x-x^2)=-(x^2-x-2)=-(x-2)(x+1)$, so its magnitude is greater than, say, $2|x-2|$ on $[2-\delta,2)$ once $\delta<1$. Similarly the magnitude of $e^{-x}$ is less than, say, $e^{-1}$ under similar circumstances. Hence
$$\int_{2-\delta}^2 \frac{e^{-x}}{(2+x-x^2)^{1/4}} dx \leq \int_{2-\delta}^2 \frac{e^{-1}}{2^{1/4} |x-2|^{1/4}} dx$$
provided $\delta<1$. But this integral can be explicitly calculated; it is some multiple of $\delta^{3/4}$. Note that for a function continuous on $[2-\delta,2]$, you would have a multiple of $\delta^1$, so the singularity is slowing down the decay as $\delta$ goes to zero. But it is not destroying it entirely, which is crucial.
Now you can compute $\int_{0.3}^2 f(x) dx$ as $\int_{0.3}^{2-\delta} f(x) dx + \int_{2-\delta}^2 f(x) dx$ where you choose $\delta$ so small that the second term is less than $0.015$ (so that in your solution you drop it entirely) and then compute the first term to within an accuracy of $0.015$ using whatever method you like.
There are more efficient ways to do this. For example, you could choose $\delta$ so small that the bound for the second term is merely less than $0.03$, and then approximate the second term by half of its bound. Since the integrand is also nonnegative, this will give an error of at most $0.015$. You'll get to use a slightly larger value of $\delta$ which will somewhat accelerate the convergence for the integration on $[0.3,2-\delta]$. You could also elect to partition the error in another way (devoting more of the error to one piece than the other).