User:92anonymous92

Problem 1
$$ I(\lambda)=\int_1^{8} g(x) exp(-\lambda f(x)) dx, $$

where $$g(x)=\frac{x^4+15}{x^7+10+exp(x)}$$, $$ f(x)=x^2 -4x+6$$

Analytic Approximation
We begin the problem by searching for an analytic expression for $$I(\lambda)$$. We note that this is a Laplace integral, and can so be evaluated using the method of Laplace. The notes for this course derive a formula of the form $$I(\lambda)=\mbox{height} \times \mbox{width}=\biggl[g(x_0) \exp{\{-\lambda f(x_0)\}} \biggr]\times \biggl[\sqrt{\frac{2}{f''(x_0)\lambda}}\biggr]$$ where $$x_0$$ is the $$x$$ where $$f(x)$$ experiences its minimum (assuming that this minimum is within the limits of integration, as it is in our case). We will, however, proceed to derive such a formula ourselves. We note that if $$I(\lambda)=\int_1^{8} g(x) exp(-\lambda f(x)) dx$$, then $$I_0(\lambda)$$ such that $$\exp \{\lambda f(x_0)\}I_0(\lambda)=\int_{x_0-\epsilon}^{x_0+\epsilon}g(x)\exp[-\lambda(f(x)-f(x_0))]dx$$ where $$\epsilon$$ is a small, positive constant, then $$I_0(\lambda)$$ approaches $$I(\lambda)$$ in the limit of $$\lambda \to \infty$$. This is because the behavior of the integrand of our problem is only relevant near the minimum of $$f(x)$$, since the integrand decays exponentially as one moves away from $$x_0$$. Since $$\epsilon$$ is small, we can sensibly approximate both the $$g(x)$$ and the $$[f(x)-f(x_0)]$$ terms with their Taylor series. For our purposes, we will at this point keep only the first nonzero term of each Taylor series. Also, we have so far been working with a general Laplace integral, although making some assumptions about the differentiability of the functions, the location of the minimum of $$f(x)$$ away from either of the limits of integration, et cetera; however, it will be useful for us to note before working with the Taylor series that $$f(x)$$ is a polynomial of degree 2. As such, all derivatives of order 3 or higher are 0, and the first three terms (counting zero and nonzero terms) exactly describe the function. For the particular combination $$[f(x)-f(x_0)]$$, the value of the difference at $$x_0$$ is 0 by the construction of the difference and the value of first derivative of the difference is also 0 because we are expanding the Taylor series around $$x_0$$ and $$x_0$$ is a minimum of $$f(x)$$. This all means that writing the first nonzero term of the Taylor series of the combination about $$x_0$$ is doing nothing except rewriting the difference. By the standard notation for the Taylor series, we would just be factoring the difference ($$x^2-4x+6-2$$) into $$\frac{2}{2!}(x-2)^2$$. Despite the fact that this Taylor expansion is trivial for our particular function, we will continue to work with the more general case for the clarity of our derivation. We now expand our functions and make the aforementioned approximation, so that
 * $$\exp\{-\lambda f(x_0)\}I_0(\lambda) \approx \int_{x_0-\epsilon}^{x_0+\epsilon} g(x_0) \exp\biggl\{-\frac{\lambda}{2}f^{''}(x_0)(x-x_0)^2\biggr\}dx$$.

From our earlier limit as $$\lambda \to \infty$$, the following is true in large $$\lambda$$
 * $$I(\lambda) \approx \exp\{-\lambda f(x_0)\} g(x_0) \int_{x_0-\epsilon}^{x_0+\epsilon} \exp\biggl\{-\frac{\lambda}{2}f^{''}(x_0)(x-x_0)^2\biggr\}dx$$.

For convenience, we will know define the expression $$\tau=\sqrt{\frac{\lambda}{2}f^{''}(x_0)}(x-x_0)$$. We know perform a change of variables on the integral in our previous expression for $$I(\lambda)$$, changing it to
 * $$I(\lambda) \approx \exp \{-\lambda f(x_0)\}g(x_0)\sqrt{\frac{2}{\lambda f^{}(x_0)}} \int_{-\sqrt{\frac{\lambda}{2}f^{}(x_0)}\epsilon} ^{\sqrt{\frac{\lambda}{2}f^{''}(x_0)}\epsilon} \exp \{- \tau^2\}d\tau$$.

We see in this formula that as $$\lambda \to \infty$$, the limtis of integration approach $$\pm \infty$$. Thus, for our approximation, we will change the limits of integration to $$\pm \infty$$. Our integral now becomes
 * $$I(\lambda) \approx \exp\{-\lambda f(x_0)\}g(x_0)\sqrt{\frac{2}{\lambda f^{''}(x_0)}} \int_{-\infty}^{\infty} \exp\{-\tau^2\}d\tau$$.

Evaluating the integral, we get an approximation for $$I(\lambda)$$:
 * $$I(\lambda) \approx \exp\{-\lambda f(x_0)\}g(x_0)\sqrt{\frac{2\pi}{\lambda f^{''}(x_0)}}$$.

For our particular integral, this is
 * $$I(\lambda) \approx \exp \{ -2\lambda \}\frac{31}{138+e^2}\sqrt{\frac{\pi}{\lambda}}$$.

This is almost identical to the form derived in the notes for this course, but is in fact greater by a factor of $$\sqrt{\pi}$$. As will be displayed in the numerical evaluation of our solution, this factor of $$\sqrt{\pi}$$ accounts for much of the discrepancy between the form and the notes and the numerically integrated answer. Also, it should of course be noted that the section of the notes immediately succeeding that from which the initial form was derived, the authors proceed to more carefully derive the form with the factor of $$\sqrt{\pi}$$ using the same method as our own. The authors also treat the case where $$f(x)$$ does not have a minimum on the interval $$(a,b)$$, which we will not do here. As will be displayed in our later numerical evaluation of the approximations for $$I(\lambda)$$ above, our approximation fits the actual value of the function quite closely. In another regard, however, it is quite a poor approximation. This is because we failed to derive any representation of the error of our approximation. It is possible for us to numerically evaluate our integral and hence determine the error, but an approximation is always better when you can deduce the error without resorting to numerical methods. For this reason, we will now proceed to derive the same approximation in a way that, while perhaps less clear and definitely consisting of more cluttered algebra, yields the order of the next term, and thus gives a sense of the error of our approximation. We will do this derivation for the general Laplace integral, up to such assumptions as differentiability that our necessary for our derivation, and then address the particularities of our particular integral. This derivation will hinge on Watson's Lemma We begin this more careful derivation by splitting $$I(\lambda)$$ into two separate definite integrals
 * $$I(\lambda)=\int_a^{x_0}\exp\{-\lambda f(x)\}g(x)dx+\int_{x_0}^{b}\exp\{-\lambda f(x)\}g(x)dx=I_L(\lambda)+I_R(\lambda)$$.

This splitting has split the integral such that $$f(t)$$ is monotonic over the ranges of integration (actually, over $$[a,x_0)$$ and $$9x_0,b]$$.) We'll now go ahead and Taylor expand $$f(x)$$ and $$g(x)$$.
 * $$f(x)=f(x_0)+\frac{1}{2}f^{}(x_0)(x-x_0)^2+\frac{1}{6}f^{'}(x_0)(x-x_0)^3+O((x-x_0)^4)$$
 * $$g(x)=g(x_0)+g^'(x_0)(x-x_0)+O((x-x_0)^2)$$

Note that the $$f^'$$ term is left out since $$f$$ has a minimum at $$x_0$$ and so $$f^'(x_0)=0$$. Until otherwise noted, we will know work with $$I_R(\lambda)$$, although analogous logic will apply to $$I_L(\lambda)$$. On this integral we will perform a substitution to the variable $$\tau$$ where
 * $$\tau=f(x)-f(x_0)$$.

We will also define a function $$H$$, where
 * $$H(\tau)=\frac{g(x)}{f^'(x)}\bigg|_{x=f^{-1}(f(x_0)+\tau)}$$.

Now, we can rewrite $$I_R(\lambda)$$ as
 * $$I_R(\lambda)=\exp \{ - \lambda f(x_0)\} \int_0^{f(b)-f(x_0)} H( \tau) \exp \{- \lambda\tau\}d\tau$$.

To apply Watson's lemma (which essentially states that replacing $$g(t)$$ in $$I(\lambda)=\int_0^{\infty}g(t) \exp\{-\lambda t\}dt$$ by an expansion and then integrating term-by-term yields an infinite asymptotic expansion of $$I$$,) we now must determine an asymptotic power series expansion for $$H(\tau)$$ as $$/tau$$ approaches 0 from the right. We can get that
 * $$\pm H(\tau)=\frac{g(x_0)}{\sqrt{2f^{}(x_0)}}\tau^{-1/2}+\left[ \frac{g^{'}(x_0)}{f^{}x_0)}-\frac{g(x_0)f^{'}(x_0)}{3(f^{}(x_0))^2}\right]+O(\tau^{1/2})$$.

To determine the overall sign, we must note that $$\tau$$ increases with $$t$$ over the range of integration, so we want the plus in the $$\pm$$. It then follows by Watson's lemma that
 * $$I_R(\lambda)=\sqrt{\frac{\pi}{2\lambda f^{}(x_0)}}g(x_0)\exp \{- \lambda f(x_0) \}+ \left[ \frac{g'(x_0)}{f^{}(x_0)}-\frac{g(x_0)f^{'}(x_0)}{3(f^{}(x_0))^2}\right]\frac{\exp \{- \lambda f(x_0)\} } {\lambda}+O \left( \frac{ \exp \{ - \lambda f(x_0) \} }{\lambda^{3/2}} \right)$$

We now switch from analyzing $$I_R(\lambda)$$ to $$I_R(\lambda)$$. The logic is analogous, but we will walk through the steps briefly for clarity. First, we perform the same change of variable as above, to
 * $$I_L(\lambda)=-\exp \{ - \lambda f(x_0)\} \int_0^{f(a)-f(x_0)} H( \tau) \exp \{- \lambda\tau\}d\tau$$.

Next, we expand $$H(x)$$, this time taking the minus in the $$\pm$$:
 * $$- H(\tau)=\frac{g(x_0)}{\sqrt{2f^{}(x_0)}}\tau^{-1/2}-\left[ \frac{g^{'}(x_0)}{f^{}x_0)}-\frac{g(x_0)f^{'}(x_0)}{3(f^{}(x_0))^2}\right]+O(\tau^{1/2})$$.

Lastly, we use Watson's lemma to write $$I_L(\lambda)$$:
 * $$I_L(\lambda)=\sqrt{\frac{\pi}{2\lambda f^{}(x_0)}}g(x_0)\exp \{- \lambda f(x_0) \}- \left[ \frac{g'(x_0)}{f^{}(x_0)}-\frac{g(x_0)f^{'}(x_0)}{3(f^{}(x_0))^2}\right]\frac{\exp \{- \lambda f(x_0)\} } {\lambda}+O \left( \frac{ \exp \{ - \lambda f(x_0) \} }{\lambda^{3/2}} \right)$$.

We can now simply sum $$I_R(\lambda)$$ and $$I_L(\lambda)$$ and get that
 * $$I(\lambda)=\sqrt{\frac{2\pi}{\lambda f^{''}(x_0)}}g(x_0)\exp \{- \lambda f(x_0) \}+O \left( \frac{ \exp \{ - \lambda f(x_0) \} }{\lambda^{3/2}} \right)$$.

We have now recovered our earlier approximation for $$I(\lambda)$$, along with the order of the error! Now we have a good approximation, because we can both approximate the behavior of the function as well as characterize the error in our approximation without the use of numerical methods. We will, of course, still use numerical methods to check our approximation as well as to check our characterization of the error, but the analytic characterization of the error provides useful information that we could not have gleaned simply from a plot of our approximation versus a numerical evaluation of a function by giving us the functional form and its dependence on $$f$$. Briefly, we must examine our previous derivation and make sure that the no pathologies of our particular integral derail the integration. Our function has no interesting behavior that causes any concern, aside from the zero nature of $$f^{'''}$$. This is at first a bit worrisome, since $$f^{'''}(x_0)$$ does in fact arise, but it is only in the numerator of quotients (so we need not worry about it blowing up a quotient) and only in terms that in fact cancel out when we sum $$I_L(\lambda)$$ and $$I_R(\lambda)$$. Thus, we are confident that our approximation of the integral and our characterization of the error of our approximation are accurate.

Numerical Evaluation
Various plots can yield a wide variety of interesting information about the approximations we have made. We present a plot over a large domain that indicates the accuracy of our approximation and the approximation without the factor of $$\sqrt{\pi}$$ from the notes as well as over a segment where $$\lambda$$ is quite large to indicate the improved accuracy of our approximation over that without the factor of $$\sqrt{\pi}$$. We also present plots that indicate the accuracy of our characterization of the error. This first two plots illustrate the accuracy of our approximation $$I(\lambda) \approx \exp \{ -2\lambda \}\frac{31}{138+e^2}\sqrt{\frac{\pi}{\lambda}}$$ (dashed red)versus the simpler approximation from the notes of the course without a factor of $$\sqrt{\pi}$$ (solid green) versus a numerically integrated value of the function (solid blue.) The two plots have slightly different ranges, and both are log-log plots. On each plot, the vertical axis is $$I(\lambda)$$ and the horizontal axis is $$\lambda$$. Click on images to view them on the file page in a larger format. On the plots above, both approximations appear quite accurate, and it seems like they tend very close to each other at large $$\lambda$$. However, this next plot illustrates that the factor of $$\sqrt{\pi}$$ definitely distinguishes the two approximations at large $$\lambda$$. It is clear that this additional factor is quite useful. This is a log-log plot with the same axes and color scheme, but a different range. Now that we are fairly convinced that our approximation is decently accurate and that our factor of $$\sqrt{\pi}$$ is justified, we examine the error of our approximation. Our next plot plots the error of our approximation (absolute value of our approximation minus the numerical integration result) versus $$\lambda$$ on a log-log plot. In order to test if this error is properly characterized by our characterization above, we plotted our error divided by our expression above for the order of our error, $$\left( \frac{ \exp \{ - \lambda f(x_0) \} }{\lambda^{3/2}} \right)$$ on a log-log plot. If our characterization is correct, this new quantity should have no dependence on $$\lambda$$ for large $$\lambda$$. Indeed, the error divided by our expression characterizing the error becomes essentially a flat line at large $$\lambda$$. This means that the error of our approximation at large $$\lambda$$ is in fact our expression characterizing the error times some constant prefactor! For our final plot, we examine for how high of $$\lambda$$ we can check our error characterization by plotting the same quantity but on a regular plot (no logs) and for a small range of $$\lambda$$ around $$\lambda=365$$. It appears from this plot that our error divided by the characterization drops off immediately, but by evaluating this for a particular value above the drop-off, we find that the issue is just that Mathematica's numerical integrator "failed to converge to prescribed accuracy after 9 recursive bisections." Basically, the numerical integrator hit its precision limit and failed, so it returned 0. Our error characterization seems accurate after all!

Problem 3
Problem 3:  A Contour Integral Carry out the following integral (using contour integration).

$$ I_1(k)=\int_{-\infty}^\infty \frac{\cos(kx)}{1+x.^4} \, dx.$$ Now evaluate the integral using the Height X Width method described in class. How accurate of an answer can you generate?

Contour Integration
To evaluate the above integral, we will first look at the following contour integral, which we will find to be very helpful:
 * $$I(k)=\oint_C \frac{e^{ikz}}{1+z^4}dz$$

where the contour $$C$$ is the counterclockwise semicircle in the upper half of the complex plane of radius $$R$$, where R is sufficiently large to encompass all of the poles of the integrand above the real axis. Since all of the poles lie on the unit circle, this condition is equivalent to the statement that $$R$$ is greater than 1. We will later see that the reason that we chose to examine this integral was that the integral over the curved part of the contour will go to 0 as the radius of the contour goes to $$\infty$$, which would not have been true of the initial integrand over the same contour, but that we will still be able to determine the value of the integral in the problem by examining this different integral. The integrand $$f(z)=\frac{e^{ikz}}{1+z^4}$$ has 4 poles, at $$z=(-1)^{\frac{1}{4}}=\frac{1+i}{\sqrt{2}},\frac{-1+i}{\sqrt{2}},\frac{-1-i}{\sqrt{2}},\frac{1-i}{\sqrt{2}}$$. We'd like to use the Cauchy Residue Theorem, so we need to evaluate the residues of our integrand at the poles enclosed by our contour, $$z=\frac{1+i}{\sqrt{2}},\frac{-1+i}{\sqrt{2}}$$. We first note the general form for the residue of a function $$g(z)$$ at a pole $$z_0$$ of order $$n$$
 * $$Res(g(z),z_0)=\lim_{z \to z_0} \frac{1}{(n-1)!} \frac{d^{n-1}}{dz^{n-1}} ((z-z_0)^n g(z))$$.

Our poles are of order 1, which means that the above formula reduces to
 * $$Res(g(z),z_0)=\lim_{z \to z_0} [(z-z_0)g(z)]$$.

Also, it is well-known that where $$g(z)$$ can be expressed as a quotient of two other functions, $$g(z)=\frac{h(z)}{j(z)}$$, then the residue at a pole can be rewritten as
 * $$Res(g(z),z_0) = \frac{g(z_0)}{h^'(z_0)}$$.

For our purposes, we will work with this final expression. Thus, if we plug in $$h(z)=e^{ikz}$$ and $$j(z)=1+z^{2m}$$, we get
 * $$Res(\frac{e^{ikz}}{1+z^4},z_0) = \frac{e^{ikz_0}}{4z_0^{3}}$$.

We can now use the Cauchy Residue Theorem and rewrite our integral as
 * $$I(k)=\oint_C \frac{e^{ikz}}{1+z^{4}}dz=2\pi i\left[Res\left(\frac{e^{ikz}}{1+z^4},\frac{1+i}{\sqrt{2}}\right)+Res\left(\frac{e^{ikz}}{1+z^4},\frac{-1+i}{\sqrt{2}}\right)\right]$$
 * $$I(k)=2\pi i \frac{\sqrt{2}}{4}e^{-\frac{k}{2}}\left(\frac{e^{\frac{ik}{\sqrt{2}}}}{i-1}+\frac{e^{\frac{-ik}{\sqrt{2}}}}{i+1}\right)$$.

Using Euler's identity, we rewrite this as
 * $$I(k)=2\pi i \frac{\sqrt{2}}{4}e^{-\frac{k}{2}}\left\{\left[\cos \left(\frac{k}{\sqrt{2}}\right)+i\sin \left(\frac{k}{\sqrt{2}}\right)\right](i+1)+\left[\cos \left(\frac{-k}{\sqrt{2}}\right)+i\sin\left(\frac{-k}{\sqrt{2}}\right)\right](i-1)\right\}$$.

We then expand and use some basic properties of the sine and cosine functions to rewrite this as
 * $$I(k) = 2\pi i\frac{\sqrt{2}}{4}e^{-\frac{k}{2}}2i\left[\cos\left(\frac{k}{\sqrt{2}}\right)+\sin\left(\frac{k}{\sqrt{2}}\right)\right]=\frac{\pi}{\sqrt{2}}e^{-\frac{k}{\sqrt{2}}}\left[\cos\left(\frac{k}{\sqrt{2}}\right)+\sin\left(\frac{k}{\sqrt{2}}\right)\right]$$.

We have no successfully computed the integral of our function around our semicircular contour $$C$$! However, what we really want is the integral along the real axis from $$-\infty$$ to $$\infty$$. Here we will split our integral into two parts in the method employed by Carrier for his integral (3-12) $$D^{(1)}=\frac{1}{2}\oint_c \frac{e^{iaz}}{1+z^2}dz$$ and split our integral into $$I_R$$ along the real axis and $$I_{\theta}$$ along the curved part of the semicircular contour $$C$$ of radius $$R$$ through the complex plane.
 * $$I(k)=I_R(k)+I_{\theta}$$

where $$I_{\theta}=\int_0^{\pi} \exp \{-k R \sin \theta + ikR\cos \theta \}(1+R^4e^{4i\theta})^{-1}Rie^{i\theta}d\theta$$. This integral is bounded by the product of $$2\pi R$$ and the absolute value of the integrand, which tends to 0 as $$R \to \infty$$. Thus $$I(k)=I_R(k)$$ as $$R \to \infty $$.
 * $$I(k)=\oint_{C_{\infty}}f(z)dz=\int_{-\infty}^{\infty}\frac{e^{ikz}}{1+z^4}dz=\int_{-\infty}^{\infty} \frac{\cos (kx)}{1+x^4}dx+i\int_{-\infty}^{\infty} \frac{\sin (kx)}{1+x^4}dx$$.

The limits of integration for both integrals are centered about zero, about which sine is odd and thus the integral of sine is 0. Thus $$\int_{-\infty}^{\infty} \frac{\cos (kx)}{1+x^4}dx=I(k)=\frac{\pi}{\sqrt{2}}e^{-\frac{k}{\sqrt{2}}}\left[\cos\left(\frac{k}{\sqrt{2}}\right)+\sin\left(\frac{k}{\sqrt{2}}\right)\right]$$. Therefore $$I_1(k)=\frac{\pi}{\sqrt{2}}e^{-\frac{k}{\sqrt{2}}}\left[\cos\left(\frac{k}{\sqrt{2}}\right)+\sin\left(\frac{k}{\sqrt{2}}\right)\right]$$. We confirm the accuracy of this solution versus a solution generated by numerical integration in the plot below.