Consider the given function,
y=cosx−cos2x
Differentiate both side with respect to x,
dydx=−sinx+2sin2x
Differentiate again both side with respect to x,
d2ydx2=−cosx+2cos2x
Put,x=π2 we get
(d2ydx2)x=π2=−cosπ2+2cos2.π2
=0+2cosπ
=2(−1)
=−2
Hence, this is the answer.