0
$\begingroup$

I'm asking Mathematica to compute:

Integrate[
 Module[{r = {-x, -y, z}}, r/Norm[r]^3],
 {x, -a/2, a/2},
 Assumptions -> Elements[y, Reals] && z > 0 && a > 0]

But the result seems to completely ignore my assumptions (I also tried Assuming):

results

What am I doing wrong?

$\endgroup$

closed as off-topic by Daniel Lichtblau, Bob Hanlon, Alex Trounev, Henrik Schumacher, m_goldberg Jul 6 at 15:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Bob Hanlon, Alex Trounev, Henrik Schumacher, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ It's Element, not Elements. You can tell you've mistyped the command because it's color coded blue. $\endgroup$ – bill s Jul 4 at 14:30
  • $\begingroup$ I knew it was something incredibly obvious! Thanks a lot for help. $\endgroup$ – mikea Jul 4 at 14:50
1
$\begingroup$

Try

Module[{r = {-x, -y, z}},Integrate[r/Norm[r]^3, {x, -a/2, a/2},Assumptions -> Element [y, Reals] && z > 0 && a > 0]]
(*{0, -((2 a y)/((y^2 + z^2) Sqrt[a^2 + 4 y^2 + 4 z^2])), (2 a z)/((y^2 + z^2) Sqrt[a^2 + 4 y^2 + 4 z^2])}*)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.