Using the complex representation to solve integrals of product of trigonometric functions

28 Views Asked by At

I've tried to evaluate this integral using complex numbers, but plugging in numbers shows it's wrong. Why's that?

$$\int_{-t}^t\operatorname{cos}(ax)\operatorname{cos}(bx)dx = \text{Re}\left(\int_{-t}^t e^{i(a+b)x}dx\right) = \text{Re}\left[\frac{e^{i(a+b)x}}{i(a+b)}\right]_{-t}^t = $$

$$= \frac{2}{a+b} \text{Re}\left(\frac{e^{i(a+b)t}-e^{-i(a+b)t}}{2i}\right) = \frac{2\operatorname{sin}((a+b)t)}{a+b}.$$