How to draw integral with mathematica

In summary, Dale wants to be able to plot the limits of integration for a triple integral in spherical and cylindrical coordinates, but doesn't want to have to do a separate plot for the cone underneath the sphere.
  • #1
EliasS
5
0
Hello,
is there a way to draw the volume of a triple integral?, and in different ways?(rectangular, cylindrical and sphere coordinates)
for example if the integral is
attachment.php?attachmentid=20391&stc=1&d=1252079429.jpg

what I want is to draw directly with the above formula
attachment.php?attachmentid=20392&stc=1&d=1252079429.jpg


I have been struggling all day with this, because if for example I use something like Plot3D[Integrate[x... it will first solve the integral, which will become a constant and then draw that constant

Also there must be a way because in the calculus book I'm studying, in many exercises it ask you to draw the volume of the problem with a software tool

Thank you, I really need this
 

Attachments

  • 1.JPG
    1.JPG
    9.3 KB · Views: 1,549
  • 2.JPG
    2.JPG
    18.3 KB · Views: 1,459
Physics news on Phys.org
  • #2
What you want to plot here is not the integrand nor the integral, what you want to plot is the limits of integration. I would use ParametricPlot3D or RegionPlot3D, but you will have to transform from spherical coordinates to Cartesian coordinates either way.
 
  • #3
Thank you DaleSpam, now I can draw integrals in rectangular coordinates, for example, the integral

RegionPlot3D[-2 < x < 2 && -\[Sqrt](4 - x^2) < y < \[Sqrt](4 - x^2) && x^2 + y^2 < z < 4, {x, -2, 2}, {y, -2, 2}, {z, 0, 5}, PlotPoints -> 50, Mesh -> True, AxesLabel -> Automatic]
will draw

attachment.php?attachmentid=20427&stc=1&d=1252238163.jpg


but for spherical coordinates, I found the sentence SphericalPlot3D, which for example with
SphericalPlot3D[{1}, {\[Phi], 0, Pi/4}, {\[Theta], 0, 2 Pi}]
will draw

attachment.php?attachmentid=20428&stc=1&d=1252238468.jpg


but I doesn't draw the cone underneath the sphere, my question is, is there a way to do that?

I thought something like saying to mathematica "draw me rho from 0 to 1 continuously ", and it would draw

attachment.php?attachmentid=20429&stc=1&d=1252238468.jpg


, but the cone being solid

thank you
 

Attachments

  • 1.JPG
    1.JPG
    22.4 KB · Views: 1,615
  • 3.JPG
    3.JPG
    20 KB · Views: 1,208
  • 2.JPG
    2.JPG
    18 KB · Views: 1,421
  • attachment.php?attachmentid=20427&stc=1&d=1252238163.jpg
    attachment.php?attachmentid=20427&stc=1&d=1252238163.jpg
    22.4 KB · Views: 518
  • attachment.php?attachmentid=20428&stc=1&d=1252238468.jpg
    attachment.php?attachmentid=20428&stc=1&d=1252238468.jpg
    18 KB · Views: 479
  • #4
I'd use region plot and just use spherical coordinates. Its slower, and requires tweaking due to the angles but :

r = Sqrt[x^2 + y^2 + z^2];
\[Phi] = ArcTan[y/Abs[x]];
\[Theta] = ArcCos[Abs[z]/Sqrt[x^2 + y^2 + z^2]];
RegionPlot3D[
0 < r <= 3 && 0 < Abs[\[Theta]] < \[Pi]/4, {x, -5, 5}, {y, -5,
5}, {z, 0, 5}, PlotPoints -> 60, Mesh -> True,
AxesLabel -> Automatic, PlotRange -> {{-3, 3}, {-3, 3}, {-1, 5}}]

http://en.wikipedia.org/wiki/Spherical_coordinatesSame for cylindrical. You just have to do a coordinate conversion back to cartesian.
 

1. How do I plot an integral with Mathematica?

To plot an integral with Mathematica, you can use the Plot function and specify the integral as the expression to be plotted. For example, Plot[Integrate[x^2, x], {x, 0, 5}] will plot the integral of x^2 from 0 to 5.

2. Can I plot multiple integrals on the same graph?

Yes, you can plot multiple integrals on the same graph by using the Plot function and specifying each integral as a separate expression. For example, Plot[{Integrate[x^2, x], Integrate[x, x]}, {x, 0, 5}] will plot the integrals of x^2 and x on the same graph from 0 to 5.

3. How can I change the limits of integration in my plot?

You can change the limits of integration in your plot by specifying the desired limits in the Plot function. For example, Plot[Integrate[x^2, x], {x, -5, 5}] will plot the integral of x^2 from -5 to 5.

4. Is it possible to add labels and titles to my integral plot?

Yes, you can add labels and titles to your integral plot by using the Plot function's PlotLabel and PlotLegends options. For example, Plot[Integrate[x^2, x], {x, 0, 5}, PlotLabel -> "Integral of x^2", PlotLegends -> "Integral"] will add a label and legend to your plot.

5. Can I customize the appearance of my integral plot?

Yes, you can customize the appearance of your integral plot by using the PlotStyle option in the Plot function. You can specify the desired color, style, and thickness for your plot. For example, Plot[Integrate[x^2, x], {x, 0, 5}, PlotStyle -> Red] will plot the integral of x^2 in red color.

Similar threads

  • Programming and Computer Science
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
29
Views
3K
Replies
12
Views
1K
  • STEM Academic Advising
Replies
13
Views
867
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • General Math
Replies
20
Views
2K
  • Calculus and Beyond Homework Help
Replies
9
Views
972
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Back
Top