# Integral of a step function ,

I am trying to integrate a step function given in a book, but it doesn't work.

Phi[x_]:= Piecewise[{{-Hg x, -g/2 <= x <= g/2}, {-g Hg/2, x >= g/2}, {g Hg/2, x < -g/2}}]


I can plot it and give the same result as in book but the integration is not the same so my integration code is:

Integrate[y1/ \[Pi] \[CapitalPhi][x]/((x1-x)^2+y1^2), {x, -Infinity, Infinity}, Assumptions -> x1 > 0 && y1 > 0](*here y1=y in book*)


In book it only says for y>0, so I assume x>0 also because for just y>0 mathematica doesn't integrate. My code screenshot and books page with result is attached. Thanks for your help

• Why not take the expression you have derived, take the expression that's in the book and see if they are equal? You can for instance, plot the two of them and see if they lie on top of each other. Commented Feb 23, 2018 at 1:55
• fyi, it looks like a class mate of your just posted the same problem at http://community.wolfram.com/groups/-/m/t/1290148 and someone has answer there, so you might to check that. Commented Feb 23, 2018 at 2:47