# Average value

1. Nov 3, 2009

### chevy900ss

1. The problem statement, all variables and given/known data

Find the average value of f(x,y)=sin(x+y) over the rectangle 0 ≤ x ≤ pi, 0 ≤ y ≤ pi.

2. Relevant equations

3. The attempt at a solution
I got 1/pi as a answer.

2. Nov 3, 2009

### Staff: Mentor

You're not going to make us work this out, are you? Show us how you got it.

3. Nov 3, 2009

### chevy900ss

well i dont no how to show the symbols

4. Nov 3, 2009

### Staff: Mentor

Just click on the integral below, and a window will open with the LaTeX code. All you need to do is fill in where there are question marks.
For pi, use \pi. A is the area of your region. If you want to switch the order of integration, change the bottom limit from x to y and vice-versa, and switch the dx and dy.
$$\frac{1}{A}\int_{x = ?}^? \int_{y = ?}^? sin(x + y) dy~dx$$

5. Nov 3, 2009

### chevy900ss

\frac{1}{A}\int_{x = 0}^\pi \int_{y = 0}^\pi sin(x + y) dy~dx

6. Nov 3, 2009

### chevy900ss

yeah i cant figure out how to make it look like yours. It just stays in the formula form

7. Nov 3, 2009

### Staff: Mentor

It needs to be inside [ tex] [ /tex] tags (without the space I added). Like so:
$$\frac{1}{A}\int_{x = 0}^\pi \int_{y = 0}^\pi sin(x + y) dy~dx$$

OK, so what do you get for the integral, and what do you get for A?

8. Nov 3, 2009

### chevy900ss

For A i get pi^2

9. Nov 3, 2009

### chevy900ss

the end integral i get
1/pi^2[-cosx-x(from 0 to pi)] which i get -1/pi

10. Nov 3, 2009

### jbunniii

I tried it and got 0. Can you show us what you got after evaluating the inner integral?

P.S. This is almost immediate if you use

$$\sin(x+y) = \sin(x)\cos(y) + \cos(x)\sin(y)$$

and break the integral into two parts, integrating the cosine term first in each case (trivial if you use symmetry).

Last edited: Nov 3, 2009
11. Nov 3, 2009

### Staff: Mentor

The area is correct, but I'm pretty sure you made an error in calculating the integral. How did you get -cosx -x?

12. Nov 3, 2009

### chevy900ss

$\frac{1}{pi^2}\int_0^pi\int_0^pi sin(x+y)dydx=\frac{1}{pi^2}\int_0^pi sin(x)[-cosy|_0^pi] dx=\frac{1}{pi^2}\int_0^pi (sinx-1)dx=\frac{1}{pi^2}[-cosx-x|_0^pi]=\frac{-pi}{pi^2}=\frac{-1}{pi}$

13. Nov 3, 2009

### chevy900ss

$$\frac{1}{pi^2}\int_0^pi\int_0^pi sin(x+y)dydx=\frac{1}{pi^2}\int_0^pi sin(x)[-cosy|_0^pi] dx=\frac{1}{pi^2}\int_0^pi (sinx-1)dx=\frac{1}{pi^2}[-cosx-x|_0^pi]=\frac{-pi}{pi^2}=\frac{-1}{pi}$$

14. Nov 3, 2009

### chevy900ss

$$\frac{1}{\pi^2}\int_0^\pi\int_0^\pi sin(x+y)dydx=\frac{1}{\pi^2}\int_0^\pi sin(x)[-cosy|_0^\pi] dx=\frac{1}{\pi^2}\int_0^\pi (sinx-1)dx=\frac{1}{\pi^2}[-cosx-x|_0^\pi]=\frac{-\pi}{\pi^2}=\frac{-1}{\pi}$$

15. Nov 3, 2009

### jbunniii

I'm not sure what you did in this step. Here is how I did it:

\begin{align*}\int_{0}^{\pi} \int_{0}^{\pi} \sin(x+y) dy dx &= \int_0^{\pi}\int_{0}^{\pi} \sin x \cos y dy dx + \int_0^{\pi}\int_{0}^{\pi} \cos x \sin y dy dx \\ &= \int_0^\pi \sin x \left(\int_0^\pi \cos y dy \right) dx + \int_0^\pi \sin y \left(\int_0^\pi \cos x dx \right) dy \\ &= \int_0^\pi (\sin x) (0) dx + \int_0^\pi (\sin y) (0) dy \\ &= 0 \end{align*}

You can also do it without using the trig identity; I highly recommend doing so. (The answer is still 0.)

16. Nov 3, 2009

### chevy900ss

i see i was just no where near the right answer.

17. Nov 3, 2009

### jbunniii

Wait... are you assuming here that

$$\sin(x+y) = \sin(x) \sin(y)$$?

It seems that you are, but that's wrong. The inner integral should be

$$\int_0^\pi \sin(x+y) dy = [-\cos(x+y)]|_{y=0}^{y=\pi} = -\cos(x+\pi) + \cos(x) = \cos(x) + \cos(x) = 2\cos(x)$$

Now do the outer integral:

$$\frac{1}{\pi^2} \int_0^\pi 2 \cos(x) dx$$