Starting with:
$$mgh=\frac{1}{2}\sigma_1\epsilon V_1+\frac{1}{2}\sigma_2\epsilon V_2$$
Where sigma is stress, and epsilon is strain. Now we know that strain = stress / Young's modulus, we can make the substitution to get the equation I got in my previous post.
The broken link is:
http://skule.ca/courses/exams/bulk/20139/CIV102H1F_2013_STRUCTURES%20&%20MATERIALS-AN%20INTRODUCTION%20TO%20ENGINEERING%20DESIGN.PDF
The URL doesn't work if you directly click on it, you have to copy + paste from editing my post