0
$\begingroup$

I wanted to solve the following integral using the residue theorem $\begin{align*}\int_{0}^{2\pi} \frac{\cos(3x)}{5-4\cos(3x)} \,dx\end{align*}$ and for that I thought I could replace it by $\begin{align*} \operatorname{Re}\biggl(\int_{0}^{2\pi} \frac{e^{3ix}}{5-4 e^{3ix}}\, dx\biggr) = \operatorname{Re}\biggl(\oint_\gamma \frac{z^{3}}{5-4 z^{3}} \frac{dz}{iz}\biggr)\end{align*}$ using $z=e^{ix}$ and $\gamma$ beeing a closed loop along the unit circle. Following this method, I could find that there are no singularities enclosed by the path so this should give me $\begin{align*}\int_{0}^{2\pi} \frac{\cos(3x)}{5-4\cos(3x)}\, dx=0\end{align*}$ which is wrong. I thought the mistake is in the step $\begin{align*}\int_{0}^{2\pi} \frac{\cos(3x)}{5-4\cos(3x)}\, dx=\operatorname{Re}\biggl(\int_{0}^{2\pi} \frac{e^{3ix}}{5-4 e^{3ix}}\, dx\biggr)\end{align*}$. Indeed I calculated these on Wolfra alpha and didn't get the same result. I don't understand when I can use the trick of substituting an integral with $\cos(x)$ by the real part of an integral with $e^{ix}$ or substituting an integral with $\sin(x)$ by the imaginary part of an integral with $e^{ix}$ multiplied by $i$, since $e^{ix}=\cos(x) + i\sin(x)$. So, I would like to know in general when I am allowed to use it, and when I should be more careful about it.

$\endgroup$

1 Answer 1

2
$\begingroup$

Yep the mistake is there the problem is that the $\operatorname{Re}$ function is linear, but it doesn’t distribute over division. $$\operatorname{Re} \left(\frac{a}{b}\right)$$ is not the same as $$ \frac{\operatorname{Re} (a)}{\operatorname{Re}(b)}.$$

Therefore, you cannot change $$\frac{\cos(3x)}{5-4\cos(3x)} $$ to $$\operatorname{Re}\left(\frac{e^{3ix}}{5-4 e^{3ix}}\right).$$

Basically the only time this will work as is, is if you only have cos on the numerator of the fraction.

$\endgroup$
7
  • $\begingroup$ Thank you! That's already pretty helful, I didn't thought about that, so basically I can use that trick when I only have an addition or substraction of sin or cos? Maybe to fully answer the question you should precise when I can use this trick and when I can not. $\endgroup$ Feb 7, 2021 at 16:15
  • $\begingroup$ Well it will work on a linear combination (though you should split the integral if you have one of these) $\endgroup$
    – Nephanth
    Feb 7, 2021 at 16:18
  • $\begingroup$ Another way it will work, is when you have multiple factors (like a multiplication), but you can only change one of the factors and it must be in the numerator $\endgroup$
    – Nephanth
    Feb 7, 2021 at 16:19
  • $\begingroup$ for example, you can transform $e^x cos x$ to $e ^x e^{i x}$, which might be useful $\endgroup$
    – Nephanth
    Feb 7, 2021 at 16:19
  • $\begingroup$ but you cannot transform $cos x sin x$ to $e^{ix} * e^{ ix - \pi / 2}$ for example because you cannot change more than one factor $\endgroup$
    – Nephanth
    Feb 7, 2021 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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