0
$\begingroup$

This question already has an answer here:

How should I calculate this integral? $$\int_{-\pi}^\pi \cos(rx) \cos(kx)dx$$

[My attempt] $$\int_{-\pi}^\pi \cos(rx) \cos(kx)dx=2\int_0^\pi \frac{1}{2}\cos(r+k)x +\cos(r-k)xdx \\=[\frac{1}{r+k}\sin(r+k)x+\frac{1}{r-k}sin(r-k)x]_0^\pi \\ =\frac{1}{r+k}\sin(r+k)\pi+\frac{1}{r-k}\sin(r-k)\pi$$ I have calculated so far, but I do not know the steps ahead. What should I do?

$\endgroup$

marked as duplicate by Martin R, YuiTo Cheng, cmk, Adrian Keister, ThorWittich Jul 12 at 17:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ How did your attempt come to life? Did you evaluate the primitive function? did you prove that differentiating? $\endgroup$ – DonAntonio Jul 12 at 9:44
  • $\begingroup$ mathworld.wolfram.com/WernerFormulas.html $\endgroup$ – lab bhattacharjee Jul 12 at 9:44
  • $\begingroup$ You calculated the integral, so what is your question? $\endgroup$ – Martin R Jul 12 at 9:59
  • $\begingroup$ @MartinR Does this problem not calculate from there? I asked because I did not think this was the end. $\endgroup$ – hichewness Jul 12 at 9:59
  • $\begingroup$ Use parenthesis in the integrand of your attempt when multiplying by $\frac{1}{2}$ $\endgroup$ – Hussain-Alqatari Jul 12 at 10:09
1
$\begingroup$

Hint: Use that $$\cos(x)\cos(y)=\frac{1}{2}\left(\cos(x-y)+\cos(x+y)\right)$$ Your result should be $$2\,{\frac {k\sin \left( \pi\,k \right) \cos \left( \pi\,r \right) -r \cos \left( \pi\,k \right) \sin \left( \pi\,r \right) }{{k}^{2}-{r}^{2 }}} $$

$\endgroup$
  • $\begingroup$ THanks I added my attempt. $\endgroup$ – hichewness Jul 12 at 9:59
  • $\begingroup$ Apparently OP already used that identity. $\endgroup$ – Martin R Jul 12 at 9:59
0
$\begingroup$

$\cos (rx)\cos (kx)=\frac {\cos((r+k)x) +\cos((r-k)x)} 2$. Can you now compute the integral?

$\endgroup$
  • $\begingroup$ I added my attempt. but does this problem not calculate from there? I asked because I did not think this was the end. $\endgroup$ – hichewness Jul 12 at 9:59
  • $\begingroup$ Assuming that $r$ and $k$ are integers what you have obtained is $0$ if $r \neq k$ (because $\sin (n\pi)=0$ for all integers $n$). However you are dividing by $r-k$ so your calculation is not valid when $r=k$. You have to handle this case separately. $\endgroup$ – Kavi Rama Murthy Jul 12 at 10:09
0
$\begingroup$

Note that $\cos(u)\cos(v)=\frac{1}{2}[\cos(u+v)+\cos(u-v)]$

Therefore, $\int_{a}^{b}\cos(u)\cos(v)dx=\frac{1}{2}\int_{a}^{b}[\cos(u+v)+\cos(u-v)]dx$

Putting $a=-\pi$, $b=\pi$, $u=rx$, $v=kx$, we get

$\int_{-\pi}^{\pi}\cos(rx)\cos(kx)dx=\frac{1}{2}\int_{-\pi}^{\pi}[\cos(rx+kx)+\cos(rx-kx)]dx$

$=\frac{1}{2}\int_{-\pi}^{\pi}[\cos((r+k)x)+\cos((r-k))]dx$

$=\frac{1}{2}[\frac{\sin((r+k)x)}{r+k}+\frac{\sin((r-k)x)}{r-k}]_{-\pi}^{\pi}$

$=\frac{1}{2}[\frac{\sin((r+k)\pi)}{r+k}+\frac{\sin((r-k)\pi)}{r-k}]-\frac{1}{2}[\frac{-\sin((r+k)\pi)}{r+k}+\frac{-\sin((r-k)\pi)}{r-k}]$

$=\frac{1}{2}[\frac{\sin((r+k)\pi)}{r+k}+\frac{\sin((r-k)\pi)}{r-k}]+\frac{1}{2}[\frac{\sin((r+k)\pi)}{r+k}+\frac{\sin((r-k)\pi)}{r-k}]$

$=\frac{\sin((r+k)\pi)}{r+k}+\frac{\sin((r-k)\pi)}{r-k}$

$\endgroup$

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