Well, we have:
$$\text{y}'\left(x\right)\cdot\cos\left(x\right)+2\cdot\text{y}\left(x\right)\cdot\sin\left(x\right)=0\space\Longleftrightarrow\space\int\frac{\text{y}'\left(x\right)}{\text{y}\left(x\right)}\space\text{d}x=\int\frac{-2\cdot\sin\left(x\right)}{\cos\left(x\right)}\space\text{d}x\tag1$$
Now, use:
- $$\int\frac{\text{y}'\left(x\right)}{\text{y}\left(x\right)}\space\text{d}x=\ln\left|\text{y}\left(x\right)\right|+\text{C}_1\tag2$$
- $$\int\frac{-2\cdot\sin\left(x\right)}{\cos\left(x\right)}\space\text{d}x=
-2\int\tan\left(x\right)\space\text{d}x=2\ln\left|\cos\left(x\right)\right|+\text{C}_2\tag3$$
So, we get that:
$$\ln\left|\text{y}\left(x\right)\right|=2\cdot\ln\left|\cos\left(x\right)\right|+\text{C}\tag4$$
When we want to solve $\text{C}$, use the initial condition $\text{y}\left(\frac{\pi}{2}\right)=\frac{1}{2}$, but we get:
$$\cos\left(\frac{\pi}{2}\right)=0\tag5$$
And, when we know that:
$$\lim_{x\to\frac{\pi}{2}}\ln\left|\cos\left(x\right)\right|=\lim_{\text{n}\to0}\ln\text{n}\space\space\space\to\space\space\space-\infty\tag6$$
And so, we get:
$$\ln\left|\frac{1}{2}\right|=-\ln(2)\ne\lim_{x\to\frac{\pi}{2}}\ln\left|\cos\left(x\right)\right|=\lim_{\text{n}\to0}\ln\text{n}\space\space\space\to\space\space\space-\infty\tag7$$