Answer:
Please refer to the figure.
Step-by-step explanation:
The crucial point here is to calculate the enclosed current. If the current I is flowing through the whole cross-sectional area of the wire, the current density is
![J = (I)/(\pi R^2)](https://img.qammunity.org/2020/formulas/physics/college/eavy3kqhrft7qb0x6svbinfmv3wwcj7mpa.png)
The current density is constant for different parts of the wire. This idea is similar to that of the density of a glass of water is equal to the density of a whole bucket of water.
So,
![J = (I)/(\pi R^2) = (I_(enc))/(\pi r^2)\\I_(enc) = (Ir^2)/(R^2)](https://img.qammunity.org/2020/formulas/physics/college/3zutzmwkhoz7qt2abqz8vrg238om681wi6.png)
This enclosed current is now to be used in Ampere’s Law.
![\mu_o I_(enc) = \int {B} \, dl](https://img.qammunity.org/2020/formulas/physics/college/y760wgdhx6sa6bzosik935msmbhj09ne23.png)
Here,
represents the circular path of radius r. So we can replace the integral with the circumference of the path,
.
As a result, the magnetic field is
![B = (\mu_0)/(2\pi)(Ir)/(R^2)](https://img.qammunity.org/2020/formulas/physics/college/mwh01m8n7vevqcgcb8tskojyzsjyxra9o8.png)