It is not quite clear, what do you you want to get out of the answer.
Would you like to compare Maple and Mma and understand, which one is better ?
Or would you like to understand the alternative forms of taking this integral?
Or the reason, why the results of Marple and Mma are different?
Or transform the Mma result in terms of x
and y
?
Or, finally, transform the Mma result in terms of x
and y
, such that it does ot contain imaginary unit?
If your question concerns any comparison Maple with Mma, the point is that they differently understand the expression complexity. So Mma returns the result (demonstrated by Bob above) that seems it more concise, and it, inded, looks shorter than that of Maple (you show above).
The second question is what do you intend to do with this result. If you, say, only need to plot it in Mma (or to do something comparable), the Mma result is perfect, do, plot it.
However, you might want to further transform it, and may, say, differently treat different terms. In such a case you may need to have it in terms of x
and y
, such that it does not contain imaginary unit.
I choose this possibility, since the task seems me personally challenging. So my response below is for this special case. If you do not need it, disregard it.
So, let me first make the integral a bit differently with respect to Bobs approach, by representing it in a more canonical form. Let us introduce z=m^2
and integrate over z
:
expr1 = Integrate[z/((z + x)^2 + y^2)*1/(2 Sqrt[z]), z,
Assumptions -> {z > 0, x ∈ Reals, y ∈ Reals}] /.
Sqrt[z] -> m
(* 1/2 (((I x + y) ArcTan[m/Sqrt[x - I y]])/(
Sqrt[x - I y] y) + ((-I x + y) ArcTan[m/Sqrt[x + I y]])/(
Sqrt[x + I y] y)) *)
Now let us make a replacement of variables:
expr2 = expr1 /. {1/Sqrt[x + I y] ->
1/r*Exp[-I f/2], -I x + y -> -I r^2 Exp[I f],
1/Sqrt[x - I y] -> 1/r*Exp[I f/2], I x + y -> I r^2 Exp[-I f]}
(* 1/2 (-((I E^((I f)/2) r ArcTan[(E^(-((I f)/2)) m)/r])/y) + (
I E^(-((I f)/2)) r ArcTan[(E^((I f)/2) m)/r])/y) *)
and ComplexExpand
the result
expr3 = ComplexExpand[expr2]
I do not show the result, since it is rather long, you may obtain it, and just looking at it you will find expressions like Arg[1 - (I E^(-((I f)/2)) m)/r]
. They can be replaced by ArcTans:
expr4 = expr3 /. {Arg[
1 - (I E^(-((I f)/2)) m)/
r] -> -ArcTan[(( m Cos[f/2])/r)/(1 - (m Sin[f/2])/r)],
Arg[1 + (I E^(-((I f)/2)) m)/r] ->
ArcTan[((m Cos[f/2])/r)/(1 + (m Sin[f/2])/r)],
Arg[1 - (I E^((I f)/2) m)/
r] -> -ArcTan[(( m Cos[f/2])/r)/(1 + (m Sin[f/2])/r)],
Arg[1 + (I E^((I f)/2) m)/r] ->
ArcTan[((m Cos[f/2])/r)/(1 - (m Sin[f/2])/r)]}
(*
(r Cos[f/2] Log[(m^2 Cos[f/2]^2)/r^2 + (1 - (m Sin[f/2])/r)^2])/(
4 y) - (r Cos[f/
2] Log[(m^2 Cos[f/2]^2)/r^2 + (1 + (m Sin[f/2])/r)^2])/(4 y) + (
r ArcTan[(m Cos[f/2])/(r (1 - (m Sin[f/2])/r))] Sin[f/2])/(2 y) + (
r ArcTan[(m Cos[f/2])/(r (1 + (m Sin[f/2])/r))] Sin[f/2])/(2 y)
*)
The resulting expression is Real. It is only left to replace the amplitude and phase in it:
expr5 = expr4 /. {r -> (x^2 + y^2)^(1/4), f -> ArcTan[y/x]}
(* ((x^2 + y^2)^(1/4)
Cos[1/2 ArcTan[y/x]] Log[(m^2 Cos[1/2 ArcTan[y/x]]^2)/Sqrt[
x^2 + y^2] + (1 - (m Sin[1/2 ArcTan[y/x]])/(x^2 + y^2)^(
1/4))^2])/(
4 y) - ((x^2 + y^2)^(1/4)
Cos[1/2 ArcTan[y/x]] Log[(m^2 Cos[1/2 ArcTan[y/x]]^2)/Sqrt[
x^2 + y^2] + (1 + (m Sin[1/2 ArcTan[y/x]])/(x^2 + y^2)^(
1/4))^2])/(
4 y) + ((x^2 + y^2)^(1/4)
ArcTan[(m Cos[1/2 ArcTan[y/x]])/((x^2 + y^2)^(
1/4) (1 - (m Sin[1/2 ArcTan[y/x]])/(x^2 + y^2)^(1/4)))] Sin[
1/2 ArcTan[y/x]])/(
2 y) + ((x^2 + y^2)^(1/4)
ArcTan[(m Cos[1/2 ArcTan[y/x]])/((x^2 + y^2)^(
1/4) (1 + (m Sin[1/2 ArcTan[y/x]])/(x^2 + y^2)^(1/4)))] Sin[
1/2 ArcTan[y/x]])/(2 y)
*)
That's it. It may by done still a bit simpler:
FullSimplify[expr5, {m ∈ Reals, x ∈ Reals,
y ∈ Reals}]
(* (1/(4 y))(x^2 + y^2)^(
1/4) (Cos[
1/2 ArcTan[y/x]] (Log[
m^2 + Sqrt[x^2 + y^2] -
2 m (x^2 + y^2)^(1/4) Sin[1/2 ArcTan[y/x]]] -
Log[m^2 + Sqrt[x^2 + y^2] +
2 m (x^2 + y^2)^(1/4) Sin[1/2 ArcTan[y/x]]]) +
2 (ArcTan[(
m Cos[1/2 ArcTan[y/x]])/((x^2 + y^2)^(1/4) -
m Sin[1/2 ArcTan[y/x]])] +
ArcTan[(m Cos[1/2 ArcTan[y/x]])/((x^2 + y^2)^(1/4) +
m Sin[1/2 ArcTan[y/x]])]) Sin[1/2 ArcTan[y/x]])
*)
Now that is the end. If it looks a bit different to what you see in Maple, it should be for the same reason.

Note that tan^-1
in the picture above means ArcTan
. If it is what you are looking for, be carefull with the replacements like Arg[1 - (I E^(-((I f)/2)) m)/
r] -> -ArcTan[(( m Cos[f/2])/r)/(1 - (m Sin[f/2])/r)]
. In some cases they may introduce an error, check them. I did not. Have fun!
Later Edit:
In responce to the notes of Michael E2:
Yes, Michael, you are right, I mixed up the sign in the integral. Then the integral is:
expr1 = Integrate[z/((z - x)^2 + y^2)*1/(2 Sqrt[z]), z,
Assumptions -> {z > 0, x \[Element] Reals, y \[Element] Reals}] /.
Sqrt[z] -> m
The further operations with the sign "-" are the same as with "+" up to (including) expr3
. Then one can do the following. These are the replacement rules:
rules = {Arg[
1 - (E^((I f)/2) m)/
r] -> -ArcTan[(( m Sin[f/2])/r)/(1 - (m Cos[f/2])/r)],
Arg[1 + (E^((I f)/2) m)/r] ->
ArcTan[((m Sin[f/2])/r)/(1 + (m Cos[f/2])/r)],
Arg[1 - (E^(-((I f)/2)) m)/r] ->
ArcTan[(( m Sin[f/2])/r)/(1 - (m Cos[f/2])/r)],
Arg[1 + (E^(-((I f)/2)) m)/
r] -> -ArcTan[(( m Sin[f/2])/r)/(1 + (m Cos[f/2])/r)],
Cos[1/2 Arg[x + I y]] -> Cos[1/2*ArcTan[y/x]],
Cos[1/2 Arg[x - I y]] -> Cos[1/2*ArcTan[y/x]],
Sin[1/2 Arg[x - I y]] -> -Sin[1/2 ArcTan[y/x]],
Sin[1/2 Arg[x + I y]] -> Sin[1/2 ArcTan[y/x]]};
In these rules I only accounted for the first quadrant x>0, y>0
. In general case one can everywhere in these and later rules write ArcTan[b,a]
instead of the ArcTan[a/b]
. But then results are not simplified to such a short expression, as we see in the end.
Now the substitutions work as follows:
expr4 = expr3 /. rules;
expr5 = expr4 /. {r -> (x^2 + y^2)^(1/4), f -> ArcTan[y/x]};
Simplify[expr5, {x > 0, y > 0, m > 0}]
The result is as follows:
(*
(1/(4 y))(x^2 + y^2)^(
1/4) (2 ArcTan[(
m Sin[1/2 ArcTan[y/x]])/((x^2 + y^2)^(1/4) -
m Cos[1/2 ArcTan[y/x]])] Cos[1/2 ArcTan[y/x]] +
2 ArcTan[(
m Sin[1/2 ArcTan[y/x]])/((x^2 + y^2)^(1/4) +
m Cos[1/2 ArcTan[y/x]])] Cos[1/2 ArcTan[y/x]] +
Log[(m^2 + Sqrt[x^2 + y^2] -
2 m (x^2 + y^2)^(1/4) Cos[1/2 ArcTan[y/x]])/(
m^2 + Sqrt[x^2 + y^2] +
2 m (x^2 + y^2)^(1/4) Cos[1/2 ArcTan[y/x]])] Sin[
1/2 ArcTan[y/x]])
*)
Generally, I think that after the direction is shown, the OP should do details and check for possible errors hiself.
Integrate[m^2/((1 - m^2)^2 + 1), {m, 0, 1}]
, Maple 17 gives1/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])]])
$\endgroup$x
andy
, e.g.Integrate[m^2/((1 - m^2)^2 + 1), {m, 0, 1}]
$\endgroup$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. $\endgroup$Maple
results andMathematica
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. $\endgroup$