find the distance in kilometres between two points of latitude 40°N along a parallel line of latitudes

if the earth's radius is R km, then at latitude θ, the radius r is R cosθ

so, if the two points differ by Ø° of longitude, the distance between them is
s = rØ = RØ cosθ * π/180
In this case, that would be
RØ cos40° * π/180 km