## 5.13

Calculate the value of $\pi$ by using numerical integration to estimate the area of a circle of unit radius. Observe how your estimate approaches the exact value (3.1415926…) as the grid size in the integration is reduced.

$$\int^{1}_{-1}\sqrt{1-x^2}dx=\frac{\pi}{2}$$

$$\int f(x)dx\approx\sum_i f(x_i)\Delta x_i$$

## 5.14

Write a program to calculate the magnetic field for your favorite current distribution. One possibility is a pair of loops of radius $r$, with one loop lying in the $x-y$ plane and the other in the $y-z$ plane. Another possibility is the solenoid considered in Figure 5.17. （自由发挥电流分布，形状越奇怪越好^_^)

$$\mathbf B(\mathbf r)=\frac{\mu _{0}I}{4\pi }\int _{\mathbb{L}’}\mathrm d \boldsymbol \ell ‘\times \frac{\mathbf r -\mathbf{r}’}{|\mathbf r-\mathbf r’|^3}$$

I’m angry!