2
$\begingroup$

For a test I had to evaluate $\int_0^{2\pi} \frac{1}{1+3\cos^2(\theta)}d\theta$. First I used substitution, with $z=e^{i\theta}$ and $d\theta=\frac{1}{iz}dz$, as shown: $$\int_0^{2\pi} \frac{1}{1+3\cos^2(\theta)}d\theta=\int_{|z|=1}\frac{1}{1+\frac{3}{4}(z+z^{-1})(z+z^{-1})}\frac{1}{iz}dz=\frac{4}{i}\int_{|z|=1}\frac{z}{3z^4+10z^2+3}dz$$

Then I used the residue theorem: $$\int_{|z|=1}\underbrace{\frac{z}{3z^4+10z^2+3}}_{f(z)}dz=\int_{|z|=1}\frac{z}{(z^2+3)(z^2+\frac{1}{3})}dz=\int_{|z|=1}\frac{z}{(z-i\sqrt{3})(z+i\sqrt{3})(z-i\frac{i\sqrt{3}}{3})(z+\frac{i\sqrt{3}}{3})}dz$$ As only $\frac{i\sqrt{3}}{3}$ and $-\frac{i\sqrt{3}}{3}$ lie in the integration domain, I don't need to compute the other residues: $$\operatorname{Res}(f;\frac{i\sqrt{3}}{3})=\frac{3}{16}$$ and $$\operatorname{Res}(f;-\frac{i\sqrt{3}}{3})=\frac{3}{16}$$

Finally: $$\int_0^{2\pi} \frac{1}{1+3\cos^2(\theta)}d\theta=\frac{4}{i}2\pi i \frac{6}{16}=3\pi $$

However MATLAB doesn't agree with that:

EDU>> f=@(z) 1./(1+3*cos(z).^2); quad(f,0,2*pi)  ans = 3.1416 

Where did I go wrong ? I don't see what's wrong in using theorems this way and I did the computations 3 times. Ask for more steps in calculation if needed.

  • 1
    Right after the first appearance of $f(z)$, when you factored the denominator, you forgot a factor $3$.2012-08-23
  • 0
    I got different residues than you did. Mine are 1/162012-08-23
  • 0
    @did: you're right, thanks and.. damn!2012-08-23
  • 0
    should I erase the question ?2012-08-23
  • 1
    I changed $cos^2\theta$ to $\cos^2\theta$. This not only prevents $\cos$ from being italicized as if it were three juxtaposed variables, but also provides proper spacing in epxressions like $5\cos x$.2012-08-23
  • 0
    Somebody should probably mention that complex analysis is not the simplest approach here, since the change of variables $t=\tan(\theta)$ yields directly the answer.2012-08-23
  • 0
    @did May be you should post your first comment as an answer?2012-08-24
  • 0
    @did: True, but I would assume there's a reason he used residue calculus instead a trig substitution2012-08-24
  • 0
    There are some approaches to this integral [here](http://math.stackexchange.com/q/132436/14657).2012-08-24
  • 0
    @Norbert: Done that.2012-08-24

1 Answers 1

6

Right after the first appearance of $f(z)$, when you factored the denominator, you forgot a factor $3$.

Note: Complex analysis might not be the simplest approach here, since the change of variables $t=\tan(θ)$ yields directly that, for every $a\gt-1$, $$ \int_0^{2\pi}\frac{\mathrm d\theta}{1+a\cos^2(\theta)}=\frac{2\pi}{\sqrt{a+1}}. $$