# Horizontal tangent to wolfram alpha's heart-shaped graph

1. Dec 30, 2015

On http://mathworld.wolfram.com/HeartCurve.html, the nicest heart-shaped curve is given by
x=16sin3t
y = 13 cos t-5 cos(2t) -2 cos (3t) - cos(4t)
There are evidently two values of t, one in the first, one in the second quadrant, where you can get a horizontal tangent to this shape. Asking Wolfram alpha to solve dy/dt= -13 sin t+10 sin(2t) +6 sin(3t) +4 sin(4t)=0 (because I want dy/dx = (dy/dt)/(dx/dt)=0)), I get
http://www.wolframalpha.com/input/?i=-13*sin+x++10*sin(2x)++6*sin+(3x)+++4*sin(4x)+=0+
and weeding out other inflection points, there appears a graph with a reasonable solution of t= 0.908 for the first quadrant, but
(a) the symmetrical solution of 2π - 0.908 is missing on the graph
(b) in the listing of the numerical solutions, except for t=0, only complex non-real solutions are given. I have two objections to this: one, there are obviously real solutions, since there are the two tangents. Two, usually Wolfram alpha, when there is a nonzero imaginary part to a solution, puts the imaginary part in a different color on the graph, something they did not do here.
Then, worse, when I want the vertical tangents by setting dx/dt=0, I get only the points at n*π/2, which is obviously not right (as a glance of the curve will show).
What am I doing wrong here? thanks in advance
PS Believe it or not, this is not a homework question. (What heartless teacher would give a heart to differentiate?) But if the mentors think that it is too textbooky style, I have no objections to moving it.

Last edited: Dec 30, 2015
2. Dec 30, 2015

### BvU

Nice figure.

I see ${dy\over dt}=0$ for 0.908 and for -0.908. If you continue the root plot beyond $t=\pi$ it will also show 0 at $2\pi - 0.908$ .

And ${dx\over dt}=0$ for $t = {\pi\over 2}$, when x = 16, as expected.

Alpha comes up with the +/- 0.908 if you click 'more roots' .
Don't know for sure what's with the complex roots.

The root plot is perfect.

Perhaps you want to look at the x(t) and y(t) plots too.

3. Dec 30, 2015

Thanks for the reply, BvU. First, I apologize for the typo, as I wished to say that I was puzzled by the lack of t= π-0.908 . (I was not wondering about 2π-0.908, aka t=-0.908.) The reason that I expect π-0.908 is that, if you look at the drawing of the heart, and draw a horizontal tangent on top of the heart, it will intersect the left lobe in a symmetric fashion to where it will intersect the right lobe. (0.908 Radians would be t for the right lobe, taking t as the angle.)

The fact that dx/dt=0 gives t∈{0, π/2, π , 3π/2} is not so surprising from the formal mathematics, but from the picture. First, if you draw the two outside vertical tangents on the plot, they clearly do not intersect the x-axis. (It looks more as if t ≈ 2/3 Radian and t≈9/4 Radians, at a rough guess.) Secondly, and here I am on much shakier grounds, it doesn't look as if the curve is differentiable at at π/2 and 3π/2: since this is not a function, in order for it to be differentiable at those points, it would have to be split into two functions, but then those points are endpoints, at which the functions would not be differentiable.

4. Dec 30, 2015

### BvU

It seems you think $\tan t = {y\over x}$ ?

Vertical tangents DO intersect the x-axis ! at x = +/- 16 !

A horizontal tangent doesn't intersect the left lobe ?

5. Dec 30, 2015

### BvU

The curve is not a function y = f(x). dy/dx doesn't work in places where dx/dt = 0, such as t ∈ {0, π/2, π , 3π/2}.
But in between those you can consider the sections of the curve as functions.

That would be "dissecting the heart", though

!

6. Dec 30, 2015

Ah, sloppy phrasing on my part. I meant that the vertical tangents do not intersect the heart at y=0 in the plot.

No, I do not consider tan t = y/x, but dy/dx.
Yes, of course a horizontal tangent intersects both lobes. That is why, if the right lobe intersects the tangent at 0.908, the left one should do so at its supplement.

As far as the differentiability: would you consider the y-axis a vertical tangent? It goes against the grain, but if you consider this the union of two curves (and allow tangents at endpoints), then perhaps....

7. Dec 30, 2015

### BvU

Intersecting is crossing. I think you mean "touches"
And it does touch at its supplement ! Not in terms of $t_1 + t_2 = \pi$ but in terms of atan2(y1, x1) + atan2(y2, x2) = $\pi$ ! (That's why I thought you mixed up t and atan(y/x))

8. Dec 30, 2015

### BvU

You'd have to look at $$\lim_{h\downarrow 0}\ { y(h)-y(0)\over h }$$ with y expressed as a function of x to get the right-derivative. With h as $sin^3 t$ and y as $at^2$ (I think a = -20.5) that indeed goes to infinity !
(Again: you could look at the x(t) and y(t) plots too )

I leave that exercise at $t=\pi/2$ to you

9. Dec 30, 2015

Ah, I think we are getting to the crux of my confusion. My idea was that, as I am looking for the tangents to the heart, I am looking for dy/dx=0, which occurs at the same values of t as the ones at which dy/dt = 0 (since, when dx/dt≠0, dy/dx= (dy/dt)/(dx/dt)). I am identifying t with the angle formed between the origin of the x-y coordinate plane and the point (x(t), y(t)) on the graph of the heart, so that I am not sure why I cannot let t=arctan(y/x). This is, you say, wrong. I would be immensely grateful if you could explain why.
For the vertical tangents, instead of looking at dy/dx going to infinity, I was looking at dx/dy =0 (and so dx/dt=0). Is that not valid?

10. Dec 30, 2015

### BvU

As they say: one counter-example is enough: take t = 0 $\Rightarrow$ (x(t), y(t)) = (0, 5), whereas atan2(y,x) = $\pi/2$ !

11. Dec 30, 2015

Thanks again, BvU, but perhaps I phrased my question poorly. I do not need convincing that what I am doing is wrong. That is clear, not only from your simple example, but also from my more complex one. The question is: why is my reasoning wrong? In other examples I have investigated, one starts off with a polar graph in the form r=r(t), and then converts this into parametric form by setting x = r(t)*cos(t) & y = r(t)*sin(t), and then taking dy/dt=0 for the horizontal, and dx/dt for the vertical tangents. (Calculus, Larson & Edwards, 9th edition,p 735). But in the heart example, x and y are already functions of t, so why can't I just skip directly to taking dy/dt and dx/dt?

12. Dec 31, 2015

### Svein

You can. Just get hold of an introductory text in classic differential geometry.

13. Dec 31, 2015

OK, lacking access to a decent mathematics library, I have downloaded a copy of Spivak's "Introduction to Differential Geometry", 3rd ed., vol 1, and am looking at pp 36-37. If you have any other recommendation, I would be grateful. Thanks.

14. Dec 31, 2015

### MrAnchovy

Because this parametric curve was not derived from a polar curve r(t). You can easily see this by setting t=0 which in polar form defines the x axis, y=0, and noticing that x=0: if this was a polar curve it would go through the origin.

If you are looking for the extreme points of the curve you don't need to consider tangents or dy/dx, you simply need dy/dt or dx/dt =0 (this will not give you the bottom point which you can find by setting x=0 as above)..

15. Dec 31, 2015

### MrAnchovy

Or for the x-extrema you can see by inspection that these are ±16.

16. Dec 31, 2015

Thanks very much, MrAnchovy. Those were the last details that were stopping me from being satisfied with the solutions: despite finally getting the correct (x,y) values which corresponded to the graph, I was still curious about the reason that t did not correspond to an angle on the graph, and I was wondering about about the extrema, both points answered by MrAnchovy. So, now everything is much more understandable. ( By the way, stop me if I'm wrong, but it seems that BvU's answer to my question about whether the y-axis can be considered a tangent was an affirmative.) Many thanks to BvU, Svein und Mr.Anchovy!

17. Jan 2, 2016

### MrAnchovy

Glad to help - but the note that the y-axis is nowhere tangent to the curve - a tangent line has slope equal to the first derivative of the curve and y'(0) is clearly not 0.

18. Jan 2, 2016

MrAnchovy, as far as I understand, the vertical tangents do not have to have y' =0, but rather dx/dy = ∞ or, equivalently, dx/dt = 0. This is the case for the y-axis at the two points (x,y,t) = (0, 5, 0) and (0, -15,π)

19. Jan 3, 2016

### MrAnchovy

I made two mistakes, the first is that a vertical line has dx/dy = 0, not dy/dx = 0, but it is clear what I meant. The second was looking at the plot of the curve and assuming that the gradients either side of the y-axis were clearly finite and this is not necessarily true - you need to look at the limits as BvU stated.

However the mistake that you are making is that whilst it is true that at t=0 dx/dt = 0, dy/dt is also = 0. This means that the result of the expression (dx/dt) / (dy/dt) is undefined. Consider for example the parametric curve y = (sin t) / t, x = t (i.e. y = (sin x) / x); it is well known that at t = 0 this has gradient 1, however dx/dt = 0.

20. Jan 3, 2016