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$
2
  • 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, 2019 at 14:30
  • $\begingroup$ I knew it was something incredibly obvious! Thanks a lot for help. $\endgroup$
    – mikea
    Jul 4, 2019 at 14:50

1 Answer 1

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.