Application Center - Maplesoft

App Preview:

Can a Square Roll?

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application





Can a Square Roll? 

by J. Schattman
Sir John A. Macdonald Secondary School
Waterloo, Ontario, Canada


Can a square wheel roll as smoothly as a round one?  It can if you give it the right road to roll on!  In this exploration, we'll figure out what such a road would have to look like, both mathematically and visually.  We'll then drive the point home, as it were, with an animation.   


The square wheel problem is the Renaissance Man of calculus problems.  It weaves together the concepts of arc length, periodic functions, derivatives, numerical integration, the fundamental theorem of calculus and differential equations in an elegant tapestry of mathematical technique.  The star of tonight's performance will be the world renowned inverted catenary1. 


1 A catenary is the shape taken by a flexible cord hanging freely between two points; not to be confused with a small yellow bird. 




The Big Picture* 


We're looking for a road surface that will keep the center of the square at a constant height as it rolls. 


We'll assume the wheel rolls clockwise (i.e. to the right) without slipping, and parallel to the x-axis on top of a curve f(x).  


For convenience, we'll assume the square starts off pointy-side down, so that f(0) = 0. 




Let g(x) be the distance from the center of the square to the point of contact with the road, x, f(x). 


Let l(x) be the the distance that the square has rolled.  Note this is simply the arc length of f(x) from the point x = 0up to the point of contact.   


Key Idea:  For the center of the square to stay at a constant height, f(x) must satisfy  

`+`(f(x), g(x)) = constant 

`+`(f(x), g(x)) = constant (2)


for all values of


For a square with side length s, that constant is `+`(`*`(`/`(1, 2), `*`(s, `*`(sqrt(2))))) so that f(0) = 0  and  

The plan 

Before we start dishing out formulas like so many brochures at a trade show, let's make a plan.  


A plan to solve the square wheel problem: 


1.  Eliminate g(x) and l(x) by using the Pythagorean Theorem to express g(x) in terms of l(x), and then using the formula for arc length to express l(x) in terms of diff(f(x), x). 


2.  Substitute these expressions into Equation `+`(f(x), g(x)) = constant to obtain a first-order differential equation in f(x) with initial condition f(0) = 0. 


3.  Take a deep breath.  Get a cup of coffee. 


4.  Then solve the differential equation for f(x) after setting s = 1.  


5.  Find the first positive root of f(x).  Call this root p.  This will tell us where the bottom-right corner of the square should land after the square has made one half of a rotation.   


6.  To make the wheel keep rolling, create a periodic extension of f(x)with period p.  Now we're ready to roll for as long as we want. 


7.  Make a stunning animation of the square rolling over this road that will make your mathie friends jealous and make normal people glad they're not you. 


Step 1: Eliminating g(x) and l(x) 

By the Pythagorean Theorem on the small triangle (in the Big Picture), we have 


g(x) = sqrt(`+`(`^`(`+`(`*`(`/`(1, 2), `*`(s))), 2), `*`(`^`(`+`(`*`(`/`(1, 2), `*`(s)), `-`(l(x))), 2)))) 


Substituting this into Equation (1) and isolating l(x), we have 

`+`(f(x), sqrt(`+`(`^`(`+`(`*`(`/`(1, 2), `*`(s))), 2), `*`(`^`(`+`(`*`(`/`(1, 2), `*`(s)), `-`(l(x))), 2))))) = `+`(`*`(`/`(1, 2), `*`(s, `*`(sqrt(2)))))l(x) = `+`(`-`(`*`(`^`(`+`(`*`(`/`(1, 4), `*`(`^`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(f(x))))), 2))), `-`(`*`(`/`(1, 4), `*`(`^`(s, 2))))), `/`(1, 2)))), `*`(`/`(1, 2), `*`(s))) 


And l(x)is an arc length, for which we have a handy formula. 


l(x) = Int(sqrt(`+`(1, `*`(`^`(diff(f(x), x), 2)))), x = 0 .. x) 


With two judicious strokes, we have eliminated g(x) and l(x), yielding a differential equation in f(x) alone. 


int(sqrt(`+`(1, `*`(`^`(diff(f(x), x), 2)))), x = 0 .. x) = `+`(`-`(sqrt(`+`(`*`(`/`(1, 4), `*`(`^`(`+`(`*`(s, `*`(sqrt(2))), `-`(`*`(2, `*`(f(x))))), 2))), `-`(`*`(`/`(1, 4), `*`(`^`(s, 2))))))), `*`... 

int(`*`(`^`(`+`(1, `*`(`^`(diff(f(x), x), 2))), `/`(1, 2))), x = 0 .. x) = `+`(`-`(`*`(`/`(1, 2), `*`(`^`(`+`(`*`(`^`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(f(x))))), 2)), `-`(`*`(`^`(s, 2... (4)


In Act II, we solve this DE for f(x). 


Step 2:  Solving for f(x) 


We can simplify int(`*`(`^`(`+`(1, `*`(`^`(diff(f(x), x), 2))), `/`(1, 2))), x = 0 .. x) = `+`(`-`(`*`(`/`(1, 2), `*`(`^`(`+`(`*`(`^`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(f(x))))), 2)), `-`(`*`(`^`(s, 2... by differentiating both sides to remove the integral and then isolating diff(f(x), x) on the left side. 

diff(int(`*`(`^`(`+`(1, `*`(`^`(diff(f(x), x), 2))), `/`(1, 2))), x = 0 .. x) = `+`(`-`(`*`(`/`(1, 2), `*`(`^`(`+`(`*`(`^`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(f(x))))), 2)), `-`(`*`(`^`... 

`*`(`^`(`+`(1, `*`(`^`(diff(f(x), x), 2))), `/`(1, 2))) = `/`(`*`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(f(x))))), `*`(diff(f(x), x))), `*`(`^`(`+`(`*`(`^`(`+`(`*`(s, `*`(`^`(2, `/`(1, 2))... (5)


diff(f(x), x) = `/`(`*`(`^`(`+`(`*`(`^`(s, 2)), `-`(`*`(4, `*`(s, `*`(`^`(2, `/`(1, 2)), `*`(f(x)))))), `*`(4, `*`(`^`(f(x), 2)))), `/`(1, 2))), `*`(s)) (6)

Now would be a good time to give
s a value.  How about...hmmm ... s = 1?


diff(f(x), x) = `*`(`^`(`+`(1, `-`(`*`(4, `*`(`^`(2, `/`(1, 2)), `*`(f(x))))), `*`(4, `*`(`^`(f(x), 2)))), `/`(1, 2))) (7)

The stuff under the square root is
sooooo close to being factorable, but alas, that sqrt(2) refuses to budge, so I'm afraid we'll have to abide some inelegance.  Fortunately, Maple is not so easily intimidated by asymmetries as human calculators, spoiled as we are by the artificial simplicity of textbook problems, and it handles the DE without flinching.



`:=`(f, proc (x) options operator, arrow; `+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(exp(`+`(`-`(`*`(2, `*`(x))))), 2), `*`(sqrt(2))), `-`(`*`(2, `*`(exp(`+`(`-`(`*`(2, `*`(x))))), `*`(sqrt(2))))), sq... 


Constructing the road 

Let's plot this function and see if it conforms to our imaginings in The Big Picture. 


`+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(exp(`+`(`-`(`*`(2, `*`(x))))), 2), `*`(sqrt(2))), `-`(`*`(2, `*`(exp(`+`(`-`(`*`(2, `*`(x))))), `*`(sqrt(2))))), sqrt(2), `*`(`^`(exp(`+`(`-`(`*`(2, `*`(x)))...
`+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(exp(`+`(`-`(`*`(2, `*`(x))))), 2), `*`(sqrt(2))), `-`(`*`(2, `*`(exp(`+`(`-`(`*`(2, `*`(x))))), `*`(sqrt(2))))), sqrt(2), `*`(`^`(exp(`+`(`-`(`*`(2, `*`(x)))...
`+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(exp(`+`(`-`(`*`(2, `*`(x))))), 2), `*`(sqrt(2))), `-`(`*`(2, `*`(exp(`+`(`-`(`*`(2, `*`(x))))), `*`(sqrt(2))))), sqrt(2), `*`(`^`(exp(`+`(`-`(`*`(2, `*`(x)))...


The positive section of the graph looks promising. 


What if we throw away the part below the y-axis and make a periodic extension of the positive part? 


To do that, we need to find out where the positive ends and the negative begins, or in other words, find the roots of f( x ). 



f(x) = 0[[x = `+`(`-`(`*`(`/`(1, 2), `*`(ln(`/`(`*`(`+`(`*`(`^`(2, `/`(1, 2))), `-`(1))), `*`(`+`(`*`(`^`(2, `/`(1, 2))), 1))))))))], [x = 0]] 

The positive solution gives us the period of the road. 

`:=`(period, `+`(`-`(`*`(`/`(1, 2), `*`(ln(`/`(`*`(`+`(sqrt(2), `-`(1))), `*`(`+`(1, sqrt(2)))))))))); -1 


As a second check on our solution, we should eat our vegetables and verify that the arc length of f(x) over one period is the length of one side of the square (in this case, 1).  Numerical integration, anyone? 


int(sqrt(`+`(1, `*`(`^`(diff(f(x), x), 2)))), x = 0 .. period)1.0000 


Touchdown!  We are at last ready to extend the road with a periodic extension of the solution using the interval [0, period].  This we achieve with Maple's handy frac command, which takes the fractional part of a number. 


The road is graphed here over three periods. 


`:=`(road, proc (x) options operator, arrow; f(`*`(frac(`/`(`*`(x), `*`(period))), `*`(period))) end proc); -1 



We have thus derived the shape of the road that will afford passengers aboard our wheel a comfortable ride. 




P.S. What about the catenary? 

The classical solution to the square wheel problem states that each hump of the road is an inverted catenary.  And so I was surprised at not seeing hyperbolic cosine functions in our solution for f(x).  But there's bound to be one hiding somewhere within that tangled mass of exponential terms.  Let's see if we can coax it to come out. 


We had f(x) = `+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(exp(`+`(`-`(`*`(2, `*`(x))))), 2), `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(exp(`+`(`-`(`*`(2, `*`(x))))), `*`(`^`(2, `/`(1, 2)))))), `*`(`^`(2, `/`(1, 2))), ... 


We can try converting that to trig form and hope that some of those exponentials reduce to hyperbolic trig functions.  Since we know `>=`(x, 0), we (i.e. Maple) should be able to simplify those further. 


convert(f(x), trig) 

`+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(`+`(cosh(`+`(`*`(2, `*`(x)))), `-`(sinh(`+`(`*`(2, `*`(x)))))), 2), `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(`+`(cosh(`+`(`*`(2, `*`(x)))), `-`(sinh(`+`(`*`(2...
`+`(`-`(`/`(`*`(`/`(1, 4), `*`(`+`(`*`(`^`(`+`(cosh(`+`(`*`(2, `*`(x)))), `-`(sinh(`+`(`*`(2, `*`(x)))))), 2), `*`(`^`(2, `/`(1, 2)))), `-`(`*`(2, `*`(`+`(cosh(`+`(`*`(2, `*`(x)))), `-`(sinh(`+`(`*`(2...


`+`(`*`(`/`(1, 2), `*`(sinh(`+`(`*`(2, `*`(x)))))), `-`(`*`(`/`(1, 2), `*`(`^`(2, `/`(1, 2)), `*`(cosh(`+`(`*`(2, `*`(x)))))))), `*`(`/`(1, 2), `*`(`^`(2, `/`(1, 2))))) (10)

Good boy. 



P.P.S. Code for creating the animation 


Embedded component

Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.