Question 559867
Let a and b be the side lengths of the cubes. Since a cube has 12 edges, we have


*[tex \LARGE 12a + 12b = a^3 + b^3]


The LHS and RHS can both be factored:


*[tex \LARGE 12(a+b) = (a+b)(a^2 - ab + b^2)]


*[tex \LARGE 12 = a^2 - ab + b^2 \Rightarrow a^2 - ab + b^2 - 12 = 0]


We can solve this as a quadratic in terms of a:


*[tex \LARGE a = \frac{b \pm \sqrt{(-b)^2 - 4(1)(b^2 - 12)}}{2(1)}]


*[tex \LARGE = \frac{b \pm \sqrt{-3b^2 + 48}}{2}]


We want -3b^2 + 48 to be a perfect square (then we must also check that it satisfies the constraints for a to be an integer, but we'll do that later). Fortunately, we do not have to check many values of b since -3b^2 + 48 becomes negative when b >= 5. It can be checked that b = 2 and b = 4 are the only values that yield perfect squares. The corresponding values for a are a = 4 and a = 2 respectively. These two are equivalent (4,2 and 2,4) so the dimensions of the cubes are 4 and 2.