1

How can I visualize the volume of the solid of revolution generated by the functions $f(x)=x$ and $g(x)=x^2$ in mathematica? I asked chat-gpt and it gave me the command

RevolutionPlot3D[{f[x], g[x]}, {x, 0, 1}, AxesLabel -> {"x", "y", "z"},
  RevolutionAxis -> "X", PlotRange -> All]

But I think that it is not correct since when trying to verify with the solid given by $y=1$ and $y=0$ (in this case, a cylinder should appear) but the graph appears empty.

How can I view the order? thank you.

Actualization: By example, with the command

RevolutionPlot3D[{{x, 1}, {x, 2}}, {x, 0, 1}, RevolutionAxis -> "X"]

The revolution generated by each curve appears but I would like the volume between the two revolutions to come out with padding. (That is, I would like to visually see a solid cylinder.) Is there a command that can do that? Thank you.

eraldcoil
  • 183
  • 4

3 Answers3

2

You neglected to define your functions so MM does not know what to do.

f[x_] := x
g[x_] := x^2
RevolutionPlot3D[{f[x], g[x]}, {x, 0, 1}, 
 AxesLabel -> {"x", "y", "z"}, RevolutionAxis -> "X", 
 PlotRange -> All]
Lexington1776
  • 619
  • 1
  • 6
  • Thanks. A doubt: If RevolutionPlot3D[{{x, 1}, {x, 2}}, {x, 0, 10}, RevolutionAxis -> X] Is it possible to fill the volume? – eraldcoil Apr 18 '23 at 17:45
2

We can add a line {c,x^2}, 0<=x<=c for c=1.

ParametricPlot[{{x, x^2}, {1, x^2}}, {x, 0, 1}]

enter image description here

RevolutionPlot3D[{{x, x^2}, {1, x^2}}, {x, 0, 1}, 
 AxesLabel -> {"x", "y", "z"}, RevolutionAxis -> "X", 
 PlotRange -> All, PlotPoints -> 30, MaxRecursion -> 4]

enter image description here

cvgmt
  • 72,231
  • 4
  • 75
  • 133
0

The RevolutionPlot3D only plots the surface of revolution - it does not plot any interior points to create a filled object. Suggest you look at the following posts using RegionPlot3D.

Filling in a RevolutionPlot3D?

Filling the empty space in RevolutionPlot3D

Lexington1776
  • 619
  • 1
  • 6