Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

maple result

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 :)

share|improve this question

This question has an open bounty worth +50 reputation from mathe ending tomorrow.

This question has not received enough attention.

    
@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
2  
@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

1 Answer 1

For Element[{m, x, y}, Reals] the function is real; however, numerical noise can result in an imaginary artifact that can be removed with Chop

int[m_, x_, y_] = Assuming[{Element[{m, x, y}, Reals]},
  Integrate[m^2/((x - m^2)^2 + y^2), m] //
   FullSimplify]

(I*(Sqrt[-x - I*y]*ArcTan[m/Sqrt[-x - I*y]] - Sqrt[-x + I*y]*ArcTan[m/Sqrt[-x + I*y]]))/(2*y)

(int @@@ RandomReal[{-2, 2}, {40, 3}]) // Chop[#, 10^-15] &

{-0.0254214, -0.0710269, 0.017061, -0.159841, 0.00667301, 0.134012, 0.0549759, -0.00119414, -4.68272, -0.797005, -0.0151467, 0.0737341, -0.120778, 0.00454359, -0.870848, -0.0339835, -3.453, 0.465008, -9.04711, -9.02031, 0.000540718, 0.0492567, 0.282303, 0.0357629, -0.155331, -0.482013, 0.0955548, 0.0110472, -0.0248232, -0.126987, 0.268351, 0.0481008, -0.132282, 0.0273012, 0.000381937, -0.21833, -0.00260406, 2.10403, 0.234028, 0.00998243}

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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