In this problem, we need to focus on the half cross-section of the two figures. The half cross-section of the cylinder breaks the half cross-section of the cone into two similar triangles. One triangle sits atop the cylinder. The second triangle is formed by these sides: the height of the cylinder; the part of the half cross-section of the cone which lies between its base and the point where the top of the cylinder touches it, which is actually this triangle's hypotenuse, and last but not least, the radius of the cone minus the radius of the cylinder. A third triangle which is similar to the other two is the half-cross section of the cone itself. We can set up a relationship between the parts of the similar triangles needed to derive the needed function:
This is the particular relationship that obtains in this problem:
height large triangle/height small triangle = base large triangle/base small triangle
Furthermore, it doesn't matter whether we use the triangle atop the cylinder or the triangle at the base of the cone, we get the same relationship. If we use the bottom triangle, we get this:
15/h = 3/(3 - r)
15 (3 - r)/3 = h
(15/3)(3 - r) = h
5 (3 - r) = h or
h = 5 (3 - r)
If we use the top triangle, we get this:
15/15 - h = 3/r
3 (15 - h) = 15r
45 - 3h = 15r
-3h = -45 + 15r
-3h/-3 = (-45 + 15r)/-3
h = 15 - 5r
h = 5 (3 - r)
So the required function is h = 5 (3 - r).