Ampere's circuital law for infinitely long wire I am reading magnetostatics from Introduction to Electrodynamics
Textbook by David J. Griffiths
So here ampere's circuital law in differential form was derived from biot-sarvart law and an assumption was made that j tends to 0 as we go to infinity.and the integral form was derived from the differential form.
But in next page ampere's circuital law in integral form was used to calculate magnetic field of a long infinite wire(whose current density won't be 0 at infinity)
My doubt is,is the condition for ampere's circular law is weaker (no requirement of 0 current density at infinity) or the author forgot to justify the usage of ampere's law in this case.
I know that ampere's law is a law and its validity is verified by experiments but my question is on the basis of sequence of book and hence I want a mathematical reasoning.
 A: If you read the footnote that is given which says

If $\mathbf{J}$ itself extends to infinity (as in the case of an infinite straight wire), the surface integral is still typically zero, though the analysis calls for greater care.

Though the Ampere's law holds generally in magnetostatics.

Here's a little bit of hand waving method given by Purcell in his book,
Consider a circular path that encloses the wire,

Here the circumference is $2\pi r$, and the field is $\mu_0 I/2\pi r$ and everywhere parallel to the path, so the value of the line integral around this particular path is $(2\pi r)(\mu_0 I/2\pi r)=\mu_0 I$. We can extend this for any loop by distorting the loop.

We now claim that any path looping once around the wire must give the same value. Consider, for instance, the crooked path $C$ in fig. Let us construct the path $C'$ in the next fig made of a path like $C$ and a circular path but not enclosing the wire. The line integral around $C'$ must be zero and therefore the integral around $C$ must be the negative of the integral around the circle, which we have already evaluated as $\mu_0 I $ in magnitude. The sign will depend way on the sense of traversal of the path.
Our general conclusion is
$$\int \mathbf{B}\cdot d\mathbf{s}=\mu_0 \times (\text{current enclosed by path)}$$
A: The Biot-Savart law in infinitesimal form reads
$$
\vec{dB}= a \frac{I \vec{dl}\times \vec{r}}{r^3}
$$
where $a>0$ is a constant that depends on the system of units that you are using, $I$ is the intensity of the current and $ \vec{dl}$ is a vector representing the lenght and current direction of a small portion of a wire that can be considered straight. If you know a little about the Dirac Delta distribution, you should be able to show that the BS law is nothing but
$$
  \nabla \times     \vec{B} = 4 \pi a   \vec{J} 
$$
see e.g.  https://en.m.wikipedia.org/wiki/Biot%E2%80%93Savart_law
Note that the equation above is local and fundamental (it is  the stationary version of one of the Maxwell equations), and no assumption has been made on the distribution of currents   $\vec{J} $ (note that the continuity equation  $\nabla \cdot 
\vec{J} =0 $ should be satisfied by the assigned  current if you want to be able to solve the equation: just take the divergence of both the left and right hand sides). Technical assumptions may be invoked from case to case, but in principle the prescription given by the BS law is clear: as long as you can divide the wire into infinitesimal straight segments, here it is the local contribution to the field. You just have to make a sum over the wire (with the integral). The only requirement is that the current has to be conserved, so you can have loops or wires that extend to infinity (if a wire splits, then the "branches" have to collectively carry the same amount of current).
