Let y=cosx+y ⇒dxdy​=−sinx+y1+dxdy​….1
Now, given equation of tangent is x+2y=k ⇒ Slope =2−1​
So, dxdy​=2−1​ put this value in 1 , we get 2−1​=−sinx+y1−21​ ⇒sinx+y=1 ⇒x+y=2π​⇒y=2π​−x
Now, 2π​−x=cosx+y ⇒x=2π​ and y=0
Thus x+2y=k⇒2π​=k