27.12.2012 Views

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

Wave Propagation in Linear Media | re-examined

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In[23]:= f[x_] := Exp[-x] Cos[x];<br />

OscInt[f,#&,0]<br />

Out[23]= 0.5<br />

7 Mathematica implementation of a quadratu<strong>re</strong> function<br />

In this case we do not even have the slightest approximation error, as can be shown by the attempt<br />

to <strong>re</strong>veal further digits of the <strong>re</strong>sult.<br />

In[24]:= SetP<strong>re</strong>cision[%,40]<br />

Out[24]= 0.5<br />

Example 7.5.7<br />

Z 1<br />

0<br />

x<br />

x 2 +1 s<strong>in</strong> xdx = 2e<br />

In[25]:= f[x_] := x/(x^2+1) S<strong>in</strong>[x];<br />

SetP<strong>re</strong>cision[OscInt[f,#&,0],16] - N[Pi/(2 E),20]<br />

Out[25]= -14<br />

-1.93 10<br />

Example 7.5.8<br />

Z 1<br />

0<br />

cos x<br />

p x 2 +1 dx = K0(1)<br />

In[26]:= f[x_] := Cos[x]/Sqrt[x^2+1];<br />

SetP<strong>re</strong>cision[OscInt[f,#&,0],16] - N[BesselK[0,1]]<br />

Out[26]= -13<br />

-1.12188 10<br />

Example 7.5.9<br />

Z 1<br />

0<br />

ln x2 +4<br />

x2 +1 cos !x dx = , ,! ,2!<br />

e , e<br />

!<br />

In[27]:= f[x_] := Log[(x^2+4)/(x^2+1)] Cos[omega x];<br />

omega = 5;<br />

SetP<strong>re</strong>cision[OscInt[f,omega #&,0],16] -<br />

N[(Exp[-omega]-Exp[-2 omega]) Pi/omega,20]<br />

184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!