# Finding magnetic field in wire with non-uniform current density

1. Aug 7, 2013

### GreatEscapist

1. The problem statement, all variables and given/known data
Find an expression for the magnetic field inside a wire carrying a current density J = Cr2 where C is a constant to be determined in the problem. The total current in the wire is I and the radius of the wire is R. Your answer should be a function of r, R and I, but should not contain C.

2. Relevant equations
$\oint\vec{B}*d\vec{s}$=$\mu$0*Ithrough

J = dI/dA

I = dQ/dt

3. The attempt at a solution

I know that the first thing I need to do is solve for C in the J expression. I know that J = dI/dA. I want to integrate over the entire wire's radius, so I would want to integrate from 0 to R... the problem is I can't make my integral work. I tried Cr2 = ∫dI / dA, etc.

I actually think I can solve the rest of the problem myself, but I am stuck on the freaking calculus. Can someone help me set up this integral?

2. Aug 7, 2013

### haruspex

I, as given in the question, is a constant, so it's not going to help differentiating it. Within your formula it means something a little different. Try rewriting J = dI/dA in integral form. That will turn I into the constant given when you fill in the correct integration range.

3. Aug 7, 2013

### GreatEscapist

I ended up getting it. You solved for C first by defining dA as 2*pi*r*dr... that was the part I couldn't get.