The Friedmann equation for these models can be written
$$ \dot{a}^2 = H_0^2(\frac{\Omega_{m}}{a} + 1 - \Omega_{m}) $$
For a universe with both matter and nonzero curvature, we have
$$ \frac{\dot{a}^2}{a^2} = H_0^2(\Omega_m a^{-3} + \Omega_k a^{-2}) \implies (\frac{da}{dt})^2 = H_0^2(\Omega_m a^{-1} + \Omega_k) $$
Therefore,
$$ H_0dt = \frac{da}{\sqrt{\Omega_ma^{-1} + \Omega_k}} = \frac{1}{\sqrt{\Omega_m}} \frac{a^{\frac{1}{2}}da}{\sqrt{1+a(\frac{\Omega_k}{\Omega_m})} } $$
It turns out that it is easier to first solve for the conformal time $d\eta = \frac{dt}{a}$. We have
$$ \eta = \int d \eta = \int \frac{dt}{a} = \frac{1}{H_0\sqrt{\Omega_m}} \int \frac{a^{-\frac{1}{2}} da}{\sqrt{1+a(\frac{\Omega_k}{\Omega_m})}} $$
Here begins our solution for positive curvature, i.e. $k > 0$ and therefore $\Omega_k = \frac{-k}{H_0^2} < 0$. Then, let $u^2 = \frac{-\Omega_k}{\Omega_m a}$, so that $u = \sqrt{\frac{-\Omega_k}{\Omega_m}}a^{\frac{1}{2}}$ and $du = \frac{1}{2}\sqrt{\frac{-\Omega_k}{\Omega_m}}a^{-\frac{1}{2}}$.
We have
$$ \eta = \frac{2}{H_0\sqrt{\Omega_m}}\sqrt{\frac{\Omega_m}{-\Omega_k}} \int \frac{du}{\sqrt{1 - u^2}} = \frac{2}{H_0\sqrt{-k}} \sin^{-1} u $$
Inverting
$$ u = \sin\frac{\theta}{2}, \; \theta = H_0 \eta \sqrt{-\Omega_k} $$
under the same change of variables $a \to u$, $u^2 du = \frac{1}{2} \frac{-\Omega_k}{\Omega_m}^\frac{3}{2} a^\frac{1}{2} da$, the equation for $t$ becomes
$$ \frac{1}{H_0\sqrt{\Omega_m}} \int \frac{a^\frac{1}{2} da}{\sqrt{1+a(\frac{\Omega_k}{\Omega_m})}} = \frac{2}{H_0\sqrt{\Omega_m}} (\frac{\Omega_m}{-\Omega_k})^\frac{3}{2} \int \frac{u^2du}{\sqrt{1 - u^2}} $$
Now, changing $u = \sin \frac{\theta}{2}, du = \frac{1}{2} \cos \frac{\theta}{2} d\theta$, we have
$$ t = \frac{2 \Omega_m}{H_0(-\Omega_k)^\frac{3}{2}} \int \frac{\sin^2 \frac{\theta}{2} \cos \frac{\theta}{2} d \theta}{2\sqrt{1 - \sin^2 \frac{\theta}{2}}} = \frac{2 \Omega_m}{H_0(-\Omega_k)^\frac{3}{2}} \int \sin^2 \frac{\theta}{2} d\theta $$
Now, using $\cos \theta = \cos^2 \frac{\theta}{2} - \sin^2 \frac{\theta}{2} = 1 - \sin^2 \frac{\theta}{2}$, we find
$$ t = \frac{\Omega_m}{2H_0(-\Omega_m)^\frac{3}{2}} \int [1 - \cos \theta] d\theta = \frac{\Omega_m}{2H_0(-\Omega_k)^\frac{3}{2}}(\theta - \sin \theta) $$
Finally, recall that $a = -\frac{\Omega_m}{\Omega_k}u^2 = -\frac{\Omega_m}{\Omega_k}\sin^2 \frac{\theta}{2}$ so that we have a parametric solution for a cycloid, with $\theta = H_0 \sqrt{-\Omega_k}\eta$,
$$ t(\theta) = \frac{\Omega_m}{2H_0 (-\Omega_k)^\frac{3}{2}}(\theta - \sin \theta), a(\theta) = \frac{\Omega_m}{2H_0(-\Omega_k)^{\frac{3}{2}}}(1 - \cos \theta ), \textbf{ for positive curvature.} $$
Similarly, using $\theta$ as a dummy variable to parameterize this a negatively curved universe, we can make a substitution $Q$, where $Q = \frac{\sinh^2\frac{\theta}{2}}{a} = \frac{1 - \Omega_{m}}{\Omega_{m}}$, to obtain:
$$ t(\theta) = \frac{\Omega_{m}}{2H_0(-\Omega_k)^\frac{3}{2}}(\sinh \theta - \theta), a(\theta) = \frac{\Omega_{m}}{2(-\Omega_m)}(\cosh \theta - 1), \textbf{ for negative curvature.} $$
Take solutions from previous exercise and use perturbative expansion when $|\Omega_k|\ll 1$. How does the age of the universe vary with $H_0$ and $\Omega_k$, when $\Omega_k$ is small?
For the universe with a negative curvature, the time equation is as follows, knowing that $\Omega_m + \Omega_k = 1$:
$$ t(\theta) = \frac{1-\Omega_k}{2H_0(-\Omega_{k})^\frac{3}{2}}(\sinh \theta - \theta) $$
Since $\Omega_k = \frac{-k}{H_0}$, $\Omega_k < 0$ corresponds to a closed universe, where $k > 0$, which reaches a maximum turnaround scale factor $a_{ta} = \frac{\Omega_m}{-\Omega_k}$ at time $t_{ta}$, so $H_0 t_{ta} = \frac{\pi}{2}(\frac{\Omega_m}{-\Omega_k^{\frac{3}{2}}})$.
In similar fashion, for the universe with a positive curvature, the time equation is as follows, again knowing that $\Omega_m + \Omega_k = 1$:
$$ t(\theta) = \frac{1 - \Omega_k}{2H_0 (-\Omega_k)^\frac{3}{2}}(\theta - \sin \theta) $$
In both cases, as $\Omega_k \to 0$, both $t_{ta}, a_{ta} \to \infty$ and the solution approaches that of a flat universe without turnaround, i.e. $a(t) = (\frac{3}{2} \sqrt{\Omega_m} H_0 t)^{\frac{2}{3}}$, an asymptotically flat universe with an exceedingly large age.
$\textbf{Correction}$: As $\Omega_k \to 0$, the universe becomes primarily matter-dominated, implying that it asymptotically reaches a flat universe with the solution to elapsed time given by that of the Einstein-de Sitter model of the universe: $t = \frac{2}{3H_0}$.