That is a simple Question Here u need to consider the torques exerted by two different forces SO when the Stick or teh rod makes an angle theta Then torques due to two forces act on the rod One is due to garvity and the other is due to the restoring force exerted by the spring and by the earth
NOw lets us consider the situation when the stick has made an angle theta with the vertical. Then we have the torque due to gravity to be tau_g = -mgsin( theta)*l/2 the force due to garvity acts through the center of mass therfore the lever arm is l/2 sin(theta) Now the torque due to the restoring force exerted by the spring is equal to -kx sin(90-theta) *l = tau_spring the angle is deduced from geometry The torques due to forces point in the same direction. therefore they can be added them up tau_net = -mgsin(theta)*l/2- kxcos(theta)*l where l is the lenght of the rod which should have been given in the question for very small angles we have cos(theta) = 1 sin (theta) = theta these results follows from talyor series tau_net = -mg(theta)*l/2 - kx*l now we have theta = x/l so x =theta*l tau_net = - (mg*l/2-kl^2) theta now we have the torque acting as a function of the angle rotated therefore omega = sqrt{ ( mg*l/2+kl^2)/(1/3 ml^2)}= sqrt{3 mg/2l + 6k/2m} the rod rotates about the pivot T = 2 pie /omega which gives u T = 2 pie/omega Now lets us test this result when u r spring constant is equal to zero which means that no spring is present then u have T to be a expected result therfore the preiod T = 2(pi) * sqrt{2ml/(6Kl+3mg}