On this page
Put a charged bead in a narrow tunnel through a uniformly charged ball of the opposite sign and it swings back and forth in simple harmonic motion. Most JEE students have seen that problem. Now make the ball a cube. Gauss's law can no longer find the field, yet the answer comes out exactly the same: near the centre, a cube pulls like a sphere, and the period does not depend on which way the tunnel points. This post shows why, using a neat split of the cube into a box and three thin slabs.
The question appeared as Part A, "Cubic oscillations", of Theory Problem 1 at the 2020 International distributed Physics Olympiad (IdPhO), the online contest held in place of IPhO 2020. The numbers and the extra checks below are our own.
Why can't Gauss's law give the field inside a charged cube?
For a sphere, symmetry tells you the field is radial and has the same size everywhere on a sphere of radius r. Gauss's law then gives E = ρr/3ε₀ in one line, as worked in our post on the field and potential of a uniformly charged solid sphere.
A cube has far less symmetry. On any closed surface you draw inside it, the field changes in size and direction from point to point. Gauss's law still holds, but the total flux alone cannot tell you the field at one point. You need another route.
How does a box and three slabs find the force?
Let the cube have side a and charge density ρ, and put a point charge q at a small displacement (x, y, z) from the centre, with x, y and z positive.
Draw a box centred on the charge. Its faces sit on the three cube faces nearest the charge, so its half-widths are a/2 − x, a/2 − y and a/2 − z. The charge is at the exact centre of this box, so by symmetry the box exerts no force on it.
What is left over? Three thin slabs on the far faces of the cube, of thickness 2x, 2y and 2z. Where they meet at the edges they overlap a little, but those pieces are of second order in the displacement and can be dropped for small x, y and z.
Treat each slab as a charged sheet. A slab of thickness 2x carries surface charge σ = 2ρx, spread over a square face about a/2 from the charge.
Now the key step. A patch dA of that face pulls on q with a force whose part perpendicular to the face is σ q dΩ/4πε₀, where dΩ is the solid angle the patch subtends. The sideways parts cancel in pairs. A face of a cube subtends one sixth of the full 4π at the cube's centre, so the whole face pulls with
F = σ q/6ε₀ = (2ρx)(q/6ε₀) = qρx/3ε₀
This is the same one-sixth you use when a point charge sits at the centre of a cube and each face gets q/6ε₀ of flux. The pull points along x, towards the far face if q and ρ have opposite signs.
Why is the period the same whichever way the channel points?
Do the same for the y and z slabs and add the three pulls. With q and ρ of opposite sign:
F = −(q|ρ|/3ε₀)(x, y, z) = −(q|ρ|/3ε₀) r
The force points straight back to the centre and grows in proportion to the distance, whatever the direction of r. That is exactly the sphere's result. A channel along an axis, a face diagonal or a body diagonal gives the same spring constant k = q|ρ|/3ε₀ and the same period:
T = 2π√(3ε₀m/q|ρ|)
The size of the cube drops out, as the Earth's radius drops out of the 84-minute period for a tunnel along any chord of the Earth.
Worked example: how long does one swing take?
Data: a cube of side 20 cm with ρ = −1.0 µC/m³, so it holds −8.0 nC in all. A bead of charge +1.0 nC and mass 1.0 g slides in a smooth channel through the centre. Turn the cube so the channel is horizontal, and ignore gravity along it.
Spring constant. k = q|ρ|/3ε₀ = (1.0 × 10⁻⁹)(1.0 × 10⁻⁶)/(3 × 8.854 × 10⁻¹²) = 3.76 × 10⁻⁵ N/m.
Angular frequency. ω = √(k/m) = √(3.76 × 10⁻⁵/1.0 × 10⁻³) = 0.194 rad/s.
Period. T = 2π/ω = 32.4 s.
Size of the force. At 1.0 cm from the centre, F = kx = 3.76 × 10⁻⁷ N, a tiny force, which is why the swing is so slow.
Units check. q·ρ/ε₀ has units C × C m⁻³ ÷ C² N⁻¹ m⁻² = N/m, a spring constant, as it should be.
The cube's side never entered steps 1 to 3. A 2 m cube of the same density gives the same 32.4 s.
How far from the centre does the sphere result hold?
Only near the centre. We computed the cube's exact field by integrating Coulomb's law over its volume, and compared it with ρr/3ε₀:
At 10% of the side from the centre, the field is 1.0% stronger than the sphere value towards a face and 0.65% weaker towards a corner.
At 20%, it is 3.9% stronger towards a face and 2.6% weaker towards a corner.
At 40%, the gap grows to 15.6% stronger and 10.2% weaker.
So large swings are not simple harmonic, and their period does depend on the channel's direction. Away from the three symmetry directions the field also gains a sideways part, which the channel wall must push against.
What if the cube were an atom?
Spread a charge of +e evenly through a cube 0.1 nm on a side, so ρ = 1.6 × 10¹¹ C/m³, and put an electron at its centre. The same formula gives ω = √(eρ/3ε₀mₑ) = 3.26 × 10¹⁶ rad/s, a frequency of 5.2 × 10¹⁵ Hz. Light of that frequency has a wavelength of about 58 nm, deep in the ultraviolet. A sphere of the same volume, radius 0.062 nm, gives exactly the same answer.
This is only a teaching model, in the spirit of Thomson's "plum pudding" atom. Rutherford's 1911 analysis of alpha-particle scattering showed that the positive charge sits in a tiny nucleus instead, and that model replaced Thomson's.
Where to practise this kind of problem
Problems that join superposition, symmetry and SHM are common in JEE Advanced. The Fermi Problem Library has a step-by-step solver that explains the reasoning. If you are preparing for JEE Main & Advanced, Fermi Test Prep offers personalised preparation with an AI tutor, live classes, adaptive mocks, mentorship and a study plan that updates based on mastery.
Quick checklist
Gauss's law alone cannot find the field inside a cube.
Split the cube into a box centred on the charge (no force) and three slabs of thickness 2x, 2y, 2z.
Each slab pulls with σq/6ε₀ = qρx/3ε₀, from the one-sixth solid angle of a face.
Near the centre F = −(q|ρ|/3ε₀) r, the same as a sphere, in any direction.
T = 2π√(3ε₀m/q|ρ|), independent of the cube's size and the channel's angle.
For swings beyond about a tenth of the side, the sphere result starts to fail.



