Solving F = ma with Gravity and Constraints
Point a garden hose at the sky and the water leaps out in a graceful arch, rises, slows, curls over
and falls back to the lawn. Fire a cannon, throw a basketball, launch a long-jumper off the board —
the same curve appears every time. It is not a coincidence, and it is not a special "law of arcs".
It is nothing more than F = ma, written down honestly and then
solved.
This page is about the workflow that turns Newton's second law into an actual prediction. You already
know that force equals mass times acceleration. But acceleration is
a = \dfrac{d^2 x}{dt^2} — a rate of a rate — so
F = ma is secretly a differential equation for the
position as a function of time. The recipe is always the same three moves:
- Draw the forces. Every push and pull on the body, as vectors, in a free-body diagram.
-
Write F = ma as a differential equation. Set the total
force equal to m\,\ddot{\mathbf r}, one component at a time:
m\ddot x = F_x, m\ddot y = F_y.
-
Integrate with initial conditions. A second-order equation needs
two facts to pin down its answer: the starting position and the starting velocity.
We will run this recipe twice, on the two problems every physicist meets first: a
projectile flying freely under gravity, and a block on an inclined
plane, where the ramp adds a constraint that the block must stay on its surface.
Projectile motion: two easy equations hiding in one hard-looking problem
Throw a ball near the Earth's surface and — ignoring air — the only force on it is
its weight, mg, pointing straight down. Nothing pushes it sideways. That
single fact is the whole game. Split the motion into horizontal (x) and
vertical (y) and write F = ma for each:
m\ddot x = 0, \qquad m\ddot y = -mg.
The mass cancels in the second equation — a fact with enormous consequences — leaving two
completely separate equations:
\ddot x = 0, \qquad \ddot y = -g.
The horizontal and vertical stories never talk to each other. This decoupling is why
projectile motion is easy: it is really two one-dimensional problems bolted together. Suppose the ball
starts at the origin with speed v_0 at launch angle
\theta, so its initial velocity components are
v_{x0} = v_0\cos\theta and v_{y0} = v_0\sin\theta.
Integrate each equation once for velocity, and again for position:
x(t) = (v_0\cos\theta)\,t, \qquad y(t) = (v_0\sin\theta)\,t - \tfrac{1}{2}g t^2.
Those two constants of integration were fixed by the initial conditions (start at the origin, start
with that velocity). Horizontal motion is uniform; vertical motion is uniformly accelerated. Eliminate
the time — solve the x equation for
t = x/(v_0\cos\theta) and substitute — and the shape of the path falls out:
y = x\tan\theta - \frac{g}{2 v_0^2 \cos^2\theta}\,x^2.
It is y = (\text{constant})\,x - (\text{constant})\,x^2 — a
parabola. The hose, the cannonball and the basketball all trace one because they all
obey the very same pair of decoupled equations.
Play with the arc
Drag the two sliders and watch the trajectory y(x) respond. The
launch speed v_0 stretches the whole arc; the
angle \theta trades height against distance. Notice that
the range is largest near 45^\circ, and that complementary angles
(say 30^\circ and 60^\circ) land in the same
spot — a symmetry baked into the \sin 2\theta range formula below.
Three numbers worth extracting: time, height, range
Once you have x(t) and y(t), the classic
quantities are just questions you ask of them.
Time of flight. The ball is back at launch height when
y = 0 (and t \ne 0):
0 = (v_0\sin\theta)\,t - \tfrac12 g t^2 \;\Longrightarrow\; t_{\text{flight}} = \frac{2 v_0\sin\theta}{g}.
Maximum height. The peak is where the vertical velocity
\dot y = v_0\sin\theta - g t hits zero, at half the flight time. Feeding
that back in:
H = \frac{(v_0\sin\theta)^2}{2g} = \frac{v_0^2\sin^2\theta}{2g}.
Range. Horizontal distance covered in the full flight time,
R = v_{x0}\,t_{\text{flight}}. Using the double-angle identity
2\sin\theta\cos\theta = \sin 2\theta:
R = (v_0\cos\theta)\cdot\frac{2 v_0\sin\theta}{g} = \frac{v_0^2 \sin 2\theta}{g}.
Because \sin 2\theta is largest when
2\theta = 90^\circ, the range is maximised at
\theta = 45^\circ, and it is unchanged if you swap
\theta \leftrightarrow 90^\circ - \theta — that is the complementary-angle
symmetry you saw in the graph.
Worked example. A ball is kicked at v_0 = 20\ \text{m/s}
and \theta = 30^\circ (take g = 9.8\ \text{m/s}^2,
\sin 30^\circ = 0.5, \cos 30^\circ \approx 0.866,
\sin 60^\circ \approx 0.866).
t_{\text{flight}} = \frac{2(20)(0.5)}{9.8} \approx 2.04\ \text{s}, \quad H = \frac{20^2(0.5)^2}{2(9.8)} \approx 5.1\ \text{m}, \quad R = \frac{20^2(0.866)}{9.8} \approx 35.3\ \text{m}.
Just under two seconds aloft, about five metres high, landing thirty-five metres away — three
predictions, all squeezed out of \ddot x = 0 and
\ddot y = -g.
Because the horizontal and vertical equations are decoupled. The fired bullet's huge
horizontal speed lives entirely in the x equation and has
no effect whatsoever on the y equation, which is the plain
\ddot y = -g for both bullets. They start at the same height with the same
(zero) vertical velocity, so they fall on identical vertical schedules and land together — one just
lands a long way downrange. Drop a coin and flick another off the table at the same moment: they
click on the floor together. Gravity does not care how fast you are moving sideways.
Misconception: "A cannonball keeps accelerating forwards while it flies, because the
cannon gave it a forward push." No. The cannon's push ends the instant the ball
leaves the barrel. After that the only force is gravity, straight down. There is
nothing pushing horizontally, so \ddot x = 0 and the
horizontal velocity v_x stays exactly constant for the
entire flight. A force is needed to change velocity, not to maintain it — that is Newton's
first law. The ball slows, stops rising, and falls purely because of the vertical force; its
forward march is perfectly steady the whole way. What curves the path is the growing vertical speed,
not a shrinking or growing horizontal one.
The inclined plane: when a surface constrains the motion
Now put a block on a smooth ramp tilted at angle \theta. Two forces act:
its weight mg straight down, and the normal force
N from the surface, which by definition points perpendicular to
the ramp. The normal force is a constraint force: the ramp is rigid, so the block
cannot sink into it, and N is whatever it needs to be to enforce that.
Reveal the free-body diagram one force at a time.
The clever move is to tilt the axes: instead of horizontal and vertical, choose axes
along the ramp and perpendicular to it. Why? Because the block is
constrained to move only along the surface — so along that axis is where the interesting acceleration
lives, and across it the acceleration is zero. Resolve the weight into those two directions:
- along the slope (pointing downhill): mg\sin\theta;
- perpendicular, pressing into the ramp: mg\cos\theta.
Now write F = ma in each tilted direction. Perpendicular to the ramp the
block does not accelerate (it stays on the surface — that is the constraint), so those forces balance
and hand us the normal force for free:
\text{(perpendicular)}\quad N - mg\cos\theta = 0 \;\Longrightarrow\; N = mg\cos\theta.
Along the ramp, the normal force has no component at all (it is perpendicular), so the
only force is the weight's down-slope part. That is the equation of motion:
\text{(along the ramp)}\quad m a = mg\sin\theta \;\Longrightarrow\; a = g\sin\theta.
-
The acceleration down the slope is
a = g\sin\theta — independent of the mass.
-
The normal (constraint) force is
N = mg\cos\theta.
-
Limits sanity-check it: a flat surface (\theta = 0) gives
a = 0, N = mg; a vertical cliff
(\theta = 90^\circ) gives a = g,
N = 0 — free fall.
Since a = g\sin\theta is constant, the block slides down the incline
exactly like a projectile falls — uniformly accelerated — and the same integration gives its speed
and position along the slope: v = (g\sin\theta)\,t and
s = \tfrac12 (g\sin\theta)\,t^2 from rest.
No — every block accelerates at the same g\sin\theta, regardless of
mass. The temptation is to think "more weight means more pull, so it speeds up faster." More
weight does mean a bigger down-slope force mg\sin\theta — but it
also means proportionally more inertia m resisting that
force. In ma = mg\sin\theta the mass cancels clean off both sides, exactly
as it did in the projectile's \ddot y = -g. A pebble and a boulder released
together on a smooth slope stay side by side all the way down. This is the same deep fact Galileo
demonstrated (legendarily) from the Tower of Pisa: gravity gives every mass the same acceleration.
Adding friction (the optional twist)
Real ramps grip. A kinetic friction force opposes the sliding, with magnitude
f = \mu N = \mu\, mg\cos\theta, where \mu is the
coefficient of kinetic friction. It points up the slope for a block sliding down. The
perpendicular balance is unchanged (N = mg\cos\theta), but the along-slope
equation now has two terms:
m a = mg\sin\theta - \mu\, mg\cos\theta \;\Longrightarrow\; a = g\left(\sin\theta - \mu\cos\theta\right).
Friction simply subtracts a \mu\cos\theta piece. If
\mu \ge \tan\theta the bracket is zero or negative and a stationary block
never starts to move — the ramp is too shallow or too sticky. Set \mu = 0
and you recover the frictionless a = g\sin\theta, as you must.
Solving it on a computer: integrate the ODEs step by step
When the forces are messy (air drag, a wind, a weird ramp) there may be no tidy formula — but the
recipe still works, because a computer can integrate the equations numerically. Watch the projectile
ODEs \ddot x = 0, \ddot y = -g being stepped
forward a millisecond at a time until the ball lands, then compare with the exact range formula.
const g = 9.8; // gravity (m/s^2)
const v0 = 25, angleDeg = 40; // launch speed and angle
const th = angleDeg * Math.PI / 180;
let x = 0, y = 0; // start at the origin
let vx = v0 * Math.cos(th); // horizontal velocity (stays constant)
let vy = v0 * Math.sin(th); // vertical velocity (gravity changes it)
const dt = 0.001;
let t = 0;
// Step the equations of motion forward until the ball is back to y = 0
do {
x += vx * dt; // dx/dt = vx
y += vy * dt; // dy/dt = vy
vy -= g * dt; // dvy/dt = -g (there is NO dvx/dt: no horizontal force)
t += dt;
} while (y >= 0);
console.log(`landed after ${t.toFixed(2)} s at range ${x.toFixed(1)} m`);
const exact = v0 * v0 * Math.sin(2 * th) / g; // R = v0^2 sin(2θ) / g
console.log(`exact formula range = ${exact.toFixed(1)} m`);
The numerically integrated range matches the formula to a fraction of a metre — reassurance that the
analytic parabola really is the solution of those two little differential equations. The exact same
loop, with the extra friction or drag terms added to the velocity updates, solves problems that have
no closed-form answer at all.