All, In calculus I have to do images such as the following in helping explain technique to students. This one is by rotating $y=\sqrt x$ about the x-axis, an image copied from Stewart's Calculus textbook.
I am wondering if anyone has experience in doing this and has any links to share, some sample files, etc., which would give me an idea on how to best make the image on the right.
Thanks.
Close to what I need:
Consider:
Show[Plot[{-Sqrt[x], Sqrt[x]}, {x, 0, 1},
PlotRange -> {{-0.25, 1.25}, {-1.5, 1.5}},
PlotStyle -> Black,
Filling -> True, FillingStyle -> Directive[LightBlue],
AxesStyle -> Directive[Thin, Arrowheads[0.03]],
Ticks -> {{1}, {-1, 1}},
AxesLabel -> {"x", "y"},
AspectRatio -> Automatic
],
Graphics[{
GrayLevel[0.7], EdgeForm[Black],
Disk[{1, 0}, {.1, 1}],
Pink,
Rectangle[{0.47, -Sqrt[0.5]}, {0.53, Sqrt[0.5]}],
Disk[{0.47, 0}, {.07, Sqrt[0.5]}],
Disk[{0.53, 0}, {.07, Sqrt[0.5]}],
Text[Style["\[CapitalDelta]x", Black], {0.5, -Sqrt[0.5]}, {0, 2}]
}]
]
Which produces this image.
If I can come up with a way of joining (taking the union of) the first rectangle and first circle, so that the edge form only marks the exterior of the joined form, then I might have a solution. Any suggestions on how I might do that?
Final Update:
Thanks to @kguler's amazing answer, I learned an exceptional amount of material and possibilities. I made a few adjustments to his code. Here is my final example.
curve = Line@
Table[{.53, 0} + {.07, Sqrt[0.5]} {Cos[t], Sin[t]}, {t, Pi/2,
3 Pi/2, Pi/20}];
poly = Polygon[
Join[
Table[{.53, 0} + {.07, Sqrt[0.5]} {Cos[t], Sin[t]}, {t, -Pi/2,
Pi/2, Pi/20}],
Table[{.47, 0} + {.07, Sqrt[0.5]} {Cos[t], Sin[t]}, {t, Pi/2,
3 Pi/2, Pi/20}]
]
];
g1 = Plot[{-Sqrt[x], Sqrt[x]}, {x, 0, 1},
PlotRange -> {{-0.25, 1.25}, {-1.5, 1.5}}, PlotStyle -> Black,
Filling -> True, FillingStyle -> Directive[LightBlue],
AxesStyle -> Directive[Thin, Arrowheads[0.03]],
Ticks -> {{1}, {-1, 1}}, AxesLabel -> {"x", "y"},
AspectRatio -> Automatic];
g2 = Graphics[{GrayLevel[0.7], EdgeForm[Black], Disk[{1, 0}, {.1, 1}],
Pink, EdgeForm[Black], poly, Black, curve,
Text[Style["\[CapitalDelta]x", Black], {0.5, -Sqrt[0.5]}, {0,
2}]}];
Show[g1, g2, Graphics[{
Blue, Line[{{0.5, 0}, {0.5, Sqrt[0.5]}}],
Text[Style["\!\(\*SqrtBox[\(x\)]\)", Black, Bold], {0.5,
Sqrt[0.5]/2}, {-1.5, 0}],
PointSize[Medium], Point[{0.5, 0}],
Text[Style["x", Black, Bold], {0.5, 0}, {0, 1.5}]
}]
]
And the resulting image: