Surfaces of revolution and Riemann sums

Ivan Cnop
Vrije universiteit Brussel
icnop@vub.ac.be

This notebook shows how to spin a graph around a given axis.

Define a function and plot

g[x_] := Sqrt[x]

ParametricPlot3D[{x, g[x] Cos[u], g[x] Sin[u]}, {x, 0, 5}, {u, 0, 
        2 π}, 
PlotPoints -> {25, 25}, 
      Axes -> True]

Approximate by step functions on equal subintervals

Give a function on the interval  [0,b]

Add the left endpoint value everywhere if it is not the origin.

n = 10;

a = Range[n]

where = Map[x < # &, h a]

values = Flatten[Transpose[{where, 3.  - a/6}]]

values /. Head[values] -> Which

h =  .5

f[x_] := values /. Head[values] -> Which

Plot[f[x], {x, 0, 5}, PlotRange -> {-5, 5}, 
      AspectRatio -> Automatic]

Animate this graph by mouse

<< RealTime3D`

ParametricPlot3D[{x, f[x] Cos[u], f[x] Sin[u]}, {x, 0, 5}, {u, 0, 
        2 π}, PlotPoints -> {60, 40}, Axes -> True]

The number of  plotpoints has to be sufficient to show behavior at discontinuities.

Working with 2 functions allows to display shells and washers.