# integral inner product

• April 16th 2010, 07:35 PM
demode
integral inner product
http://img232.imageshack.us/img232/9657/22513792.gif

Here's the solution provided:
http://img651.imageshack.us/img651/1880/68859494.gif

I don't understand how they got that answer! This is my own attempt:

Since $f$ is a piece-wise function I divided the interval to two and calculated the inner product like this:

$\left\langle f, sin(x) \right\rangle = \int^{0}_{-\pi} -sin(x)+\int^{\pi}_{0} sin(x)=$ $cos(0)-cos(\pi)-(-cos(\pi)-cos(0))=-2$

So, why is my method and my answer wrong? And could anyone please explain the method used in the model answers?
• April 16th 2010, 07:57 PM
dwsmith
$-\int_{-\pi}^{0}sin(x)dx+\int_{0}^{\pi}sin(x)dx=cos(x)]_{-\pi}^{0}-cos(x)]_{0}^{\pi}$
$=cos(0)-cos(-\pi)-cos(\pi)+cos(0)=1-(-1)-(-1)+1=1+1+1+1=4$
• April 16th 2010, 07:59 PM
Giraffro
The method used in the mode proof is this: If $a \geq 0$ and $g : [-a,a] \to \mathbb{R}$ is integrable then:
$\int_{-a}^a g(x) \mathrm{d} \! x = \begin{cases} 2 \int_0^a g(x) \mathrm{d} \! x & \text{if } g \text{ is even.} \\ 0 & \text{if } g \text{ is odd.} \end{cases}$
• April 17th 2010, 12:14 AM
demode
Quote:

Originally Posted by Giraffro
The method used in the mode proof is this: If $a \geq 0$ and $g : [-a,a] \to \mathbb{R}$ is integrable then:
$\int_{-a}^a g(x) \mathrm{d} \! x = \begin{cases} 2 \int_0^a g(x) \mathrm{d} \! x & \text{if } g \text{ is even.} \\ 0 & \text{if } g \text{ is odd.} \end{cases}$

Thanks. But how did they figure out that the given function $f(x)$ is odd? Could you please explain that?
• April 17th 2010, 12:22 AM
Giraffro
Quote:

Originally Posted by demode
Thanks. But how did they figure out that the given function $f(x)$ is odd? Could you please explain that?

Ah, I seem to have glanced over something. Well $\forall x \in (0,\pi], f(x) = -f(-x)$ and integrating over a point doesn't contribute to any integrals, so you could swap $f$ for:
$f(x) := \begin{cases} -1 & \text{if } -\pi \leq x < 0 \\ 0 & \text{if } x = 0 \\ 1 & \text{if } 0 < x \leq \pi \end{cases}$

Then $f$ would be odd and so $f(x) \sin(x)$ is odd, since $\sin(x)$ is even and the product of 2 odd functions is even. But explicit calculation is just as fine.