# Solving an integral using assumptions

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.

• 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}]} ? – Mariusz Iwaniuk Oct 9 at 18:00
• 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. – Bob Hanlon Oct 9 at 18:08
• Assuming[r > 0 && s > 0 && r != s, Integrate[ Sin[theta]/Sqrt[r^2 + s^2 - 2 r*s*Cos[theta]], {theta, 0, Pi}] // Simplify] – Bob Hanlon Oct 9 at 18:13