Answer
$y=c \csc -\frac{1}{2}\csc x \cos 2x$
Work Step by Step
We are given:
$y'+ycot x=2 \cos x$
The general solution of the equation can be given by:
$y=e^{-\int -\cot xdx}(c+\int e^{\int \cot xdx} 2 \cot xdx)$
where $c$ is the constant of integration.
Since:
$e^{-\int \cot xdx}=e^{-\ln \sin x}=\csc x$
and $e^{\int \cot xdx}=e^{\ln \sin x}=\sin x$
We have:
$y=e^{-\int -\cot xdx}(c+\int e^{\int \cot xdx} 2 \cot xdx)=\csc x(c+\int 2\sin x \cos x dx)=c \csc -\frac{1}{2}\csc x \cos 2x$