0
$\begingroup$

I am trying to solve the integral

Integrate[(Sin(theta))/sqrt((r^2) + (s^2) - 2 rs(cos(theta))), {theta, 0, pi}] 

with assumptions that 2/s if r < s and 2/r if r > s. However, I'm not sure how to give these assumptions. I also need to make the assumption that rand s are greater than zero.

The solution to this integral is piecewise.

$\endgroup$
  • $\begingroup$ Maybe this you want:{Integrate[ Sin[theta]/Sqrt[r^2 + s^2 - 2*r*s*Cos[theta]], {theta, 0, Pi}, Assumptions -> {r > 0, s > 0, r < s}], Integrate[ Sin[theta]/Sqrt[r^2 + s^2 - 2*r*s*Cos[theta]], {theta, 0, Pi}, Assumptions -> {r > 0, s > 0, r > s}]} ? $\endgroup$ – Mariusz Iwaniuk Oct 9 at 18:00
  • $\begingroup$ All built-in functions and constants must start with a capital letter (e.g., Sin, Cos, Sqrt, Pi). Use brackets [ ] to enclose function arguments rather than parentheses. rs is not the same as r*s or r s. For assumptions, what is supposed to be either 2/s or 2/r depending on relation between r and s? Either use Assumptions option in Integrate or use Assuming construct around Integrate. $\endgroup$ – Bob Hanlon Oct 9 at 18:08
  • $\begingroup$ Assuming[r > 0 && s > 0 && r != s, Integrate[ Sin[theta]/Sqrt[r^2 + s^2 - 2 r*s*Cos[theta]], {theta, 0, Pi}] // Simplify] $\endgroup$ – Bob Hanlon Oct 9 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.