Parametric Curves

Question

At what point does the curve x=1-2 (cos^2)t, y=tan t (1-2 (cos^2)t) cross itself? Find the equations of both tangents at this point.

Solution 1 (shorter, but has "hole" in it--do we really know the crossing occurs precisely at the origin? We do by the time we are done, but we didn't when we make that assumption)

We need to define the parametric function to be able to work with it in Mathematica:

x[t_]=1-2Cos[t]^2
y[t_]=Tan[t]*x[t]

OK, now we need to start thinking about how to answer this question. We will want the slope of the tangent line(s), so let's get that:

slope[t_]=y'[t]/x'[t]

Ouch, that looks nasty! What's important to notice is that the slope is a function of t, so we will want to figure out the t values for which the curve crosses itself. Let's plot the function and see what it looks like:

parametric=ParametricPlot[{x[t],y[t]},{t,-Pi,Pi},PlotRange->{{-1,1},{-1,1}},AxesLabel->{"x","y"}]

So the curve does cross itself at one point, although it looks like it crosses that point for a variety of t values. Just for kicks, lets plot the function for a larger range of t:

ParametricPlot[{x[t],y[t]},{t,-100Pi,100Pi},PlotRange->{{-1,1},{-1,1}},AxesLabel->{"x","y"}]

Cool! So the function is tracing over itself a bunch of times--remember, the mess above tells us that Mathematica was not using enough points to construct an accurate plot of the function. We saw the same thing in class with the unit circle.

OK, so now we need to figure out what values of t give the intersection point. The function looks like it crosses itself at the origin, so we must have

eq1=x[t]==y[t]

Solve[eq1,t]

Now we can get the equation of the tangent lines:

m[t_]=y'[t]/x'[t]
t2=3Pi/4
m[t2]
x[t2]
y[t2]

So one tangent line has equation:

y-(Subscript[y, 0])=m(x-(Subscript[x, 0]))
y-y0=-1(x-0)
y=-x

m[t_]=y'[t]/x'[t]
t2=-3Pi/4
m[t2]
x[t2]
y[t2]

The other tangent line has equation:

y-(Subscript[y, 0])=m(x-(Subscript[x, 0]))
y-y0=1(x-0)
y=x

tangents=Plot[{x,-x},{x,-1,1},PlotStyle->{Red}]

Show[parametric,tangents]

And it looks very good.

Solution 2 (longer, but no mathematical holes in the solution)

We need to define the parametric function to be able to work with it in Mathematica:

x[t_]=1-2Cos[t]^2
y[t_]=Tan[t]*x[t]

OK, now we need to start thinking about how to answer this question. We will want the slope of the tangent line(s), so let's get that:

slope[t_]=y'[t]/x'[t]

Ouch, that looks nasty! What's important to notice is that the slope is a function of t, so we will want to figure out the t values for which the curve crosses itself. Let's plot the function and see what it looks like:

parametric=ParametricPlot[{x[t],y[t]},{t,-Pi,Pi},PlotRange->{{-1,1},{-1,1}},AxesLabel->{"x","y"}]

So the curve does cross itself at one point, although it looks like it crosses that point for a variety of t values.

OK, so now we need to figure out what values of t give the intersection point. For these values of t, we must have the same x coordinate and the same y coordinate. This means we have the following equations which must be satisfied:

eq1=x[t1]==x[t2]
eq2=y[t1]==y[t2]

Solve[{eq1,eq2},{t1,t2}]

This gives us a relationship between the different t values--but it still doesn't give us a numerical value of t for which the intersection occurs. Let's plug the results back into the equations to see if we can determine a numerical value for t (notice that t1=t2=t from above):

eq1 /. t1->-ArcCos[-Cos[t2]]

That didn't help. Keep trying:

eq2 /. t1->-ArcCos[-Cos[t2]]

Bingo! Now we have a single equation in t that we can solve to get a numerical value for the t where the curve interects itself.

eq3=eq2 /. t1->-ArcCos[-Cos[t2]]

Solve[eq3,t2]

Rats. Try something else:

NSolve[eq3,t2]

OK, we know our mathematical analysis is correct, but Mathematica seems unable to solve the equation. Notice the equation can be simplified, using (Sqrt[1-((Cos[t2])^2)])=Sin[t2]:

NSolve[(1-2 ((Cos[t2])^2)) Sin[t2] Sec[t2]==(1-2 ((Cos[t2])^2)) Tan[t2],t2]

Rats, what next? Well, we have another solution for t1 from above (differs by a minus sign), maybe that will work:

eq1 /. t1->ArcCos[-Cos[t2]]

eq2 /. t1->ArcCos[-Cos[t2]]

Solve[-(1-2 ((Cos[t2])^2)) Sin[t2] Sec[t2]==(1-2 ((Cos[t2])^2)) Tan[t2],t2]

Finally! Numbers! we rock. Now we can get the equation of the tangent lines:

m[t_]=y'[t]/x'[t]
t2=0
m[t2]
x[t2]
y[t2]

Notice that this point isn't the one at the origin. So pick another t and try again:

m[t_]=y'[t]/x'[t]
t2=3Pi/4
m[t2]
x[t2]
y[t2]

So one tangent line has equation:

y-(Subscript[y, 0])=m(x-(Subscript[x, 0]))
y-y0=-1(x-0)
y=-x

m[t_]=y'[t]/x'[t]
t2=-3Pi/4
m[t2]
x[t2]
y[t2]

The other tangent line has equation:

y-(Subscript[y, 0])=m(x-(Subscript[x, 0]))
y-y0=1(x-0)
y=x

tangents=Plot[{x,-x},{x,-1,1},PlotStyle->{Red}]

Show[parametric,tangents]

And it looks very good.