# Line Integral in E & M

1. Sep 12, 2009

### msd213

1. The problem statement, all variables and given/known data

Calculate the line integral of A between to points x=1 and x=3 along the semicircular path with a center at x=2

2. Relevant equations

A=kx in the x hat direction.

$$\int A \bullet dl$$

dl = ds s hat +s d$$\phi$$ $$\phi$$ hat +dz z hat

3. The attempt at a solution

My biggest problem seems to be getting that A into cylindrical coordinates so I can take the dot product with the dl.

Last edited: Sep 12, 2009
2. Sep 12, 2009

### gabbagabbahey

HI msd213, welcome to PF!

You can write this more clearly as follows (click on the $\LaTeX$ images to see the code used to generate them!):

$$\textbf{A}=kx\mathbf{\hat{x}}$$

$$\int \textbf{A}\cdot d\textbf{l}$$

$$d\textbf{l}=ds\mathbf{\hat{s}}+s d\phi\mathbf{\hat{\phi}}+dz\mathbf{\hat{z}}$$

In cylindrical coordinates, centered at $x=2$ (since that is the center of your curve, you might as well choose the origin of your cylindrical coordinates to be there) $x-2=s\cos\phi$ and $\mathbf{\hat{x}}=\cos\phi\mathbf{\hat{s}}-\sin\phi\mathbf{\hat{\phi}}$

3. Sep 13, 2009

### msd213

Thanks for your response but I'm still confused. How did you derive that $\mathbf{\hat{x}}$?

4. Sep 13, 2009

### gabbagabbahey

I didn't derive it...I looked it up!

The derivation is done in most Multi-variable calculus texts, and I think is done in an Appendix in Griffiths' Introduction to Electrodynamics as-well. But it is really just a matter of drawing a picture and doing some very basic trig.

5. Sep 13, 2009

### msd213

I think I see now. But when you take the dot product between the A (now converted into cylindrical coordinates, and dl, aren't you going to have terms multiplied by differentials such as (some term)*$$ds$$ +(another term)*$$d\phi$$...etc. How can you take the integrals with that? Where does the volume element fit in?

Last edited: Sep 13, 2009
6. Sep 13, 2009

### gabbagabbahey

Well, for your particular curve (the semicircle), $s=1$ and $z$ are both constant, so $ds=dz=0$ and hence $d\textbf{l}=d\phi\mathbf{\hat{\phi}}$

In general, any 3D curve can be described by a single parameter. So, in cylindrical coordinates, for example, you would have something like $s=s(u)$, $\phi=\phi(u)$ and $z=z(u)$ and so all the differentials ($ds$, $d\phi$ and $dz$) can be written in terms of a single differential $du$. (For your particular curve, the easiest way is just to use $\phi$ as your parameter)

If instead you wanted to integrate over a surface, you would express each coordinate in terms of two independent parameters, and your surface area element in terms of their differentials.

7. Sep 13, 2009

### msd213

I'm still a little confused about how this clears up the problem with the repeated differentials. For example, in my problem, isn't the integral going to look like.

$$\int -k s^2\\\ cos\phi\\ sin\phi\\ d\phi\\\ s\\ ds\\ d\phi\\ dz$$

Using $\mathbf{\hat{x}}=\cos\phi\mathbf{\hat{s}}-\sin\phi\mathbf{\hat{\phi}}$
and $$kx=kscos\phi$$

I'm not sure how I can write these in terms of one parameter.

8. Sep 13, 2009

### gabbagabbahey

No,

\begin{aligned} \textbf{A} & = kx\mathbf{\hat{x}} \\ & = k(s\cos\phi+2)\left(\cos\phi\mathbf{\hat{s}}-\sin\phi\mathbf{\hat{\phi}}\right) \\ & = k(\cos^2\phi+2\cos\phi)\mathbf{\hat{s}}-k(\sin\phi\cos\phi+2\sin\phi)\mathbf{\hat{\phi}} \end{aligned}

(Since $s=1$ along your curve)

And $d\textbf{l}=d\phi\mathbf{\hat{\phi}}$, so

\begin{aligned} \textbf{A}\cdot d\textbf{l} & = \left(k(\cos^2\phi+2\cos\phi)\mathbf{\hat{s}}-k(\sin\phi\cos\phi+2\sin\phi)\mathbf{\hat{\phi}}\right)\cdot(d\phi\mathbf{\hat{\phi}}) \\ & = -k(\sin\phi\cos+2\sin\phi)\phi d\phi\end{aligned}

Last edited: Sep 13, 2009
9. Sep 13, 2009

### msd213

Thanks for your patience and prompt responses.

Whenver I use cylindrical coordinates, I suppose I just reflexively put in that $$s\\ ds\\ d\phi\\ dz$$ whenever I convert to cylindrical coordinates and integrate. Why exactly isn't it needed here?

10. Sep 13, 2009

### gabbagabbahey

$d\tau=s ds d\phi dz$ is the differential volume element....you're not performing a volume integral here, so $d\tau$ is pretty useless to you.

11. Sep 13, 2009

### msd213

Thanks, I guess I've just been conditioned from calc to put that there.

Also, I think the whole idea of this section is path independence.

So, when you just take the path just along the x-axis, you have

$$\int_1^3 k\\ x\\ dx$$

This integral yields 4k. But the integral you derive yields zero, unless I'm way off. The bounds should be 0 to $$\pi$$ correct? Shouldn't the integrals yield the same answer?

12. Sep 13, 2009

### gabbagabbahey

Right, sorry my post contained an error (substituted $x=(s-2)\cos\phi$ instead of $x-2=s\cos\phi$)...i'll edit it to fix the error...

13. Sep 13, 2009

### msd213

Thank you, that should clear everything up. You've been a great help.