First, we'll re-write the expression of dy/dx, using the negative power rule:

(2+cosx)^-1 = 1/(2+cosx)

dy/dx = 1/(2+cosx) => dy = dx/(2+cosx)

To determine the primitive of the given function dy, we'll have to calculate the indefinite integral of dx/(2+cosx).

Int dx/(2+cosx)

This is a trigonometric integral and we'll turn it into an integral of a rational function. We'll replace tan (x/2) by the variable t.

x/2 = arctan t

x = 2arctan t

We'll differentiate both sides:

dx = 2dt/(1 + t^2)

We'll write cos x = (1-t^2)/(1+t^2)

We'll re-write the integral in t:

Int dx/(2 + cos x) = Int [2dt/(1 + t^2)]/[2 + (1-t^2)/(1+t^2)]

Int [2dt/(1 + t^2)]/[(2 + 2t^2 + 1 - t^2)/(1+t^2)]

We'll simplify by (1 + t^2):

Int 2dt/(3 + t^2) = 2*Int dt/[(sqrt3)^2 + t^2]

2*Int dt/[(sqrt3)^2 + t^2] = 2*sqrt3/3*arctan (tsqrt3/3) + C

But the variable t is: t = tan x/2,

**The primitive of the given function is f(x) = Int dx/(cosx + 2) = (2*sqrt3/3)*arctan [(tan x/2)*sqrt3/3] + C**