# [✓] Integrate a piecewise function?

Posted 10 months ago
995 Views
|
2 Replies
|
1 Total Likes
|
 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. Thanks for your helpmy code and book page is attached Attachments:
2 Replies
Sort By:
Posted 10 months ago
 I got (almost) the result in your book -and I think it is actually the same (multiply the leading 1/2 into the expression and have a close look at the arguments of the functions.Look at the notebook before evaluating it, and note how t1 + t2 + t3 is modified if you apply FullSimplify to it. Attachments: