# Find magnetic field using ampere's law [closed]

I have to find the magnetic field inside a long (assuming infinitely) hollow cylinder carrying a uniform current per unit length $l$ along the circumference.

My attempt:

Why the answer I got is wrong???? Please do explain the mistake i commited. Thank You! :)

Given the path you chose, writing $i=0$ was right as there's no current inside that loop, but writing $B2\pi a$ wasn't. The integral form for the Ampere law is
$B$ and your chosen path $dl$ are perpendicular, therefore the dot product results null. Then, this path doesn't allow you to calculate $B$ as your equation is zero from both sides. There's the difficulty of this kind of problems: choosing the correct path that gives information.
Try to select another path where $dl$ and $B$ are parallel, and where the current gives you information.
The Ampere law reads $$\int_C \vec B.d\vec\ell=\mu_O I_{\rm in}$$ where $C$ is your circle and $I_{\rm in}$ the total intensity flowing through this circle, in your case $I_{\rm in}=0$. When calculating the l.h.s, you assumed that $\vec B$ was tangential to the circle $C$ and uniform along the circle. This is not correct! You should start by analyzing the symmetries and anti-symmetries of the distribution of current. You would then realized that $\vec B$ is actually perpendicular to the plane containing $C$ (because this plane is a plane of symmetry of the current). Therefore, the dot product $\vec B.d\vec\ell$ vanishes at any point of $C$.