Let $a,b\in\mathbb{R}_{>0}$ and $\gamma: [0,2\pi]\rightarrow\mathbb{C},t\mapsto a\cos(t)+ib\sin(t)$
calculate the line integral
$\int_{\gamma}|z|^2dz$
My calculation turns out to be really ugly. Is there maybe a "nice" way to calculate this integral?
The integrals are not ugly at all. You obtain $$\int_\gamma|z|^2\>dz=\int_{\omega-\pi}^{\omega+\pi}\bigl(a\cos^2 t+b^2\sin^2 t\bigr)(-a\sin t+ib\cos t)\>dt\ ,$$ whereby $\omega$ can be chosen at will, due to periodicity. Choose $\omega:=0$ for the real part, then $\omega:={\pi\over2}$ for the imaginary part, and note that the respective integrands are odd with respect to these points.