## An example of a piecewise defined function

Imagine an icecream cone containing a single, perfectly spherical scoop of ice cream. If the scoop is very small it will be contained entirely within the cone. If it is somewhat larger the scoop will rest against the sides of the cone and part of it will be within the cone and part of it will extend beyond the cone. If the scoop it very large it will rest on the outside lip of the cone and only a very small part of the icecream ball will be within the cone itself.

Define a function of the radius R which describes the volume in a ball of icecream of radius R which lies below the lip of the icecream cone. You may find it useful to refer to the formula for the volume of the cap of height H taken from a sphere of radius R. Notice that defining the function requires considering three three separate cases already mentioned. To deal with this you should use the piecewise command to define the function. (This is not available MapleVR3. In this case use the if ...then ...elif ...else ...fi; command. An alternate is to use the Heaviside fucntion). To begin, assume that that the angle formed at the tip of the cone is radians and that the height of the cone is 1 unit.

Plot the function you have defined and ask yourself if it agreees with common sense. Here you should use the discont=true option to the plot command so that you do not falsely connect the function at the point where the definition changes. Use the graph to estimate the largest amunt of icecream whic will be contained below the lip of the cone. (Experiment with plotting the function

with and without the discont=true option.) To use this option invoke the plot command on a function f as follows:

Next solve the general icecream cone problem symbolically when the angle is radians. Use plot3d to plot the volume as a function of both radius and angle. Note that it is no lonegr possible to plot the function simply as a function of R since the angle is not determined. What happens if you do try to plot it?

Juris Steprans