Compose a function based on a word problem I'm not looking for answers, I'm just having a hard time with composing a function out of a Max/Min problem like this. Possibly just show me how you would compose the function and leave the rest for me?

Create a cylindrical can that minimizes the cost of materials but must hold 100 cubic
  inches. The top and bottom of the can cost 14 cents per square inch, while the sides cost only 7 cents per square inch.

 A: Hint: The area of either the top or the bottom is:
$$
A_\text{circle} = \pi r^2
$$
The area of the sides is:
$$
A_\text{lateral} = 2\pi rh
$$
So the cost function is:
$$
C = 14(2A_\text{circle}) + 7(A_\text{lateral})
$$
Unfortunately, notice that $C$ is a function of both radius and height. It would be nice if it was just a function of a single variable, say $r$. This is where the volume constraint comes into play. Recall that the volume of a cylinder is:
$$
V = (A_\text{circle})h
$$
Since $V$ is known to us, we can use this constraint to solve for $h$, then substitute into our cost function to get $C$ as a function of only $r$, which makes it easier for us to compute its derivative for optimization.
A: Let $V$ be the volume of the can and $A$ be the surface area of the can, with radius $r$ and height $h$

The Area of the can is described in the problem as being made from an identical top and bottom with a cost of 14 and a side of cost 7.
$$V=100$$
$$A=2(top) + (side)$$
$$A=2(\pi r^2) + 2\pi rh$$
As a cost function:
$$C=14(2\pi r^2) + 7(2\pi rh)\tag{1}$$
and the known volume can be equated to the area by a factor of the height:
$$V=\pi r^2h=100$$
$$\Rightarrow h=\frac{100}{\pi r^2}$$
Substitute into $(1)$
$$C=14(2\pi r^2) + 7(2\pi r\frac{100}{\pi r^2})$$
Your units remain as cents per square inch. Simplify and differentiate.
A: Your constraint is that the volume must be 100 cubic inches.  A cylynder has a volume of $\pi r^2h$.  , so yyour constraint is $\pi r^2 h=100$.   You want to optimize the cost, the material of the can is the surface area.  The top and bottom are each circles with area $\pi r^2$ each,   so the cost for the top and bottom combined is $2\cdot 0.14\cdot \pi r^2$  .  The sides of a cylinder you can get the surface area by imagining cutting it along one side and unrolling it. It becomes a rectangle, with a side length of the circumference of the circle, and the other side is the height,  so you get that part costs $.07\cdot 2\pi rh$.  Putting that together, your cost to optimise is $C=0.18\pi r^2+0.14\pi rh$
A: Leave off the top of the can for liquid contents and leave off the top and bottom of the can for gaseous contents such as air, thus saving more money than other solutions posted here.  You didn't state what the cylinder will be holding as its contents so this is a possible solution.
If you don't like that solution, then how about this one...?  Build the wall of the can so that there is no top and no bottom.  Now tip the can on its side and add the 2 missing sides.  Those are no longer the top and bottom because the can is tipped so the only top and bottoms are a very small sliver of what was once the sides.
