I've tried to solve the equation 2cos^2x= sin 2x for 0<x<pi

I know I have to express it in either sine or cos. And after that substitute by t and solve the quadratic equation. But I must be doing something wrong, because I keep getting the wrong I answer.

I would appreciate if you could solve and explain to me how it's solved

Thanks a lot,

Amine.