Calculate Earth's distance travelled in a year
You need to find the perimeter of an ellipse. This might be accurate enough for you (recalling that an ellipse is only an accurate description of an orbit for a two-body system.

An ellipse has no simple formula to find the perimeter. There appear to be several commonly used approximations based on infinite series (see for example "Maths is Fun").

e.g. Define
$$ h = \frac{(a-b)^2}{(a+b)^2},$$
where $a$ and $b$ are the semi-major and semi-minor axes and $b = a\sqrt{1-e^2}$, where $e$ is the eccentricity.

Then the result you want is
$$ p = \pi(a+b)\left[1 + \frac{h}{4} + \frac{h^2}{64} + \frac{h^3}{256} ...\right]$$

All this is general, but might be overkill for your problem involving the Earth. If my calculator skills are working, then for the Earth's orbit around the Sun, $a = 1.00000011$ au, $e = 0.01671022$, $b = 0.99986048$ au and $h = 7\times 10^{-5}$.

Using this and just the first 2 terms in the series, I get a perimeter of $1.999895\pi$ au. So hardly a correction from $2\pi a$.

However, if you were serious about accuracy then you would have to add to this about 12.5 orbits around the barycentre of the Earth-Moon system and a further correction for the motion of the Sun around the solar system barycentre.