Greatest distance between vertices from two squares

"A square with a perimeter of 20 cm is inscribed in a square with a perimeter of 28 cm. What is the greatest distance between a vertex of the inner square and a vertex of the outer square, in centimeters?"

I worked out the area of the individual sides- 5 for for the small square and 7 for the big one. I also noticed side $a^2+b^2=25$ (see picture) due to Pythagoraean theorem and that $a+b$ is 7, but I don't know if this helps me at all. Any help is greatly appreciated.

-
Hint: Use your two equations to find $a$ and $b$. Either substitute $7-a$ for $b$ in $a^2+b^2=25$, and solve the resulting quadratic equation for $a$. Or else note that $(a-b)^2=2(a^2+b^2)-(a+b)^2$. Or else you can guess what $a$ and $b$ are. – André Nicolas Mar 25 '14 at 7:45

As you noticed (correctly), $$a^2 + b^2 = 25$$ and $$a+b=7$$

It's possible to substitute and solve the quadratic with factoring, but it's easier to notice that $(a, b) = (3,4)$ or $(a,b) = (4,3)$ are solutions. Assume, for convenience, that $b$ is the larger of the two, so that $a=3$ and $b=4$. Then, the largest distance from a vertex of the inner square to one of the outer square should be the length of the red line in this diagram:

The red line is the hypotenuse of a right triangle with bases $4$ and $7$. Its length, by the Pythagorean theorem, is $$\sqrt{4^2 + 7^2} = \boxed{\sqrt{65}}$$

-

Using the two equations $$\begin{cases} a^2+b^2=25\\ a+b=7 \end{cases}$$ you get that $a=3$ and $b=4$ (assuming WLOG that $b\geq a$). Now computing the distance of a vertex of the inner square from vertices of the outer square (by "vertices" I suppose that you just mean the corners of the square). You will find that the values are $3$, $4$, $\sqrt{58}$ and $\sqrt{65}$.

-