Some dogs live to play fetch, especially if the object of interest is a favorite tennis ball or toy. Others, like ours, fetch only when the reward is a particularly tantalizing tidbit. At least one dog, however, appears to take the enterprise seriously enough to figure out an optimal path to the target.

Elvis is a Welsh corgi who belongs to mathematician Timothy J. Pennings of Hope College in Holland, Mich. When Elvis and Pennings go to the beach, their pastime of choice is fetch. Standing at the water’s edge, Pennings throws a tennis ball out into the waves, and Elvis eagerly retrieves it.

Depending on the angle at which Pennings tosses the ball relative to the shoreline, his dog can run along the beach until he is directly opposite the ball, then swim out to get it. Or Elvis can plunge into the water immediately, swimming all the way to the ball. What happens most of the time, however, is that Elvis runs part of the way, then swims out to the ball.

This behavior reminded Pennings of a standard problem found in just about any calculus textbook—one that involves minimizing the time of travel to a target when the available paths require traversing different mediums at different speeds.

Suppose that *r* is the dog’s running speed and *s* is his swimming speed. If *x* is the perpendicular distance from the shore to the target, *y* is the distance from the point on the shore opposite the target to the point at which the dog plunges into the water, and *z* is the total distance along the shore from the point at which the ball is tossed to the point opposite the target, the following equation gives the value of *y* that minimizes the retrieval time:

The equation reveals that the optimal path doesn’t depend on the distance *z*, as long as *z* is larger than *y*. Moreover, there is no solution if the running speed is less than the swimming speed. Also,if the running speed is much, much greater than the swimming speed, *y* is small, and if the two speeds are approximately equal, *y* is large. Finally, for fixed speeds, *y* is proportional to *x*.

Pennings decided to check how well Elvis’ performance matches this mathematical model. He and a friend clocked Elvis to determine the dog’s running and swimming speeds. Plugging those speeds into the formula, Pennings obtained the relationship *y* = 0.144*x*.

“To test this relationship, I took Elvis to Lake Michigan on a calm day when the waves were small,” Pennings recounted in the May *College Mathematics Journal*. “We spent 3 hours getting 35 pieces of data. We stopped only when the waves grew. Elvis had no interest in stopping or slowing down.

Although the plotted data showed some scatter, Pennings concluded that “the agreement looks good.” Moreover, he noted that his mathematical model

included a number of simplifying assumptions: that there was a definite line between shore and lake, that the ball remained stationary in the water, and that the dog’s running and swimming speeds were independent of the distance.

“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,” Pennings wrote.

Of course, although he makes good choices, Elvis doesn’t actually do calculus. Nonetheless, Pennings remarked, “Elvis’ behavior is an example of the uncanny way in which nature . . . often finds optimal solutions.”

“I’d guess that most dogs have the same problem-solving software built in from the factory,” he says. My article is just “drawing attention to something that has been in front of us all the while.”