1
$\begingroup$

When I try to solve this integral: $$\int_{-a}^a \frac{x}{\left(x^2+y^2\right)^{3/2}} \, dy$$

it's return

ConditionalExpression[(2 a)/(x Sqrt[a^2 + x^2]), 
  Im[x]^2 <= 
    Re[x]^2 && (Im[x/a] > 1 || Im[x/a] < -1 || 
     Re[x/a] != 
      0) && (Sqrt[-((Im[x] Re[x])/(Im[a] Re[a]))] ∉ 
      Reals || 
     Im[x] (Im[x] + (Re[a] Re[x])/Im[a]) <= 
      Re[x] ((Im[a] Im[x])/Re[a] + Re[x]) || 
     Re[Sqrt[-((Im[x] Re[x])/(Im[a] Re[a]))]] >= 1)]

and takes 37s to solve!

Is there any particular reason? Is there a way to obtain only the [[1]] part ?

$\endgroup$
3
  • 1
    $\begingroup$ use assumptions Integrate[x/(x^2 + y^2)^(3/2), {y, -a, a}, Assumptions -> (x | y) \[Element] Reals && x > 0 && a > 0]. This is likely a duplicate, but I can't find which one. $\endgroup$
    – chuy
    Aug 5, 2014 at 17:29
  • $\begingroup$ I get it now!Now how can i do this automatic with something like $Pre ... $\endgroup$
    – Kafkarudo
    Aug 5, 2014 at 17:53
  • 1
    $\begingroup$ you can do $Assumptions = {(x | y) \[Element] Reals && x > 0 && a > 0} instead of giving the option to Integrate (be aware though that only functions that take an assumptions argument actually use the $Assumptions variable.. ) $\endgroup$
    – george2079
    Aug 5, 2014 at 18:52

2 Answers 2

3
$\begingroup$

You can throw your assumptions into Assuming as follows:

Assuming[{y ∈ Reals, x > 0, a > 0}, Integrate[x/(x^2 + y^2)^(3/2), {y, -a, a}]]

Mathematica graphics

$\endgroup$
0
$\begingroup$

Sometimes it is good to find the general integration and then find the bounded one using substitution.

int[y_] = Integrate[x/(x^2 + y^2)^(3/2), y];
int[a] - int[-a]

(*(2 a)/(x Sqrt[a^2 + x^2])*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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