Application Center - Maplesoft

App Preview:

Four-Leave Rose

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

                                                                     Four - Leaved Rose 

 

           By: Ali Mohamed Abu Oam       asam295@hotmail.com 

 

     The puepose of this worksheet is to show the powerfull of  Algebra compuetr system ( CAS ) in modeling and calculating the area and the volume in case of the Four-Leave Rose.      

 

 The Traditional Method: 

The area of a loop of the four-leaved rose using double and single integrals ,the following equation in polar coordinates r = cos( 2theta) generates a graph called the four-leaved rose. We have seen that the area of the loop generated when theta goes over
   [`+`(`-`(`/`(`*`(Pi), `*`(4)))), `/`(`*`(Pi), `*`(4))]  is  `/`(`*`(Pi), `*`(8))

   The area of the loop is given by the double integral over the domain D expressed in polar coordinates as 

                  D = { ( r, theta ) | `<=`(`+`(`-`(`/`(`*`(Pi), `*`(4)))), theta)  , `<=`(theta, `/`(`*`(Pi), `*`(4))), `<=`(theta, r) , `<=`(r, cos(`*`(2, `*`(theta)))) }      

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                             

                             

                                                  

 

                                                           Plot_2d                                                                                                                                               

               So,     Int(Int(`*`(r, `*`(dr, `*`(d(theta)))), r = 0 .. cos(`*`(2, `*`(theta)))), theta = `+`(`-`(`/`(`*`(Pi), `*`(4)))) .. `/`(`*`(Pi), `*`(4)))  = int(`/`(`*`(`^`(cos, 2), `*`(d(theta))), `*`(2)), theta = `+`(`-`(`/`(`*`(Pi), `*`(4)))) .. `/`(`*`(Pi), `*`(4)))  = int(`/`(`*`(`+`(1, cos(`*`(4, `*`(theta)))), `*`(d(theta))), `*`(4)), theta = `+`(`-`(`/`(`*`(Pi), `*`(4)))) .. `/`(`*`(Pi), `*`(4)))  = `/`(`*`(Pi), `*`(8)) 

                                                                                                                                                                                                                                                                        

                Above, we used the trigonometric identity   `*`(`^`(cos, 2))(x) =1/2 ( `+`(1, cos(`*`(2, `*`(x))))) . Next, we try to estimate the area of the loop using a simple integral 

                    int(f(x), x = a .. b) .  

              Since the loop generated by theta belongs to the closed interval    [`+`(`-`(`/`(`*`(Pi), `*`(4)))), `/`(`*`(Pi), `*`(4))]   , is symmetric with respect to the x-axis, it follows that the area
we are interested in is twice the area of the graph given in the picture below ( under the red curve ) . 

  

        

Plot_2d                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

     To compute its area we need to nd an expression of  the variable y as a function of the variable x, y = f(x). Then to compute the are we could use   

                                                                                                                                                                                                                             

                 Area = int(`*`(y, `*`(d(x))), x = 0 .. 1)  =  int(f(x), x = 0 .. 1) .  Given that  r = `^`(`+`(`*`(`^`(x, 2)), `*`(`^`(y, 2))), `/`(1, `*`(2)))  ,    cos(theta) = `/`(`*`(x), `*`(r))  ,   sin(theta) = `/`(`*`(y), `*`(r)) . from the equation of the loop in polar coordinates 

      r = cos(`*`(2, `*`(theta))) = `*`(`^`(cos, 2))( theta ) `+`(`-`(`*`(`^`(sin, 2))))( theta ) , we have  `^`(`+`(`*`(`^`(x, 2)), `*`(`^`(y, 2))), `/`(`*`(3), `*`(2))) = `+`(`*`(`^`(x, 2)), `-`(`*`(`^`(y, 2))))  .  

                 To find a formula for f(x) we would have to solve the above equation for y in terms of x, and this is rather complicated, but there is still a way to use just a single integral for computing the desired area.  

                   The four-leaved rose can be viewed as a particular hypocycloid  with equations: 

              x = `+`(`/`(`*`(cos(`/`(`*`(t), `*`(4)))), `*`(2)), `/`(`*`(cos(`/`(`*`(3, `*`(t)), `*`(4)))), `*`(2)))  ,   y =   `+`(`/`(`*`(sin(`/`(`*`(t), `*`(4)))), `*`(2)), `-`(`/`(`*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))), `*`(2))))    ................................................................................  ( 0 , 1 ) 

         with  `<=`(`+`(`-`(`*`(4, `*`(Pi)))), t)  ,  `<=`(t, `*`(4, `*`(Pi))) ,  for   `<=`(`+`(`-`(Pi)), t)  , `<=`(t, Pi) ,                                                                                                                                                                                                              

                  we obtain the loop for which we want to compute the area, and to get just the upper half of that loop we let t belong to [Pi,0] Note that in the above equations we have dependence of just one parameter t. The point (x; y) = (0; 0) corresponds to the value of the parameter t = `+`(`-`(Pi)) , and the point (x; y) = (1; 0) corresponds to t = 0. The area of half of the loop is still given by the integral int(f(x), x = 0 .. 1), but now in order to estimate it, we can use the change of variables : 

                                                                                                                            x =   `+`(`/`(`*`(cos(`/`(`*`(t), `*`(4)))), `*`(2)), `/`(`*`(cos(`/`(`*`(3, `*`(t)), `*`(4)))), `*`(2))) ,                                                                                                                                        

                                                                                                                                                                                                                                                                                                                                                      

   which gives us an expression for y in terms of t, from equation (0.1) and also   dx  = `+`(`-`(`/`(1, `*`(8)))) ( `+`(sin(`/`(`*`(t), `*`(4))), `*`(3, `*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))))) ) dt .                                                                                                                                                                                                                                                                                                                                                                           

                  The area is then :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

         Int(y, x = 0 .. 1)  = Int(`+`(`/`(`*`(sin(`/`(`*`(t), `*`(4)))), `*`(2)), `-`(`/`(`*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))), `*`(2)))), t = `+`(`-`(pi)) .. 0) . (  `+`(`-`(`/`(1, `*`(8)))) ( `+`(sin(`/`(`*`(t), `*`(4))), `*`(3, `*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))))) ) dt ) = `+`(`-`(`/`(1, `*`(16)))) Int(`+`(`*`(`^`(sin(`/`(`*`(t), `*`(4))), 2)), `*`(2, `*`(sin(`/`(`*`(t), `*`(4))), `*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))))), `-`(`*`(3, `*`(`*`(`^`(sin(`/`(`*`(3, `*`(t)), `*`(4))), 2)))))), t = `+`(`...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

           If you don't just want to give up here, the half angle formula helps us with the rst and the third terms in the sum under the integral.                                                                                                                                                                                                                                         

           Int(`*`(`^`(sin(`/`(`*`(t), `*`(4))), 2)), t = `+`(`-`(Pi)) .. 0) = Int(`+`(`/`(1, `*`(2)), `-`(`/`(`*`(cos(`/`(`*`(t), `*`(2)))), `*`(2)))), t = `+`(`-`(Pi)) .. 0) = `+`(`/`(`*`(t), `*`(2)), `-`(sin(`/`(`*`(t), `*`(2))))) | -Pi..0 = `+`(`/`(`*`(Pi), `*`(2)), sin(`+`(`-`(`/`(`*`(Pi), `*`(2)))))) = `+`(`/`(`*`(Pi), `*`(2)), `-`(1)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

           Int(`*`(3, `*`(`*`(`^`(sin(`/`(`*`(3, `*`(t)), `*`(4))), 2)))), t = `+`(`-`(Pi)) .. 0) = Int(`+`(`/`(`*`(3), `*`(2)), `-`(`/`(`*`(3, `*`(cos(`/`(`*`(3, `*`(t)), `*`(2))))), `*`(2)))), t = `+`(`-`(Pi)) .. 0)  = `+`(`/`(`*`(3, `*`(t)), `*`(2)), `-`(sin(`/`(`*`(3, `*`(t)), `*`(2))))) | -Pi..0 = `+`(`/`(`*`(3, `*`(Pi)), `*`(2)), sin(`/`(`*`(3, `*`(Pi)), `*`(2)))) = `+`(`/`(`*`(3, `*`(Pi)), `*`(2)), 1).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

                                                                                                                                                                                                                                                     

         Next, we use the following trigonometric identity :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

                             `*`(sin(x), `*`(sin(y))) = `+`(`/`(`*`(sin(`+`(x, `-`(y)))), `*`(2)), `-`(`/`(`*`(cos(`+`(x, y))), `*`(2))))                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                               

            to evaluate the remaining term : 

                            Int(`*`(2, `*`(sin(`/`(`*`(t), `*`(4))), `*`(sin(`/`(`*`(3, `*`(t)), `*`(4)))))), t = `+`(`-`(Pi)) .. 0)  = Int(`+`(cos(`/`(`*`(t), `*`(2))), `-`(cos(t))), t = `+`(`-`(Pi)) .. 0)  = `+`(`*`(2, `*`(sin(`/`(`*`(t), `*`(2))))), `-`(sin(t)))|-Pi..0 = `+`(`-`(`*`(2, `*`(sin(`+`(`-`(`/`(`*`(Pi), `*`(2))))))))) = 2 .                                              

                                                                                                                                                                                                                                                 

                           Now putting all the terms together, we obtain that the area of half of the loop is :                                                                                                                                                                                                                     

                                                                                                                                                                                                                                

                                                                                                                     `+`(`-`(`/`(1, `*`(16)))) ( `/`(`*`(Pi), `*`(2)) - 1 + 2 - ( `+`(`/`(`*`(3, `*`(Pi)), `*`(2)), 1) )) = `/`(`*`(Pi), `*`(16))  .                                                                                                                                                                                                                                                                                                                                                                                                              

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

          Maple Code :                                                                                                                                                                                                                                          

                                                                                                                                                                                                                                                       

                               Now we will model and solve a similar problem using maple, and to caculate the area and the volume. The procedure followed by some animations pointed to the mentioned area or a volume .                                                                                                                                                                                                                     

                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                 

                                                                  

> restart:with(plots):
r:=5:
Ray:=r*cos(2*theta):sequences:=32:ft:=unapply(Ray,theta):
color=color_list:labelling=label_type:view=view_range:
PP1:=coordplot(polar,[0..6,0..Pi],view=[-6..6,0..6],color=[navy,blue],labelling=front):
PP2:=coordplot(polar,[0..6,Pi..2*Pi],view=[-6..6,-6..0],color=[navy,blue],labelling=front):
CP:=animatecurve([Ray,theta,theta=0..2*Pi],coords=polar,color=magenta,thickness=3,frames=sequences):
display(PP1,PP2,CP,scaling=constrained,numpoints=1000,title="Animation : curve in polar coord.",titlefont=[COURIER,BOLD,14]);
 

Warning, the name changecoords has been redefined
 
 

Plot_2d  
 

>  
 

 

> thrPol:=solve(Ray,theta);
 

`assign`(thrPol, `+`(`/`(`*`(Pi), `*`(4)))) (1)
 

>  
 

 

> with(plottools):
LonPar:=polarplot(Ray,theta=0..Pi/4,color=magenta,thickness=2):
AxeP:=plot([[-1,0,0],[6,0,0]],color=black):
rhoSup:=plot([[0,0],[ft(Pi/6)*cos(Pi/6),ft(Pi/6)*sin(Pi/6)]],color=black):
rhoInf:=plot([[0,0],[ft(Pi/8)*cos(Pi/8),ft(Pi/8)*sin(Pi/8)]],color=black):
cTriang:=plot([[ft(Pi/6)*cos(Pi/6),ft(Pi/6)*sin(Pi/6)],[2.4,1.0]],color=black):
Rho:=textplot([2.1,0.8,` r`],align=RIGHT,
font=[SYMBOL,12]):
dAng:=textplot([1.45,0.75,` dq`],font=[SYMBOL,12]):
Ar:=arrow([2.75,1.75],[2.75,1.45],.005,.07,.1):
elLarc:=textplot([2.75,2,` ds`]):
PolAX:=plot([[-1,0],[6,0]],color=black):
display(LonPar,AxeP,rhoSup,rhoInf,cTriang,Rho,dAng,Ar,elLarc,PolAX,scaling=constrained,axes=none,
title=`1/8  of the curve`,titlefont=[COURIER,BOLD,14],view=[-1..6,0..2]);
ds:=(sqrt(rho^2+(d(rho)/d(theta))^2))*d(theta);
dl:=sqrt(rho^2+(d(rho)/d(theta))^2):
der:=diff(Ray,theta):
ArcLen:=8*Int(dl,theta=0..Pi/4)=evalf(8*int(sqrt(Ray^2+der^2),theta=0..Pi/4),5)*` units`;
 

Warning, the name arrow has been redefined
 
 

Warning, unable to evaluate the functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
 
 

Plot_2d  
 

`assign`(ds, `*`(`^`(`+`(`*`(`^`(rho, 2)), `/`(`*`(`^`(d(rho), 2)), `*`(`^`(d(theta), 2)))), `/`(1, 2)), `*`(d(theta))))  
 

`assign`(ArcLen, `+`(`*`(8, `*`(Int(`*`(`^`(`+`(`*`(`^`(rho, 2)), `/`(`*`(`^`(d(rho), 2)), `*`(`^`(d(theta), 2)))), `/`(1, 2))), theta = 0 .. `+`(`/`(`*`(Pi), `*`(4))))))) = `+`(`*`(48.440, `*`(` unit...  
 

>  
 

>  
 

> CCP:=polarplot(Ray,theta=0..2*Pi,color=blue,thickness=2):
Lpetal:=plot([[0,0],[ft(3*Pi/48)*cos(4*Pi/48),ft(3*Pi/48)*sin(2*Pi/48)],[r,0],[0,0]],filled=true,color=gray):
Fpetal:=polarplot(Ray,theta=0..2*Pi/48,filled=true,color=grey):
TrSup:=plot([[0,0],[ft(5*Pi/48)*cos(5*Pi/48),ft(5*Pi/48)*sin(5*Pi/48)]],color=black,thickness=2):
TrInf:=plot([[0,0],[ft(3*Pi/48)*cos(3*Pi/48),ft(3*Pi/48)*sin(3*Pi/48)]],color=black,thickness=2):
polAxe:=plot([[-6,0],[6,0]],color=black):

display({CCP,Lpetal,Fpetal,TrSup,TrInf,polAxe},insequence=true,scaling=constrained,axes=none,title=`Area swept out (Animation)`,titlefont=[COURIER,BOLD,14]);
dA:=(1/2)*Ray^2*d(theta);
AreaPol:=8*Int((1/2)*Ray^2,theta=0..Pi/4)=8*int((1/2)*Ray^2,theta=0..Pi/4)*`square units`;
 

Plot_2d  
 

`assign`(dA, `+`(`*`(`/`(25, 2), `*`(`*`(`^`(cos(`+`(`*`(2, `*`(theta)))), 2), `*`(d(theta)))))))  
 

`assign`(AreaPol, `+`(`*`(8, `*`(Int(`+`(`*`(`/`(25, 2), `*`(`*`(`^`(cos(`+`(`*`(2, `*`(theta)))), 2))))), theta = 0 .. `+`(`/`(`*`(Pi), `*`(4))))))) = `+`(`/`(`*`(25, `*`(Pi, `*`(`square units`))), `...  
 

 

>  
 

 

> restart: with(plots):
r:=5:Ray:=r*cos(2*theta):
Image:=1:#area in Cartesian coordinates.
param1:=filled=true,color=magenta:
param2:=filled=true,color=cyan:
lstRect:=NULL:
for m from 1 to 32
do
CcP:=polarplot(Ray,theta=0..2*Pi,color=blue,thickness=2):
if irem(m,2)=0
   then
       param:=param1
   else
       param:=param2
fi:
rectangle:=polarplot(Ray,theta=(m-1)*Pi/128..m*Pi/128,param):
lstRect:=lstRect,rectangle:
gr||Image:=display(CcP,lstRect,scaling=constrained):Image:=Image+1:
od:
display(gr||(1..Image-1),insequence=true,scaling=constrained,title=`Area filled up with rect.(Animation)`,titlefont=[COURIER,BOLD,10]);
cx:=Ray*cos(theta):
cy:=Ray*sin(theta):
dx:=diff(cx,theta):
dA:=cy*dx*d(theta);
AreaCart:=8*Int(cy*dx,theta=Pi/4..0)=8*int(cy*dx,theta=Pi/4..0);
 

Warning, the name changecoords has been redefined
 
 

Plot_2d  
 

`assign`(dA, `+`(`*`(5, `*`(cos(`+`(`*`(2, `*`(theta)))), `*`(sin(theta), `*`(`+`(`-`(`*`(10, `*`(sin(`+`(`*`(2, `*`(theta)))), `*`(cos(theta))))), `-`(`*`(5, `*`(cos(`+`(`*`(2, `*`(theta)))), `*`(sin...  
 

`assign`(AreaCart, `+`(`*`(8, `*`(Int(`+`(`*`(5, `*`(cos(`+`(`*`(2, `*`(theta)))), `*`(sin(theta), `*`(`+`(`-`(`*`(10, `*`(sin(`+`(`*`(2, `*`(theta)))), `*`(cos(theta))))), `-`(`*`(5, `*`(cos(`+`(`*`(...  
 

Animation : boundary of the solid of r?volution : 

> restart:with(plots):
Ray:=5*cos(2*theta):ft:=unapply(Ray,theta):
C3d:=seq(plot3d([Ray*cos(theta),Ray*sin(theta)*sin(phi),Ray*cos(phi)*sin(theta)],theta=0..Pi,phi=0..n*Pi/12,numpoints=2000,color=cyan),n=1..25):
display(C3d,scaling=constrained,view=[-5..5,-5..5,-5..5],orientation=[80,90],insequence=true,title=` rotation of the 2D curve (animation)`,titlefont=[COURIER,BOLD,10]);
 

Warning, the name changecoords has been redefined
 
 

Plot_2d  
 

 

Evaluation of the volume by disks and by cylindrical shells : 

 

> RotC:=polarplot(Ray,theta=0..Pi,color=blue,thickness=2):
pordisq:=polarplot(Ray,theta=0..Pi/4,filled=true,color=gray):
portub:=polarplot(Ray,theta=Pi/4..Pi/2,filled=true,color=gray):
portube:=polarplot(Ray,theta=Pi/4..3*Pi/8,filled=true,color=white):
disq:=plot([[ft(Pi/6)*cos(Pi/6),ft(Pi/6)*sin(Pi/6)],[ft(Pi/6)*cos(Pi/6),0]],color=black,thickness=4):
tub:=plot([[ft(3*Pi/8)*cos(3*Pi/8),ft(3*Pi/8)*sin(3*Pi/8)],[0,ft(3*Pi/8)*sin(3*Pi/8)]],color=black,thickness=4):
Rtub:=plot([[-.75,0],[-.75,ft(3*Pi/8)*sin(3*Pi/8)]],color=black):
PolAx:=plot([[-7,0],[7,0]],color=black):
display(RotC,pordisq,portube,portub,disq,tub,Rtub,PolAx,scaling=constrained,view=[-7..7,-7..7],axes=none);
deriv1:=diff(Ray*cos(theta),theta):
dv1:=Pi*((Ray*sin(theta))^2)*deriv1:
v1:=evalf(int(dv1,theta=Pi/4..0),5):V1:=2*v1:
deriv2:=diff(Ray*sin(theta),theta):
dv2:=2*Pi*(Ray*cos(theta)*Ray*sin(theta)*deriv2):
v2:=evalf(int(dv2,theta=3*Pi/2..7*Pi/4),5):V2:=2*v2:
Volume:=(V1+V2)*`  cubic units`;
 

Plot_2d  
 

`assign`(Volume, `+`(`*`(203.870, `*`(`  cubic units`))))  
 

The end .