Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got the integral $$\int_B|\sin(x)-y|dx dy$$ with $$B=\{0\leq x\leq \pi, 0\leq y\leq 1\}$$ My problem is how handle the abs in the integral. I'd probably go with two integrals (one when the abs is negative, one if it's positive), but I suppose there's a nicer solution. Note: I know how to deal with parametric integrals, the question is how to integrate the absolute value.

share|cite|improve this question
First compute the integral over $0\le y\le1$ for $x$ fixed. – Did Jun 23 '11 at 15:45
up vote 1 down vote accepted

$$ \int_0^\pi \int_0^1 |\sin x-y| dy dx= $$ $$ \int_0^\pi\left( \int_0^{\sin x} (\sin x-y)dy +\int_{\sin x}^1 (y-\sin x)dy\right)dx=$$ $$ \int_0^\pi \left( \sin^2 x- \frac{\sin^2 x}{2} + \frac{1}{2}-\sin x-\frac{\sin^2 x}{2}+\sin^2 x \right)dx=$$ $$ \int_0^\pi \left(\frac{1}{2}+\sin^2 x-\sin x\right)dx $$

From here on it's a simple one dimensional integration.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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