Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Views: 87
Image: ubuntu2204
Kernel: SageMath 10.1

Parametric Equations

Overview of Chapter 11

  • new ways to define curves in the plane (on the yy-axis)

  • polar coordinates using rr and θ\theta (rcosθ,rsinθ)(r\cos \theta, r\sin \theta)

  • geometric definitions and standard equations of parabolas, ellipses, and hyerperbolas

Parametric Equations: expressing both xx and yy as functions of tt

If xx and yy are given as functions x=f(t),y=g(t)x=f(t),\qquad y=g(t) over an interval II of tt-values, then the set of points (x,y)=(f(t),g(t))(x,y)=(f(t),g(t)) defined by these equations is a parametric curve. The equations are parametric equations.

  • tt: parameter for the curve

  • II: parameter interval

  • If I=[a,b]I=[a,b]: (f(a),g(a))(f(a),g(a)) and (f(b),g(b))(f(b),g(b)) are the initial point and the terminal point of the curve.

Example:

x=t2, y=t+1x=t^2,~y=t+1 for tRt\in R

A given curve can be represented by different parametrizations. (x=t22t+1, y=tx=t^2-2t+1,~y=t for tRt\in R)

var('t') x = t^2 y = t+1 a = -10 b = 10 g = parametric_plot((x, y), (t, a, b), color = 'red', thickness = 5, legend_label = 'type I') x = (t-1)^2 y = t a = -9 b = 11 g += parametric_plot((x, y), (t, a, b), color = 'blue', thickness = 3, figsize = 10, legend_label = 'type II') g.show()
Image in a Jupyter notebook
# A circle with radius r var('t') r = 2 x = r*cos(t) y = r*sin(t) a = 0 b = 2*pi g = parametric_plot((x,y), (t, a, b), color = 'red', thickness = 5, legend_label = 'circle') g.show()
Image in a Jupyter notebook

Cycloids

A wheel of radius aa rolls along a horizontal straight line. Find parametric equations for the path traced by a point PP on the wheel's circumference. The path is call a cycloid.

The problem with a pendulum clock whose bob swings in a circular arc is that the frequency of the swing depends on the amplitude of the swing. The wider the swing, the longer it takes the bob to return to center (its lowest position).

  • This does not happen if the bob can be made to swing in a cycloid. In 1673, Christian Huygens designed a pendulum clock whose bob would swing in a cycloid.

# A circle with radius r var('t') r = 2 x = r*(t-sin(t)) y = r*(1-cos(t)) a = 0 b = 4*pi g = parametric_plot((x, y), (t, a, b), color = 'red', thickness = 5, legend_label = 'Cycloids') g.show()
Image in a Jupyter notebook
var('t') r = 2 x(t) = r*(t-sin(t)) y(t) = r*(1-cos(t)) p = point((0,0), xmin=-2, xmax=25, ymin=0, ymax=6) s = [p] n_max = 50 for n in [1..2*n_max]: p += parametric_plot((x(t),y(t)),(t,2*(n-1)*pi/n_max, 2*n*pi/n_max)) s += [p + circle((r*2*n*pi/n_max, r), r, color='red') + point((x(2*n*pi/n_max),y(2*n*pi/n_max)))] a = animate(s, figsize=5) show(a, delay=20)
WARNING: Some output was deleted.

There is a toy called the Spirograph that lets you draw interesting curves using a collection of wheels. We can produce these pictures using Sage.

Experiment with different values of aa and bb. If the curve looks incomplete, then increase tmax.

For example, try a=21, 1/2, 2a=21,~1/2,~\sqrt{2}

def Spirograph(a=5,b=2,tmax=10*pi): var('t') x(t)=(a-b)*cos(t)+b*cos((a-b)/b*t) y(t)=(a-b)*sin(t)-b*sin((a-b)/b*t) show(parametric_plot((x(t),y(t)),(t,0,tmax)))
Spirograph(21,2,10*pi)
Image in a Jupyter notebook

Tangents and Areas

A parameterized curve (x,y)=(f(t),g(t))(x,y)=(f(t),g(t)) is differentiable at tt if ff and gg are differentiable at tt. If at a point on a differentiable parameterized curve, yy is also a differentiable function of xx, then we have the Chain Rule: dydt=dydxdxdtdydx=dy/dtdx/dt{dy\over dt}={dy\over dx}\cdot{dx\over dt}\Rightarrow {dy\over dx}={dy/dt \over dx/dt}

d2ydx2=ddxdydx=ddtdydxdxdt{d^2y\over dx^2}={d\over dx}{dy\over dx}={{d\over dt}{dy\over dx}\over {dx\over dt}}\hspace{1cm}

Example

(x,y)=(sect,tant)(x,y)=(\sec t, \tan t) at the point (2,1)(\sqrt{2},1)

var('t') x(t) = sec(t) y(t) = tan(t) a = -0.4*pi b = 0.4*pi g = parametric_plot((x(t),y(t)),(t,a,b)) m(t)=diff(y)/diff(x) t1 = pi/4 var('X') g += point((x(t1), y(t1))) + plot(y(t1) + m(t1)*(X-x(t1)), xmin=0, xmax=3, color='red') g.show()
Image in a Jupyter notebook

Find the area enclosed by the asteroid with parameter tt. A=401y(x)dxA=4\int_0^1 y(x)dx

Since we have dx=x(t)dtdx = x'(t)dt, we need to find the integral region for tt.

var('t') x(t) = cos(t)^3 y(t) = sin(t)^3 a = 0 b = 2*pi g = parametric_plot((x(t),y(t)),(t, a, b)) g.show() area = 4*(y(t)*diff(x)).integral(t, pi/2, 0) print('The area is', area, 'which is approximately', N(area))
Image in a Jupyter notebook
The area is 3/8*pi which is approximately 1.17809724509617

Length of a Parametrically Defined Curve}

If a curve CC is defined parametrically by x=f(t)x=f(t) and y=g(t)y=g(t), atba\leq t\leq b, where ff' and gg' are continuous and not simultaneously zero on [a,b][a,b], and CC is traversed exactly once as tt increases from t=at=a to t=bt=b.

The length of the line segment from tt to t+dtt+dt is (x(t+dt)x(t))2+(y(t+dt)y(t))2(x(t))2+(y(t))2dt.\begin{align*}&\sqrt{(x(t+dt)-x(t))^2 +(y(t+dt)-y(t))^2}\approx & \sqrt{(x'(t))^2 +(y'(t))^2}dt\end{align*}.

Then the length of CC is the definite integral

L=ab[f(t)]2+[g(t)]2dt.L=\int_a^b\sqrt{[f'(t)]^2+[g'(t)]^2}dt.

Example

Find the length of (x,y)=(rcost,rsint)(x,y)=(r\cos t, r\sin t) for 0t2π0\leq t\leq 2\pi

var('t, r') x(t) = r*cos(t) y(t) = r*sin(t) a = 0 b = 2*pi n_end = 100 estimate = 0 dt = (b-a)/n_end for n in [1..n_end]: t1 = a+(n-1)*dt estimate += sqrt((x(t1)-x(t1+dt))^2+(y(t1)-y(t1+dt))^2) #print('The estimation of the area is ', estimate) true_length = sqrt(diff(x, t)^2 + diff(y, t)^2).integral(t, a, b) print('The true length is', true_length) r_value = 2 print('\nWhen r=', r_value, 'the estimation of the area is', N(estimate.subs(r=r_value))) true_length = sqrt(diff(x, t)^2 + diff(y, t)^2).integral(t, a, b) print('The true length is', N(true_length.subs(r=r_value)))
The true length is 2*pi*r When r= 2 the estimation of the area is 12.5643036312513 The true length is 12.5663706143592

Example

Find the perimeter of the ellipse x2a2+y2b2=1{x^2\over a^2}+{y^2\over b^2}=1.

We can have the parameterization x(t)=acos(t)x(t)=a\cos(t) and y(t)=bsin(t)y(t)=b\sin (t) for 0t2π0\leq t\leq 2\pi.

var('t, a, b') x(t) = a*cos(t) y(t) = b*sin(t) a = 0 b = 2*pi sqrt(diff(x, t)^2 + diff(y, t)^2).integral(t, a, b)
Warning: vanishing non integral power expansion
integrate(sqrt(b^2*cos(t)^2 + a^2*sin(t)^2), t, 0, 2*pi)

Find the centroid of the first quadrant arc

x=cos3t,y=sin3t,for t(0,π/2)x=\cos^3t,\quad y = \sin^3t,\quad \text{for } t\in (0,\pi/2)

We have ds=x(t)2+y(t)2dt=3sintcostdt=3sintcostdtds= \sqrt{x'(t)^2 + y'(t)^2} dt=3|\sin t\cos t|dt=3\sin t\cos tdt The xx coordinate of the centroid is 0π/2x(t)ds0π/21ds=0π/2cos3t×3sintcostdt0π/21dt{\int_0^{\pi/2} x(t) ds\over\int_0^{\pi/2} 1ds}={\int_0^{\pi/2} \cos^3 t \times 3\sin t\cos t dt\over\int_0^{\pi/2} 1dt}

reset() var('t') #t = np.linspace(0, np.pi/2, n_max) x(t) = cos(t)**3 y(t) = sin(t)**3 a = 0 b = pi/2 n_max = 10 g = parametric_plot((x(t),y(t)),(t, a, b)) cx = 0 cy = 0 total_weight = 0 dt = (b-a)/n_max for n in [1..n_max]: t1 = a + (n-1)*dt weight = sqrt((x(t1+dt)-x(t1))^2+(y(t1+dt)-y(t1))^2) total_weight += weight cx += (x(t1+dt)+x(t1))/2*weight cy += (y(t1+dt)+y(t1))/2*weight g += point([((x(t1+dt)+x(t1))/2,(y(t1+dt)+y(t1))/2)], size = weight*n_max*10, color='red') g.show() print('The centroid of the first quadrant arc is approximately (', N(cx/total_weight), ',', N(cy/total_weight),')') dsdt = sqrt(diff(x)^2 + diff(y)^2) cx2 = (x*dsdt).integral(t, a, b)/dsdt.integral(t, a, b) cy2 = (y*dsdt).integral(t, a, b)/dsdt.integral(t, a, b) print('The centroid of the first quadrant arc is approximately (',cx2, ',',cy2,')')
Image in a Jupyter notebook
The centroid of the first quadrant arc is approximately ( 0.401623452335337 , 0.401623452335337 ) The centroid of the first quadrant arc is approximately ( 2/5 , 2/5 )

Areas of Surfaces of Revolution

We can think about concentrating all the weight on to the graph in 2D. Note that the weight depends on the length of the circle.

Calculate the area of the surface of revolution swept out by this parametrized curve (cos(t), sin(t)+1)(\cos(t),~\sin(t)+1) for t(0,2π)t\in(0,2\pi).

reset() var('t') x(t) = cos(t) y(t) = sin(t)+1 a = 0 b = 2*pi g1 = revolution_plot3d((x(t), y(t)), (t,a,b), axis=(0,0), parallel_axis = 'x', show_curve=True, opacity=0.5) t1 = pi/4 dt = pi/10 g2 = revolution_plot3d((x(t), y(t)), (t,t1,t1+ dt), axis=(0,0), parallel_axis = 'x', show_curve=True, opacity=0.5, color = 'red') (g1+g2).show() dsdt = sqrt(diff(x)^2 + diff(y)^2) print('The area is ', integral(2*pi*y*dsdt, (t,a,b)))
Graphics3d Object
The area is 4*pi^2