math-157-volumes

1753 days ago by basyrova

First we define the two functions:

f(x)=x^2 + 15/x; g(x)=20*sqrt(x); 
       

Then we make a graph of y=f(x) and y=g(x).

Sage can even fill the region between the two graphs of functions for us.

The graph of y=f(x) will be blue, the graph of y=g(x) will be red, and the fill color is green.

To change the graphing window you can change the xmin and xmax values in the first two lines.

xmin=0; xmax=20; plot_f = plot(f(x),(x,xmin,xmax),color='blue'); plot_g = plot(g(x),(x,xmin,xmax),color='red',fill=f(x),fillcolor='green'); show(plot_f + plot_g); 
       

Now we would like to find the points of intersection.

solve( f(x) == g(x), x); 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{1}{2} \, {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)} {\left(i \, \sqrt{3} - 1\right)}, x = \frac{1}{2} \, {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)} {\left(-i \, \sqrt{3} - 1\right)}, x = {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)}\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{1}{2} \, {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)} {\left(i \, \sqrt{3} - 1\right)}, x = \frac{1}{2} \, {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)} {\left(-i \, \sqrt{3} - 1\right)}, x = {\left(20 \, x^{\left(\frac{3}{2}\right)} - 15\right)}^{\left(\frac{1}{3}\right)}\right]

Note that the above answer is really helpful as the computer tries to find the exact solutions.

In this case we can square both sides of the equation, and ask the computer to solve the modified version:

solve( (x^2 + 15/x)^2 == 20^2*x, x); 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{1}{2} i \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = -\frac{1}{2} i \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = \frac{1}{2} i \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = -\frac{1}{2} i \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}\right]
\newcommand{\Bold}[1]{\mathbf{#1}}\left[x = \frac{1}{2} i \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = -\frac{1}{2} i \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = {\left(20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = \frac{1}{2} i \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = -\frac{1}{2} i \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)} \sqrt{3} - \frac{1}{2} \, {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}, x = {\left(-20 \, \sqrt{85} + 185\right)}^{\left(\frac{1}{3}\right)}\right]

As you can see, we have about 6 solutions above, some of them complex, some of them real, but the expressions above are not really helpful.

If we are ready to settle for approximate decimals for the points of intersection, we can use the find_root function:

print find_root( f(x) == g(x), 0, 10); 
       
7.17511269287
7.17511269287

The find_root function takes in the equation, and the x-interval where to look for a solution.

Since we see two points of intersection on the graph, we can give the computer a hint where to look for the solutions:

print find_root( f(x)==g(x), 0, 2); print find_root( f(x)==g(x), 6, 8); 
       
0.847680343978
7.17511269287
0.847680343978
7.17511269287

Once we know the approximate points of intersection, we can start doing integration.

For an easy calculation, we can find the area between the two curves:

integral( g(x) - f(x), (x, 0.847680343978, 7.17511269287) ); 
       
\newcommand{\Bold}[1]{\mathbf{#1}}90.8892074062
\newcommand{\Bold}[1]{\mathbf{#1}}90.8892074062

In most volume calculations you would need the value of 'pi', which could be used as shown below:

integral( pi*( (g(x))^2 - (f(x))^2), (x, 0.847680343978, 7.17511269287)); 
       
\newcommand{\Bold}[1]{\mathbf{#1}}5353.88228001 \, \pi
\newcommand{\Bold}[1]{\mathbf{#1}}5353.88228001 \, \pi

To get a decimal approximation to the answer, we can add the .n() at the end of the 'integral' command:

integral( pi*( (g(x))^2 - (f(x))^2), (x, 0.847680343978, 7.17511269287)).n(); 
       
\newcommand{\Bold}[1]{\mathbf{#1}}16819.7172390732
\newcommand{\Bold}[1]{\mathbf{#1}}16819.7172390732