# Integrals computation: Help me please!

1. Oct 4, 2011

### Phantony

Hi all,

can you help me to compute these integrals?

$$\int \frac{x \sqrt{a x+b+x^2}}{d^2+x^2} \, dx$$

$$\int \frac{x}{\left(d^2+x^2\right) \sqrt{a x+b+x^2}} \, dx$$

a,b and d are real and positive.

I tried with Mathematica, but the results involve logarithmic functions with complex argument whereas I need a solution in the real domain.

Thank you to all in advance.

2. Oct 4, 2011

### Ray Vickson

Maple 14 delivers answers in terms of logarithms and square roots and the like. These may be real or complex, depending on the relative magnitudes of a, b and d, but they are written in a symbolic form that does not involve complex quantities explicitly. They are much too large and complicated to be reproduced here. All I can suggest is that you try a tool other than Mathematica; it is often the case that when something does not work out well using one symbolic package, it is better done in another (and there is no consisitency: no one package is universally better than another).

RGV

3. Oct 5, 2011

### Phantony

Thank you soo much, RGV.
I will try with maple and I'll let you know.

:)

4. Oct 5, 2011

### Ray Vickson

The best way to do it is to recognize that for real d and x we have Re(1/(x + I*d)) = x/(x^2 + d^2), so you can integrate g1 = sqrt(x^2 + ax + b)/(x + I*d) or g2 = 1/(x + I*d)/sqrt(x^2 + ax + b), then (by assuming a,b,x,d real) take the real part *after* doing the integrals, by using the 'evalc' command. This shorter and sweeter than a direct approach.

RGV

5. Oct 6, 2011

### Phantony

Thank you again RGV.

Just one other thing. I'm using maple for the first time and I think that I'm doing something wrong because the result which I obtain is very long.
Is this the right sequence of commands?

$$int( \!{\frac { \sqrt{{x}^{2}+bx+c}}{x+id}},x)$$
$$assume(x, 'real', b, 'real', c, 'real', d, 'real')$$
$$evalc(\%)$$

Phantony.

6. Oct 6, 2011

### Ray Vickson

No, those are all wrong. You should use
J:=int(sqrt(x^2+a*x+b)/(x+I*d),x);
J1:=evalc(J) assuming real;
or
J1:=evalc(J) assuming a>0,b>0,d>0,x>0;
If you don't want output echoed on the screen, use the command end ':' instead of ';'

I actually prefer to use something like g1:=sqrt(x^2+a*x+b)/(x+I*d): (or ;) then put
J:=int(g1,x). That way I can get back later to the function g1, or to the function
f1 given as:
evalc(g1) assuming x>0,a>0,b>0,d>0; f1:=Re(%) assuming x>0,a>0,b>0,d>0;
This can all be shortened by setting
assns:=x>0,a>0,b>0,d>0;
evalc(g1) assuming assns; f1:=Re(%) assuming assns.

RGV

7. Oct 10, 2011

### Phantony

I have no words to express my gratitude to you.

I solved the problem

:!!):!!)