# Symbolic integration in real domain only ( assumptions and ComplexExpand don't work)

Integrate[m^2/((x - m^2)^2 + y^2), m]

mathematica gives me a complex-valued reuslt, but maple 17 gives me what I want.

I tried using assumptions, but it doesn't work.

In MMA, is there a general way to do integrations in real domains, just like maple.

Can this wrap bulit-in command proposed by Todd Gayley (see: http://stackoverflow.com/questions/4198961/what-is-in-your-mathematica-tool-bag ) do the trick?

Message[args___] := Block[{$inMsg = True, result}, "some code here"; result = Message[args]; "some code here"; result] /; ! TrueQ[$inMsg]


Perhaps the reason for the complex-valude result is the invovled power calculation during the integration, so maybe what I really need is a general way to do symbolic power calculation in real domains?

ComplexExpand doesn't work as in the post integration on real domain only!.

thanks :)

-
@Artes Integrate[m^2/((1 - m^2)^2 + 1), {m, 0, 1}], Maple 17 gives 1/8 Sqrt[-1 + Sqrt[ 2]] (2 (2 + Sqrt[2]) ArcTan[Sqrt[2 (1 + Sqrt[2])]] + Sqrt[2] Log[5 + 4 Sqrt[2] - 2 Sqrt[2 (7 + 5 Sqrt[2])]]) –  chyaong May 13 '13 at 11:31
This issue is more general. Take a look at this answer: mathematica.stackexchange.com/questions/23080/…. One might get rid of unwanted imaginary part working with appropriate assumptions, see what happens for special values x and y, e.g. Integrate[m^2/((1 - m^2)^2 + 1), {m, 0, 1}] –  Artes May 13 '13 at 11:34
@chyanog You can map all ComplexExpand i.e. ComplexExpand //@ Integrate[m^2/((1 - m^2)^2 + 1), {m, 0, 1}], then you'll see how one could proceed to remove apparently immaginary result. –  Artes May 13 '13 at 11:40
@Artes and chyanog. These are not what I want. Please, normally, given a integration problem, you don't do some tests using specific values as what Artes does. If I have time to do these tests, why don't I using maple's results directly? Please no tests, just want a general way to do symbolic indefinite integration. Anyway, thanks. –  pengfei_guo May 14 '13 at 1:26
@pengfei_guo Maple results and Mathematica ones can be equivalent under some assumptions, it doesn't matter that they are apparently different. If you analyze carefully the link I gave above you'll probably better understand the problem. However demonstrating that the both results are equivalent may depend on case by case basis. –  Artes May 14 '13 at 1:36
show 1 more comment