SIMPLY WRITE EQUATION FOR BOTH CASES THEN DIVIDE TO FIND THE RELATION.
For the below question-
The potential energy of a long spring when stretched by 2 cm is U. If the spring is stretched by 8 cm, potential
energy stored in it will be?
you can approach as per discussed method as seen in attached image:
