Parametric Functions

How Mathematica can help us understand parametric functions. Highlighted sections are the most important. Notice that his used dynamic cells, so if you go back to look at earlier animations they will not work.

Built-in Command: ParametricPlot

x[t_]=Cos[t]
y[t_]=Sin[3t]
ParametricPlot[{x[t],y[t]},{t,0,2Pi}]

Parametric Plots: determining direction curve is traversed via table of values

A parametric function has a direction that the curve is travelled. You cannot see this from the ParametricPlot command, but if you construct a table of values and then do a ListPlot you can determine (using the table) the direction the curve is traversed.

x[t_]=Cos[t]
y[t_]=Sin[3t]
datapts=Table[{x[t],y[t]},{t,0,2Pi,0.1}];
TableForm[datapts]

ListPlot[datapts,PlotStyle->PointSize[0.02],AspectRatio->1]

Parametric Plots: determining direction curve is traversed via animation

You can animate the parametric function, making it very easy to determine the direction the curve is travelled.

Clear[plt]
x[t_]=Cos[t]
y[t_]=Sin[3t]
plt[end_]:=ParametricPlot[{x[t],y[t]},{t,0,end},PlotRange->{{-1,1},{-1,1}}]

num=50;
h = 2Pi/num;
Manipulate[plt[a],{a,h,2Pi,h}]

Parametric Plots: animation of a ball travelling along the curve

Often, you may want to show a particle (a ball) travelling along the curve. Here is how you can do that. If you click the little + next to the t you can open up the controls for the animation.

a=0;
b=2Pi;
x[t_]=Cos[t]
y[t_]=Sin[3t]
ball[t_]:=Graphics[{Red,Disk[{x[t],y[t]},0.02]}]

plt=ParametricPlot[{x[t],y[t]},{t,a,b},PlotRange->{{-1,1},{-1,1}}];

Manipulate[
Show[{plt,ball[t]}]
,{t,a,b,0.1}]

Two Important Parametric Functions: Circles and Ellipses

A circle (((x-h))^2)+(((y-k))^2)=(r^2) is given parametrically as:

x=h+r cos(c t)
y=k-r sin(c t), 0≤t≤ 2π/c      where c is a constant which determines how a particle would move around the circle.

Typically you choose c=1. You can show this is a circle by substituting the parametric expressions for x and y into  (((x-h))^2)+(((y-k))^2)=(r^2) and showing it is identically true (true for all x and y).

h=3;
k=-1;
r=2;
c=5
x[t_]=h+r Cos[c t]
y[t_]=k+r Sin[c t]

a=0;
b=2Pi;
ball[t_]:=Graphics[{Red,Disk[{x[t],y[t]},0.15]}]

plt=ParametricPlot[{x[t],y[t]},{t,a,b},PlotRange->{{-6,6},{-6,6}},PlotStyle->Thick];

Manipulate[
Show[{plt,ball[t]}]
,{t,a,b,0.1}]

Vary h,k,r in the above ans see that you always get a circle.

An ellipse is a generalization of the circle to ((((x-h))^2)/(a^2))+((((y-k))^2)/(b^2))=1 is given parametrically as:

x=h+a cos(c t)
y=k-b sin(c t), 0≤t≤ 2π/c      where c is a constant which determines how a particle would move around the circle.

Typically you choose c=1.

h=3;
k=-1;
a=2;
b=1
c=5
x[t_]=h+a Cos[c t]
y[t_]=k+b Sin[c t]


a=0;
b=2Pi;
ball[t_]:=Graphics[{Red,Disk[{x[t],y[t]},0.15]}]

plt=ParametricPlot[{x[t],y[t]},{t,a,b},PlotRange->{{-6,6},{-6,6}},PlotStyle->Thick];

Manipulate[
Show[{plt,ball[t]}]
,{t,a,b,0.1}]

There are other parametric representations of circles and ellipses, but these are the most common.

Built-in Command: Eliminate (used to get an implicit representation of the function)

Here is a complicated looking parametric function, which is convereted into an implicit function using the Eliminate command. Notice we just use x and y when eliminating the parameter t, not x[t_] and y[t_].

implicitfcn=Eliminate[{x==t^3+t^6,y==t^2+4},t]

Here is a plot of the parametric function. You can see it has something interesting happening at (0,4).

paraplot=ParametricPlot[{t^3+t^6,t^2+4},{t,-1,1},PlotStyle->{Thick,Blue}]

You can also plot the implicit function:

implicitplot=ContourPlot[Evaluate[implicitfcn],{x,-0.3,1},{y,4,5},ContourStyle->{Thick,Red}]

Show[paraplot,implicitplot]
Show[paraplot,implicitplot,PlotRange->{{-0.1,0.1},{4,4.2}}]

Notice the implicit plot is not nearly as accurate as the parametric plot near the point (0,4). Paramertic functions are generally better to plot than their associated implicit counterparts!

Beautiful Curves: Axes Surpressed in the Name Of Beauty

Here are some wonderful curves that show the powerful utility of parametric functions to represent exceedingly complicated curves. Imagine trying to split these apart into a bunch of explicit functions!

x[t_]=t+Sin[3t]
y[t_]=t+Sin[4t]
ParametricPlot[{x[t],y[t]},{t,-4Pi,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=Sin[t+Cos[50t]]
y[t_]=Cos[t+Sin[50t]]
ParametricPlot[{x[t],y[t]},{t,-2Pi,2Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=2Cos[t]+Sin[t+Cos[50t]]
y[t_]=2Sin[t]+Cos[t+Sin[50t]]
ParametricPlot[{x[t],y[t]},{t,0,2Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=t+Cos[3t]Sin[2t]
y[t_]=-Exp[-t^2]-Cos[Sin[t]]
ParametricPlot[{x[t],y[t]},{t,-2Pi,2Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=t-Exp[-t^2]+Sin[3t]
y[t_]=Exp[-t^2]-Sin[2t]
ParametricPlot[{x[t],y[t]},{t,-2Pi,2Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=t(Cos[t]+t Sin[t])
y[t_]=-8t Sin[2t]
ParametricPlot[{x[t],y[t]},{t,-4Pi,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=t(Cos[t]+t Sin[t])
y[t_]=-8t Sin[t]
ParametricPlot[{x[t],y[t]},{t,-4Pi,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

Beautiful Curves in Three Dimensions

You can even extend this to three dimensions. Click and drag the images to rotate them. This is mainly what I want you to see from Section 10.1 and 10.2, that the parametric representation extends very easily to higher dimensions.

x[t_]=t+Sin[3t]
y[t_]=t+Sin[4t]
z[t_]=Cos[t] 
ParametricPlot3D[{x[t],y[t],z[t]},{t,0,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=2Cos[t]+Sin[t+Cos[30t]]
y[t_]=2Sin[t]+Cos[t+Sin[30t]]
z[t_]=Cos[t]
ParametricPlot3D[{x[t],y[t],z[t]},{t,0,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

x[t_]=Sin[t+Cos[100t]]
y[t_]=Cos[t+Sin[100t]]
z[t_]=Cos[t]
ParametricPlot3D[{x[t],y[t],z[t]},{t,0,4Pi},PlotStyle->{Red,Thick},Axes->False,AspectRatio->1,PlotRange->{All,All}]

We can even easily animate the ball travelling along the curve. Notice my Disk has been replaced by a Sphere. You can speed up and slow down the animation--I find I need to slow it down to make it most instructional. Click on the little button beside the t to open up the controls. You should stop the animation before you rotate the picture, since rotating while animating doesn’t work very well.

x[t_]=Sin[t+Cos[10t]]
y[t_]=Cos[t+Sin[10t]]
z[t_]=Cos[t]
plt=ParametricPlot3D[{x[t],y[t],z[t]},{t,0,4Pi},PlotStyle->{Red,Thick},Axes->True,AspectRatio->1,PlotRange->{All,All}];

ball[t_]:=Graphics3D[{Blue,Sphere[{x[t],y[t],z[t]},0.1]}]

Manipulate[
Show[{plt,ball[t]},PlotRange->{{-1.2,1.2},{-1.2,1.2},{-1.2,1.2}}]
,{t,0,4Pi,0.01}]

Quite the roller coaster!

Calculus of Parametric Functions

We need first and second derivatives, and areas (integrals) for the parametric function given by

x(t)
y(t)
a<t<b

First Derivative

The slope of the tangent line at the point (x,y) on a parametric curve is still the derivative.

(dy/dx)=((((dy/dt)))/(((dx/dt)))) formula for first derivative

Second Derivative

We have to be careful when computing the second derivative.

(((d^2)y)/(dx^2))=(d/dx)((dy/dx)) now replace y by  (dy/dx) in the formula for the first derivative!
(((d^2)y)/(dx^2))=(((d/dt)((dy/dt)))/(((dx/dt)))) formula for second derivative

Area

The area under the curve from x=a to x=b is still given by the intergal:

(∫_a^b)ydx=(∫_alpha^beta)y((dx)/(dt))dt    where alpha is the t value associated with x=a, beta is associated with x=b.

You have to be careful that the area is being swept out only once for alpha < t < beta. You will probably need to use Mathematica to evaluate the integrals that come up when looking for areas, so this will not be on the final exam but could be on the webwork.

Arc length and surface area are covered in, you guessed it, Calculus II.

Example 1: Derivatives of parametric functions

Use a graph to estimate the left-most point on the curve given by x=(t^4)-(t^2), y=t+ln(t). Then use calculus to find the exact corrdinates.

First, define the paramteric function:

x[t_]=t^4-t^2
y[t_]=t+Log[t]

Now, get a plot:

ParametricPlot[{x[t],y[t]},{t,0,1},PlotStyle->Thick]

plt=ParametricPlot[{x[t],y[t]},{t,1/2,1},PlotStyle->Thick]

It looks like the left-most point is around (-0.25,0.4). To figure this out using calculus, we need the derivative (our graph shows that the derivative will be infiinte (vertical tangent) at the left-most point):

(dy/dx)=((dy/dt)/(dx/dt))=((y'(t))/(x'(t)))

You could work this out by hand, out use Mathematica to do it for you:

Simplify[y'[t]/x'[t]]

Setting the denominator equal to zero and solving for t will tell us for what values the derivative is infinite:

Solve[x'[t]==0,t]

The first two values are excluded, since the logarithm is not defined for t≤0. The left-most point is found by substituting in t=1/(Sqrt[2]):

x[1/Sqrt[2]]
y[1/Sqrt[2]]

If you want decimals (which would be nice to compare to our earlier guess):

x[1/Sqrt[2.]]
y[1/Sqrt[2.]]

Let’s put that point on the curve and see if it is correct.

ball:=Graphics[{Red,Disk[{x[1/Sqrt[2]],y[1/Sqrt[2]]},0.02]}]
Show[plt,ball]

Example 2: Derivatives of parametric functions

Find the slope of the curve at the point (1,1) if x=(e^t), y=(((t-1))^2).

First, define the paramteric function:

Clear[x,y]
x[t_]=Exp[t]
y[t_]=(t-1)^2

We need to get the dertivative:

Simplify[y'[t]/x'[t]]

Now, we need to solve for the value of the parameter t which gives us the point (1,1):

Solve[{x[t]==1,y[t]==1},t]

This tells us that at t=0 the curve is passing through the point (1,1), so we need to evaluate the derivative at t=0. Notice it is also telling us that it had trouble solving the system, and there may be other solutions. This is because the system of equations was nonlinear.

Simplify[y'[t]/x'[t]]/.t->0

The equation of the tangent line is

y-(Subscript[y, 0])=m(x-(Subscript[x, 0]))
y-1=-2(x-1)
y=-2x+3

Let's do a couple of plots to see if this makes sense to us:

plot1=ParametricPlot[{x[t],y[t]},{t,-2,2},PlotStyle->{Thick,Orange}]
plot2=Plot[-2x+3,{x,-2,2},PlotStyle->{Thick,Red}]
Show[plot1,plot2]

Looks good!

Example 3: Area with a parametric function

Find the area enclosed by the parametric function

x=a (cos^3)t
y=a (sin^3)t
0<t<2π

We can't sketch this in Mathematica unless we specify a value for a, so let's choose a=3 just to get a sketch:

Clear[a,x,y]
x[t_,a_]=a Cos[t]^3
y[t_,a_]=a Sin[t]^3
plot1=ParametricPlot[{x[t,3],y[t,3]},{t,0,2Pi},PlotStyle->{Thick,Orange}]

Pretty. OK, to get the area we need to integrate here is what we do. At t=0 we are at the point (a,0), and t=π puts us at (-a,0). Check this is correct by plotting the ball moving across the surface:

Clear[a,b,x,y,ball]
x[t_,a_]=a Cos[t]^3;
y[t_,a_]=a Sin[t]^3;
plot1=ParametricPlot[{x[t,3],y[t,3]},{t,0,Pi},PlotStyle->{Thick,Orange}];

ball[t_]:=Graphics[{Red,Disk[{x[t,3],y[t,3]},0.1]}]

Manipulate[
Show[{plot1,ball[t]}]
,{t,0,Pi,0.1}]

So our integration limits should run from t=π (start at x=-3) to t=0 (end at x=3).

The only thing that changes if we change a is the hieght of the y-intercept a, and the location of the x-intercepts, ±a.

Clear[a,x,y]
x[t_,a_]:=a Cos[t]^3
y[t_,a_]:=a Sin[t]^3
Manipulate[ParametricPlot[{x[t,a],y[t,a]},{t,0,Pi},PlotStyle->{Thick,Orange},PlotRange->{{-5,5},{0,5}}],{a,1,5,0.2}]

OK, so we can integrate from t=π to t=0 (which gives us from x=-a to x=a) and multiply by two to get the area.

2*Integrate[y[t,a]*D[x[t,a],t],{t,Pi,0}]

Note the integral would be impossible for us to do until we study more integration techniques in Calculus II:

integrand=Simplify[y[t,a]*D[x[t,a],t]]

2*Integrate[y[t,a]*D[x[t,a],t],t]