The first integral that I want to calculate is: $$\int_{|z-2|=5}\frac{z^3 +3}{z^2+1}\,dz$$
And the second is $$\int_{|z|=\frac{1}{2}}\frac{z^3 +3}{z^2+1}\,dz$$
The denominator can be factored into $(z+i)(z−i)$. As $z_0=i$ and $z_1=-i$ are inside the path $|z−2|=5$ I can't use Cauchy and I don't know how to solve those integrals with other method.
In the second case $z_0$ and $z_1$ aren't inside $|z|=\frac{1}{2}$ so I can to use Cauchy
You can use Cauchy's Residue theorem: if $f$ is analytic in a simply connected domain $\Omega$ except at a number of poles then the integral of $f$ along a closed contour in $\Omega$ that circulates the poles just once is $2\pi i$ times the sum of the residues at the poles lying inside the contour. The residue at a pole $z_0$ is the the coefficient to the term $1/(z-z_0)$ in the Laurent expansion of $f$ about $z_0$.
In your first integral, the contour includes two poles at $z = \pm i$.
Writing $$\frac{z^3+3}{z^2+1} = z + \frac{1}{2}\Bigg(\frac{3i-1}{z+i}-\frac{3i+1}{z-i} \Bigg)$$ you can see the residues at the two poles. At $z=-i$ it is therefore $\frac{1}{2}(3i-1)$ and that at $z=i$ is $-\frac{1}{2}(3i+1)$. Now apply the theorem, noting that the sum of the two residues is $-1$, to obtain, $$\int_{|z-2|=5} \frac{z^3+3}{z^2+1} dz = -2\pi i. $$
For the second integral, neither pole lies inside the contour and therefore the same theorem implies the integral will be zero.