# Limits of Integration Trig, Mag Field Infinite Length Wire

I don't understand how the limits of integration should be defined when doing basic integrals of trig functions. It seems like it's an arbitrary decision, I don't understand it.

Here's the set up: For the field near a long straight wire carrying a current $I$, show the Biot-Savart law gives the same result as Ampere's law.

Now intuitively, for me at least, with the way that $\theta$ is defined, I would view the angle as becoming smaller as $y$ moves toward negative infinity. So the limits of integration make sense in that regards. But then the cosine doesn't make sense anymore. As $y$ becomes more negative, which corresponds to an angle between $0$ and $\pi/2$, then cosine should always be positive. But because cos=adj/hyp, then $\cos\theta=y/r$, and $y$ would be negative, even though the corresponding angle is between $0$ and $\pi/2$?

I know I'm misunderstanding something fundamental, hopefully somebody can help me so I can move on. I've been struggling with this for so long because it's easy enough to arbitrarily assign limits to get the answer you're looking for, but I want to know the right way, and more importantly, why it's the right way.

• Cosine takes on positive values between $-\pi/2$ and $\pi/2$, so cosine will be positive in those ranges. For a visual explanation of what’s going wrong, you need to determine if the adjacent side is positive or negative from the reference point of the angle you’re measuring. Because the side you’re measuring is always above the reference angle, it’s value in your formula should be positive. – Alec Rhea Jun 13 at 7:04