Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a cylinder that is of length L and radius s and possesses a charge distribution of sigma across only the cylinder part and not the endcaps, I am trying to calculate the Electric-field. The cylinder is positioned with its center at the origin and I am trying to find the electric field at a point $P = (x,y,z)$.

I am not 100% sure if the formula that I've obtained is quite correct, but I would like to use Mathematica to see if it is meaningful.

The formula that I've gotten down to is:




Now regardless of whether this is actually correct, I do want to test it. Since L, x, y, z, s, k, and σ are all "known" quantities, then this should in theory should have a numerical solution at least. However, with Mathematica, when I plug these equations in, taking σ to be constant, it just kind of sits there thinking for a very long time and does not come to any form of conclusion.

Is there anyway that I can actually do this on Mathematica numerically in terms of the parameters in a reasonable time and have it actually return something that can then be plotted? Sorry that I'm not the most familiar with how Mathematica operations.

Sorry for the odd format on the integrals, the thing seemed to wrap it around to the next line and I am pretty unfamiliar with formatting on this site.

share|improve this question
Please include the relevant Mathematica code you've tried in your question. – ciao Feb 10 '14 at 3:10
related Wolfram blog post by Michael Trott – Kuba Feb 11 '14 at 6:02
The mathematica code is pretty simple. It is just in the notebook format for Mathematica 9 x = x y = y z = z k = k s = s sig = sig L = L Integrate[ ksigs*(x - sCos[theta])/((x - sCos[theta])^2 + (y - s*Sin[theta])^2 + (z - z1)^2)^(3/2), {z1, -L/2, L/2}, {theta, 0, 2*Pi}] – Logan Dougherty Feb 12 '14 at 17:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.