Message Boards Message Boards

9 Replies
2 Total Likes
View groups...
Share this post:

Trying to change the Integrate output


I'm trying to run the following integral:

Integrate[1/(x (x^2 - a^2)^(1/2)), x]

to get as result:

1/a ArcTan[1/a (x^2 - a^2)^(1/2)

Unfortunately, Mathematica is giving me something else that I am unable to convert to this expression (or close to it). I have tried ExpToTrig and ComplexExpand without success.

Can someone give me a hint?

9 Replies

I haven't looked it up, but it looks like a problem that may depend on whether a and x are real or complex, and on the sign of x^2-a^2. You can take a look at the Assumptions option of Integrate, but I couldn't get that to work either. I've had a somewhat similar problem in the past where Integrate returned the most general solution but couldn't refine it to a special solution when I tried to restrict values of parameters and variables via Assumptions.

POSTED BY: Bianca Eifert

This is one way:

FullSimplify[Re@Integrate[1/(x (x^2 - a^2)^(1/2)), x], x > a > 0] /. 
 Arg[x_] :> ArcTan[Simplify[Im[x]/Re[x], x > a > 0]]
POSTED BY: Gianluca Gorni

I would like to thank you both, Bianca and Gianluca, for helping me. About Bianca's idea, I also was not able to improve the result by using Assumptions. About Gianluca's, his suggestion is interesting, but it depends on the previous knowledge about the ArcTan function in the solution.

The ideal way of solving that integral, which I was expecting to find, was to use the functions and options already provided by Mathematica, such as FullSimplify, Expand, Factor, PowerExpand, ExpToTrig, Assumptions, and many others.

I don't think the answer you're trying to get is correct.

In[2]:= f1[x_, a_] = Integrate[1/(x (x^2 - a^2)^(1/2)), x]

Out[2]= -((I Log[-((2 I a)/x) + (2 Sqrt[-a^2 + x^2])/x])/a)

In[3]:= f2[x_, a_] = 1/a ArcTan[1/a (x^2 - a^2)^(1/2)]

Out[3]= ArcTan[Sqrt[-a^2 + x^2]/a]/a

In[10]:= f1[1, 1] - f2[1, 1]

Out[10]= -I (-((I \[Pi])/2) + Log[2])
POSTED BY: Frank Kampas
In[13]:= D[1/a ArcTan[1/a (x^2 - a^2)^(1/2)], x] // Simplify

Out[13]= 1/(x Sqrt[-a^2 + x^2])
In[15]:= D[f1[x, a], x] // FullSimplify

Out[15]= 1/(x Sqrt[-a^2 + x^2])
POSTED BY: Frank Kampas

Perhaps the difference between f1 and f2 is a function of a but not of x.

POSTED BY: Frank Kampas
Plot3D[Abs[f1[x, a] - f2[x, a]], {x, -3, 3}, {a, -3, 3}]

enter image description here

POSTED BY: Frank Kampas
D[f1[x, a] - f2[x, a], x] // Simplify

gives 0. Also a 3D plot

Plot3D[ReIm[f1[x, a] - f2[x, a]], {x, -1, 1}, {a, -1, 1}, 
 AxesLabel -> Automatic]

shows that the difference of the two functions only depends on a (a part from a jump discontinuity).

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract