Do Dogs Know Calculus?
by Timothy Pennings
with excerpts from
The College Mathematics Journal


Most calculus students are familiar with the calculus problem of finding the optimal path from A to B.   "Optimal" may mean, for example, minimizing the time of travel, and typically the available paths must transverse two different mediums, involving different rates of speed.   This problem comes to mind whenever I take my Welsh Corgi, Elvis, for an outing to Lake Michigan to play fetch with his favorite tennis ball.   Standing on the water's edge (See Figure 1) at A, I throw the ball into the water to B.   By the look in Elvis's eyes and his elevated excitement level, it seems clear that his objective is to retrieve it as quickly as possible rather than, say, to minimize his expenditure of energy.   Thus I assume that he unconsciously attempts to find a path that minimizes the retrieval time.

This being his goal, what should be his strategy?   One option would be to try to minimize the time by minimizing the distance traveled.   Thus he could immediately jump into the surf and swim the entire distance.   On the other hand, since he runs considerably faster than he swims, another option would be to minimize the swimming distance.   Thus, he could sprint down the beach to the point on shore closest to the ball, C, and then turn a right angle and swim to it.   Finally, there is the option of running a portion of the way, and then plunging into the lake at D and swimming diagonally to the ball.

Depending on the relative running and swimming speeds, this last option usually rums out to minimize the time.   Although this type of problem is in every calculus text, I have never seen it solved in the general form.   Let's do it quickly -- the answer is revealing.

Let r denote the running speed, and s be the swimming speed.   (Our units will be meters and seconds.) Let T(y) represent the time to get to the ball given that Elvis jumps into the water at D, which is y meters from C. Let Z represent the entire distance from A to C.   Since time = distance/speed, we have


We want to find the value of y that minimizes T(y).   Of course this happens where T'(y) = 0.
Solving T'(y) = 0 for y, we get

(Click here to see the intermediate steps)



where T is seen to have a minimum by using the second derivative test. Several things about the solution should be noticed. First, somewhat surprisingly, the optimal path does not depend on z, as long as z is larger than y. Second, if r < s, we get no solution. That makes sense; if r < s then it is obviously optimal to jump into the lake and swim the entire distance. Third, note that for r > s, y is small, and for r approximately equal to s, y is large, as one would reasonably expect. Finally, note that for fixed r and s, y is proportional to x,

Now, back to Elvis. I noticed when playing fetch with Elvis that he uses the third strategy of jumping into the lake at D. It also seemed that his y values were roughly proportional to the x values. Thus, I conjectured that Elvis was indeed choosing the optimal path, and decided to test it by calculating his values of r and s and then checking how closely his ratio of y to x coincided with the exact value provided by the mathematical model.

With a friend to help me, we clocked Elvis as he chased the ball a distance of 20 meters on the beach. We then timed him as he swam (pursuing me) a distance of 10 meters in the water. His times are given in Table 1.

Table 1. Running and swimming times
Running times
( in seconds )
for 20 meters
Swimming times
( in seconds )
for 10 meters
3.20 12.13
3.16 11.15
3.15 11.07
3.13 10.75
3.10 12.22


Since we wanted Elvis's greatest running speed, we averaged just the three fastest running times, giving
r = 6.40 meters/second. Similarly, using the three fastest swimming times, s = 0.910 meters/second. Then from (2), we get the predicted relationship that

y = 0.144x.

To test this relationship, I took Elvis to Lake Michigan on a calm day when the waves were small. I fixed a measuring tape about 15 meters down the beach at C from where Elvis and I stood at A as I threw the ball. after throwing it, I raced after Elvis, plunging a screwdriver into the sand at the place where he entered the water at D. Then I quickly grabbed the free end of the tape measure and raced him to the ball. I was then able to get both the distance from the ball to the shore, x, and the distance y. If my throw did not land close to the line perpendicular to the shoreline and passing through C, I did not take measurements. I also omitted the couple of times when Elvis, in his haste and excitement, jumped immediately into the water and swam the entire distance. I figured that even an "A" student can have a bad day. We spent three hours getting 35 pieces of data.

... Then I made a table and a scatter plot with the optimal line for the collected data. ... To my (maybe biased) eye, the agreement looks good. It seems clear that in most cases Elvis chose a path that agreed remarkably closely with the optimal path. The way to rigorously validate (and quantify) what the scatter plot suggests is to do a statistical analysis of the data. We will not do this in this paper, but it would be a natural avenue for further work. We conclude with several pertinents.

First, we are in fact using a mathematical model. That is to say, we arrived at our theoretical figure by making many simplifying assumptions.
These include

*We assumed there was a definite line between shore and lake. Because of waves, this was not the case.

*We assumed that when Elvis entered the water, he started swimming. Actually, he ran a short distance in the water. (Although given his six-inch legs, this is not too bad of an assumption!)

*We assumed the ball was stationary in the water. Actually, the waves, winds, and currents moved it a slight distance between the time Elvis plunged into the water and when he grabbed it.

*We assumed that the values of r and s are constant, independent of the distance nm or swum.

Given these complicating factors as well as the error in measurements, it is possible that Elvis chose paths that were actually better than the calculated ideal path.

Second, we confess that although he made good choices, Elvis does not know calculus. In fact, he has trouble differentiating even simple polynomials. More seriously, although he does not do the calculations, Elvis's behavior is an example of the uncanny way in which nature (or Nature) often finds optimal solutions. Consider how soap bubbles minimize surface area, for example. It is fascinating that this optimizing ability seems to extend even to animal behavior. (It could be a consequence of natural selection, which gives a slight but consequential advantage to those animals that exhibit better judgment.)

Finally, for those intrigued by this general study, there are further experiments that are available, other than using your own favorite dog. One might do a similar experiment with a dog running in deep snow ver- sus a cleared sidewalk. Even more interesting, one might test to determine whether the optimal path is found by six-year-old children, junior high aged pupils, or college students. For the sake of their pride, it might be best not to include professors in the study.

Can Dogs Do Calculus?




Send any comments or questions to: David Pleacher