Rolling Ellipse
An ellipse with semi-major axis a and semi-minor axis b (a > b > 0) rolls without slipping along the x -axis. Compute the arc length of the path traced by the center of the ellipse over one complet...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
An ellipse $E(a, b)$ is given at its initial position by equation: $\dfrac {x^2} {a^2} + \dfrac {(y - b)^2} {b^2} = 1$
The ellipse rolls without slipping along the $x$ axis for one complete turn. Interestingly, the length of the curve generated by a focus is independent from the size of the minor axis: $$F(a,b) = 2 \pi \max(a,b)$$

This is not true for the curve generated by the ellipse center. Let $C(a, b)$ be the length of the curve generated by the center of the ellipse as it rolls without slipping for one turn.
You are given $C(2, 4) \approx 21.38816906$.
Find $C(1, 4) + C(3, 4)$. Give your answer rounded to $8$ digits behind the decimal point in the form $ab.cdefghij$.
Problem 525: Rolling Ellipse
Mathematical Foundation
Theorem (Ellipse Arc Length). The arc length of the ellipse from parameter to is
where is the eccentricity and is the incomplete elliptic integral of the second kind with parameter .
Proof. Parameterize the ellipse as . Then and
Write . Thus
by the definition of the incomplete elliptic integral of the second kind.
Lemma (Distance from Center to Tangent). When the ellipse is tangent to a line at the point corresponding to parameter , the perpendicular distance from the center of the ellipse to the tangent line is
Proof. The tangent line to the ellipse at the point has the equation
The distance from the origin to this line is
Theorem (Center Trajectory). When the ellipse has rotated so that the contact point is at parameter , the center of the ellipse is located at
Proof. The rolling constraint requires that the arc length along the ellipse from the initial contact point to the current contact point equals the distance traveled along the -axis. The center is displaced from the contact point on the line by a horizontal offset (due to the tangent angle) and a vertical offset . The tangent vector at parameter makes an angle with the horizontal, where (after appropriate sign conventions). The horizontal displacement of the center from the contact point on the line is . Combining with the rolling constraint and computing yields the stated formula for .
Theorem (Arc Length of Center Path). The arc length of the center’s trajectory over one complete revolution () is
This integral does not admit a closed-form expression in terms of standard functions and must be evaluated numerically.
Proof. The arc length formula for a parametric curve is standard. The integrand involves compositions of trigonometric functions and square roots of rational expressions in with parameters , which cannot be reduced to elementary functions or standard elliptic integrals.
Editorial
An ellipse rolls along the x-axis. Track the center’s path (elliptic trochoid). We compute dX_c/dtheta and dY_c/dtheta by differentiation. Finally, adaptive Gauss-Kronrod quadrature.
Pseudocode
Compute dX_c/dtheta and dY_c/dtheta by differentiation
Adaptive Gauss-Kronrod quadrature
Complexity Analysis
- Time: where is the number of quadrature points used by the adaptive integration. Typically for tolerance with Gauss-Kronrod rules.
- Space: for the recursion stack and function evaluations in adaptive quadrature; for fixed-point quadrature.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
// Rolling ellipse: compute center path and arc length
// Numerical integration using Simpson's rule
double simpson(function<double(double)> f, double a, double b, int n) {
double h = (b - a) / n;
double s = f(a) + f(b);
for (int i = 1; i < n; i += 2) s += 4 * f(a + i * h);
for (int i = 2; i < n; i += 2) s += 2 * f(a + i * h);
return s * h / 3.0;
}
// Arc length of ellipse from 0 to theta
double arc_length(double a, double b, double theta) {
auto integrand = [a, b](double t) {
return sqrt(a * a * sin(t) * sin(t) + b * b * cos(t) * cos(t));
};
return simpson(integrand, 0, theta, 10000);
}
// Circumference of ellipse
double circumference(double a, double b) {
return arc_length(a, b, 2 * M_PI);
}
int main() {
double a = 2.0, b = 1.0;
cout << fixed << setprecision(8);
cout << "Ellipse a=" << a << ", b=" << b << endl;
cout << "Circumference = " << circumference(a, b) << endl;
// Compute center path
int N = 10000;
vector<double> X(N), Y(N);
for (int i = 0; i < N; i++) {
double theta = 2.0 * M_PI * i / (N - 1);
// Arc length up to theta
double s = arc_length(a, b, theta);
// Height of center
double denom = sqrt(a * a * sin(theta) * sin(theta) + b * b * cos(theta) * cos(theta));
double h = a * b / denom;
// Tangent angle
double tx = -a * sin(theta);
double ty = b * cos(theta);
double alpha = atan2(ty, tx);
// Center offset from contact
double dx_ell = -a * cos(theta);
double dy_ell = -b * sin(theta);
double rot = -alpha + M_PI / 2.0;
double cr = cos(rot), sr = sin(rot);
X[i] = s + dx_ell * cr - dy_ell * sr;
Y[i] = abs(dx_ell * sr + dy_ell * cr);
}
// Compute arc length of center path
double total_arc = 0;
for (int i = 1; i < N; i++) {
double dx = X[i] - X[i-1];
double dy = Y[i] - Y[i-1];
total_arc += sqrt(dx * dx + dy * dy);
}
cout << "Center path arc length = " << total_arc << endl;
return 0;
}
"""
Problem 525: Rolling Ellipse
An ellipse rolls along the x-axis. Track the center's path (elliptic trochoid).
"""
import numpy as np
from scipy import integrate
def ellipse_arc_length(a: float, b: float, theta: float) -> float:
"""Arc length of ellipse from 0 to theta."""
result, _ = integrate.quad(
lambda t: np.sqrt(a**2 * np.sin(t)**2 + b**2 * np.cos(t)**2),
0, theta
)
return result
def ellipse_circumference(a: float, b: float) -> float:
"""Full circumference of ellipse."""
return ellipse_arc_length(a, b, 2 * np.pi)
def rolling_ellipse_center(a: float, b: float, n_points: int = 1000):
"""
Compute the path of the center of an ellipse rolling on the x-axis.
When the contact point is at parameter theta on the ellipse:
- Distance along x-axis = arc length s(theta)
- Height of center = ab / sqrt(a^2 sin^2(theta) + b^2 cos^2(theta))
- Horizontal offset of center from contact = center projects to contact
The center position:
X_c = s(theta) - (a cos(theta) * b sin(theta) - b sin(theta) * a cos(theta)) ...
Actually, using the rolling constraint more carefully:
At contact parameter theta:
- tangent direction at theta: (-a sin(theta), b cos(theta)) (normalized)
- normal direction (inward): (-b cos(theta), -a sin(theta)) (normalized)
- distance from center to tangent line: h = ab / sqrt(a^2 sin^2 + b^2 cos^2)
Center position:
X_c(theta) = s(theta) + offset along x
Y_c(theta) = h(theta)
"""
thetas = np.linspace(0, 2 * np.pi, n_points)
X_c = np.zeros(n_points)
Y_c = np.zeros(n_points)
for i, theta in enumerate(thetas):
# Arc length up to theta
s = ellipse_arc_length(a, b, theta)
# Height of center above x-axis
denom = np.sqrt(a**2 * np.sin(theta)**2 + b**2 * np.cos(theta)**2)
h = a * b / denom
# The tangent to the ellipse at theta makes angle alpha with x-axis
tx = -a * np.sin(theta)
ty = b * np.cos(theta)
tangent_len = np.sqrt(tx**2 + ty**2)
# Normal from contact point to center
# Center relative to contact point on ellipse: (-a*cos(theta), -b*sin(theta)) relative
# rotated so tangent aligns with x-axis
# The contact is at bottom, tangent is horizontal
# Angle of tangent with horizontal
alpha = np.arctan2(ty, tx)
# Center offset from contact point (in ellipse frame): (-a cos theta, -b sin theta)
# from contact point which is at (a cos theta, b sin theta) to center (0,0)
dx_ell = -a * np.cos(theta)
dy_ell = -b * np.sin(theta)
# Rotate by -(alpha) to align tangent with x-axis, then by pi (since rolling on bottom)
# Actually the tangent at the contact should be horizontal (aligned with x-axis)
# Rotation angle to make tangent horizontal: -alpha (or pi - alpha)
rot_angle = -alpha + np.pi / 2 # align tangent with x-axis
cos_r = np.cos(rot_angle)
sin_r = np.sin(rot_angle)
dx_world = dx_ell * cos_r - dy_ell * sin_r
dy_world = dx_ell * sin_r + dy_ell * cos_r
X_c[i] = s + dx_world
Y_c[i] = dy_world
# Ensure the center starts at the correct height
# At theta=0, contact at (a, 0), center should be at height b
# Adjust if needed
Y_c = np.abs(Y_c) # center should be above x-axis
return thetas, X_c, Y_c
# Parameters
a, b = 2.0, 1.0
circ = ellipse_circumference(a, b)
print(f"Ellipse a={a}, b={b}")
print(f"Circumference = {circ:.6f}")
thetas, X_c, Y_c = rolling_ellipse_center(a, b, n_points=500)
# Compute arc length of center path
dX = np.diff(X_c)
dY = np.diff(Y_c)
center_arc_length = np.sum(np.sqrt(dX**2 + dY**2))
print(f"Center path arc length (one revolution) = {center_arc_length:.6f}")
