In special relativity, there is the twin paradox. I'll have to take a little detour into special relativity to explain why it arises. If you know what that is about and how it comes about, you can skip this section.

Due to the constant speed of light that special relativity is built around, time will seem to pass slower for object and people moving relative to you. The faster they go, the slower their passing of time will seem to you. In the extreme case of almost reaching the speed of light, time will almost halt.

This can be verified with muons from the atmosphere of the earth. Muons have a short lifetime $\tau$ after which they decay into lighter particles. The lifetime is so short that there is no way that they could get very far. Yet you can measure the flux of muons at high altitude and again at the ground and see that less of them decayed than you would expect given their speed $v$ and lifetime $\tau$. The characteristic distance $d$ that they can move is $d = \tau v$. So what causes that?

The muons move very fast relative to us. That means that their time will be slowed down by a factor of $\gamma$ where

$$\gamma := \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$$

is the so called Lorentz factor. When $v \to c$, we have $\gamma \to \infty$. Since the time slows down by $\gamma$, time will pass more and more slowly.

The huge velocity of the muons then extends the distance they can travel without decaying. The characteristic length now is $d = \gamma \tau v$ which can be sufficiently long to get all the way down to the ground to measure them. So this an effect verified by experiment.

This is all fine until you ask one question:

The muons do move relative to us. So to them it will look like our time is slowed down as well. How does one decide who will be the younger one?

Since you cannot see the age of a muon directly, it is easier to think about twins. One of them stays on the earth, the other takes a spaceship and travels with sufficient speed somewhere. Then he turns around and travels back with a sufficient speed again. The two twins meet again on the earth. One of them will be older than the other one. But which one? The astronaut twin could just say that he was not moving the whole time but the one who stayed on earth was receding from him.

The important thing to keep in mind is that the twins have to meet in one place to compare their age. Any attempt to compare their age at different positions will introduce non-trivial effect since the speed of light also is the maximum speed of information. Once one of the twins would send a message containing his age to the other, it would take a long time for the message to arrive if the other twin is receding still. More fundamentally even, the very notion of simultaneity depends on the velocity as well.

## Usual solutions

The problem is not really symmetric since the astronaut twin has to turn around. Often people say that this will mark the astronaut as the one being younger (which is the result indeed). The astronaut left the intertial frame and the one on earth is the only valid inertial frame that you can take.

It is correct that the frame of the astronaut twin is not an inertial frame the whole time, there is no SO(1, 3) transformation (or proper orthochronous Lorentz transformation) that will get you from one frame to the other. This is because the astronaut twin has to accelerate to get back to earth -- that will make his frame non-inertial. Due to this, some people say that general relativity is needed to resolve this problem.

## Solution with special relativity

You do not really need general relativity here. No masses that cause gravity are taken into account here, and the Einstein equation $G^{\mu\nu} = 8 \pi G T^{\mu\nu}$ will just become $G^{\mu\nu} = 0$ which is solved by flat space (plus gravitational waves, if you'd like). The case of flat space is already covered by special relativity (mostly) so we do not really need it here.

The curve length $s$, appropriately defined by something like

$$\mathrm ds^2 := \mathrm dt^2 - \mathrm dx^2 - \mathrm dy^2 - \mathrm dz^2$$

is Lorentz invariant, it will be the same in each inertial system. That is what defines the Lorentz transformation, actually.

Since the movement is only in the $x$ direction and the $y$ and $z$ directions are not affected, I will only write the $t$ and $x$ components with $y = 0$ and $z = 0$ everywhere.

This curve length is the self-perceived time (i.e. age) of an observer traveling along the curve. In order to obtain the time that has passed for either twin, one needs to compute the curve length of their respective world line. So what are the world lines? One can take a simple one which contains an arbitrary short acceleration time. It will looks like that:

I will choose the affine parameter of the curve to be $\sigma$. It will not be the time $t$ or the self-time $s$, it is just a parameterization of the curve. Since it does not change anything, I will set $c = 1$ here. The velocity $\beta = v/c$ is the speed of the astronaut twin.

The world line of the twin staying on earth (hence $E$) looks like this:

\begin{aligned} E(\sigma) = \begin{pmatrix} 1 \ 0 \end{pmatrix} \sigma \end{aligned}

The astronaut twin will have a more complicated world line which consists of two pieces:

\begin{aligned} A(\sigma) = \begin{cases} \begin{pmatrix} 1 \ \beta \end{pmatrix} \sigma & \sigma < 1 \ \begin{pmatrix} 1 \ \beta \end{pmatrix} + \begin{pmatrix} 1 \ - \beta \end{pmatrix} ((\sigma - 1) & \sigma > 1 \end{cases} \end{aligned}

The next step is to integrate the curve length over $\sigma$ from 0 to 2. At $\sigma = 1$ one has the reversal of velocity from the astronaut twin. The curve is not differentiable at $\sigma = 1$ but that does not hurt for the integration. One could even exclude that one point since it has zero measure.

The first curve length is given by:

\begin{aligned} s_E = \int_0^2 \mathrm d \sigma \, |\dot E(\sigma)| = \int_0^2 \mathrm d \sigma \, \left| \begin{pmatrix} 1 \ 0 \end{pmatrix} \right| = \int_0^2 \mathrm d \sigma \, \dot E^0(\sigma) = \int_0^2 \mathrm d \sigma \, 1 = 2 \end{aligned}

The twin who stayed on earth will age by 2 units of time. What about the astronaut twin?

The modulus squared of the derivative with respect to $\sigma$ is the same for both parts of the curve. Therefore this can be written as one integral.

\begin{aligned} s_A = \int_0^2 \mathrm d \sigma \, |\dot A(\sigma)| = \int_0^2 \mathrm d \sigma \, \left| \begin{pmatrix} 1 \ \beta \end{pmatrix} \right| = \int_0^2 \mathrm d \sigma \, \sqrt{1 - \beta^2} = 2 \sqrt{1 - \beta^2} = \frac{2}{\gamma} \end{aligned}

The minus sign in $\sqrt{1 - \beta^2}$ comes from the minus sign in the metric tensor. This is where $\mathrm ds^2 := \mathrm dt^2 - \mathrm dx^2$ has been used.

The interesting thing now is the ratio of the two which is just $\gamma$! That means the faster the astronaut twin will be a factor of $\gamma$ younger than the other one. The one on earth will be a factor of $\gamma$ older than the astronaut.

This will hold true in any intertial frame that special relativity calls such a frame. We cannot assume such a frame to exist for the astronaut. It only exist for the first or the last part of his journey but not for the whole one.

## The parabola

In case you do not like the kink, one can choose a different curve where the astronaut travels on a parabola that is opened to the left. The parameterization (with $\sigma \in [-1, 1]$ this time) of the world line then looks like the following:

\begin{aligned} A(\sigma) = \begin{pmatrix} \sigma \ \frac 12 \beta \sigma^2 \end{pmatrix}. \end{aligned}

In the space-time diagram the two world-lines can be visualized like so:

The corresponding tangent vector along the curve then looks like this:

\begin{aligned} \dot A(\sigma) = \begin{pmatrix} 1 \ \beta\sigma \end{pmatrix}. \end{aligned}

The curve length can again be computed with the curve length integral. It will be 2 again for the one who stayed on earth since that world-line did not change. For the astronaut, the integral will involve $|\dot A(\sigma)|$ again. Then I use the metric tensor to compute the scalar product, it just has a $\sigma$ more than before in it. From there I can compute the integral.

\begin{aligned} s_A = \int_{-1}^1 \mathrm d \sigma \, |\dot A(\sigma)| = \int_{-1}^1 \mathrm d \sigma \, \left| \begin{pmatrix} \sigma \ \beta\sigma \end{pmatrix} \right| = \int_{-1}^1 \mathrm d \sigma \, \sqrt{1 - [\beta\sigma]^2} \end{aligned}

The exact value of this integral is not important. It is important to see that for zero velocity of the twin ($\beta = 0$) the value is also 2, just as for the twin on the earth. For any $\beta > 0$ the integrand will be smaller than 1 such that the integral will be less than 2. Therefore the astronaut will be younger as well.

You see that the kink was not important, it really is the astronaut who will be younger. Since the self-time $s$ is Lorentz-invariant, it must also hold in any other interial frame.

## Solution with general relativity

In case you are still not convinced or just interested, there is also a way to use the machinery of general relativity -- differential geometry -- to look at this problem from the frame of the astronaut. The great power of the theory of general relativity is that its symmetry group is GL(4), one can use any diffeomorphism as a symmetry transformation. The curve that the astronaut takes can be smoothly transformed to be at rest with such a diffeomorphism.

I will use the same parabola as before. Transforming the kink is not possible with a diffeomorphism. And as I have shown the qualitative result is the same for both kink and parabolic world-line.

So the transformation that will bring the astronaut from rest to its curve looks like this:

\begin{aligned} \phi(t, x) = \begin{pmatrix} t \ x + \frac12 \beta t^2 \end{pmatrix} \,. \end{aligned}

That is the diffeomorphism that creates the coordinate transformation from the system where the astronaut is at rest to the one we previously looked at. Now the pullback operation will allow us to move from the tangent space of the new system to the tangent space of the old system.

In the old system the metric tensor was given as:

\begin{aligned} g_{\mu\nu} \simeq \begin{pmatrix} 1 & 0 \ 0 & -1 \end{pmatrix} \end{aligned}

I wrote "$\simeq$" instead of "$=$" since $g$ is a covariant tensor while the matrix is a mixed tensor. The notation is just convenient when one remembers that it denotes the elements of $g_{\mu\nu}$.

The partial derivatives of the diffeomorphism (the Jacobi determinant) are:

$$\phi^0_{,0} = 1 \quad \phi^1_{,0} = \beta t \quad \phi^0_{,1} = 0 \quad \phi^1_{,1} = 1 \,.$$

The notation $\phi^\mu_{,\alpha}$ is a shorthand notation for writing $\partial \phi^{\mu} / \partial x^\alpha$ which is common in general relativity.

With that in mind I can compute the transformed metric tensor with the pullback:

$$[\phi^* g]{\mu\nu} = g(\phi) \phi^\alpha_{,\mu} \phi^\beta_{,\nu} \,.$$

Then the components of the transformed metric tensor are:

\begin{aligned} \tilde g_{\mu\nu} \simeq \begin{pmatrix} 1 - [\beta t]^2 & - \beta t \ - \beta t & -1 \end{pmatrix} \,. \end{aligned}

The absolute magnitude of the velocity of both twins is now exchanged -- the viewpoint is now with the astronaut.

For the twin staying on earth we now have the curve

\begin{aligned} \begin{pmatrix} \sigma \ - \frac12 \beta \sigma^2 \end{pmatrix} \,. \end{aligned}

Its tangent vector (velocity) is given by the derivative with respect to $\sigma$:

\begin{aligned} \begin{pmatrix} 1 \ - \beta \sigma \end{pmatrix} \,. \end{aligned}

Then the same line integral can be used to compute the curve length. The absolute magnitude must now use the new metric tensor. The magnitude of a vector is always given as

$$|x| = \sqrt{x^\mu g_{\mu\nu} x^\nu} \,.$$

The square of the integrand (I do not want to write the square root everywhere) now is:

\begin{aligned} \begin{pmatrix} 1 \ - \beta \sigma \end{pmatrix}^{\mathrm T} \begin{pmatrix} 1 - [\beta \sigma]^2 & - \beta \sigma \ - \beta \sigma & -1 \end{pmatrix} \begin{pmatrix} 1 \ - \beta \sigma \end{pmatrix} = \begin{pmatrix} 1 \ - \beta \sigma \end{pmatrix}^{\mathrm T} \begin{pmatrix} 1 - [\beta \sigma]^2 + [\beta\sigma]^2 \ - \beta\sigma + \beta\sigma \end{pmatrix} \,. \end{aligned}

And this can further simplified:

\begin{aligned} =\begin{pmatrix} 1 \ - \beta \sigma \end{pmatrix}^{\mathrm T} \begin{pmatrix} 1 \ 0 \end{pmatrix} = 1 \,. \end{aligned}

Nothing has changed here although this is viewed from the astronaut's perspective!

The squared integrand for the astronaut looks like the following:

\begin{aligned} \begin{pmatrix} 1 \ 0 \end{pmatrix}^{\mathrm T} \begin{pmatrix} 1 - [\beta \sigma]^2 & - \beta \sigma \ - \beta \sigma & -1 \end{pmatrix} \begin{pmatrix} 1 \ 0 \end{pmatrix} = 1 - [\beta \sigma]^2 \,. \end{aligned}

That is the same integrand as before after taking the square root.

Therefore, nothing changes when one changes the reference to the astronaut. This resolves the twin paradox completely and removes any ambiguity.