The rate at which electrical energy is dissipated into other forms of energy is called electric power P.
Electrical power =tW=tVit (V=iR) ⇒PRV2
Where V is potential difference, R is resistance.
Given, P1=40W P2=60W ∴P2P1=R1R2 ⇒R2R1=P1P2 =4060=23
Note : Higher the wattage of a bulb smaller is the resistance of its filament that is thicker is the filament.