Solution (source code)

= Solution
{c}

The shell equation is conservative because its radial acceleration is the negative <derivative> of the specific <potential energy>
$$
U(r)=-\frac{GM}{r}-\frac{\Lambda r^2}{6}.
$$
Multiplying the equation of motion by $\dot r$ gives
$$
\frac{d}{dt}\left(\frac12\dot r^2-\frac{GM}{r}-\frac{\Lambda r^2}{6}\right)
=\dot r\left(\ddot r+\frac{GM}{r^2}-\frac{\Lambda r}{3}\right)=0.
$$
Hence
$$
\boxed{E=\frac12\dot r^2-\frac{GM}{r}-\frac{\Lambda r^2}{6}=\text{constant}.}
$$
This is energy per unit shell mass. The total energy of a uniform sphere requires integrating the energies of its shells.

For a sphere of physical radius $R$, the <shell theorem> gives $M(r)=M(r/R)^3$ and $dM=3Mr^2\,dr/R^3$. Assemble the sphere shell by shell to obtain its <Newtonian gravitational potential energy>:
$$
W_G(R)=-\int_0^R\frac{GM(r)}r\,dM
=-\frac{3GM^2}{R^6}\int_0^Rr^4\,dr
=-\frac35\frac{GM^2}{R}.
$$
The <cosmological constant> contributes a prescribed one-body potential $-\Lambda r^2/6$, rather than a pair interaction, so there is no additional factor $1/2$:
$$
W_\Lambda(R)=-\frac\Lambda6\int_0^Rr^2\,dM
=-\frac{\Lambda M}{2R^3}\int_0^Rr^4\,dr
=-\frac1{10}\Lambda MR^2.
$$
Evaluating at the <turnaround radius> gives
$$
\boxed{W_{G,\rm ta}=-\frac35\frac{GM^2}{r_{\rm ta}},\qquad
W_{\Lambda,\rm ta}=-\frac1{10}\Lambda Mr_{\rm ta}^2.}
$$
As in the question, $\Lambda$ here includes the factor $c^2$ that would multiply the geometrical <cosmological constant> in SI units.

For the final equilibrium apply the scalar <virial theorem>. The gravitational virial is $W_G$, whereas the <cosmological constant> force contributes
$$
\sum_\alpha\mathbf r_\alpha\cdot\mathbf F_{\Lambda,\alpha}
=\frac\Lambda3\int r^2\,dM=-2W_\Lambda.
$$
Thus, neglecting a surface-pressure term,
$$
\boxed{2T_f+W_{G,f}-2W_{\Lambda,f}=0.}
$$
At fixed $R$, a positive <cosmological constant> reduces the <kinetic energy> needed for virial equilibrium because its outward acceleration partially offsets self-gravity.

For the <uniform-sphere collapse with a cosmological constant>, assume a uniform final sphere of the same mass, with no energy loss or escaping matter. Put
$$
x=\frac{r_f}{r_{\rm ta}},\qquad
A=\frac{3GM^2}{5r_{\rm ta}},\qquad
B=\frac{\Lambda Mr_{\rm ta}^2}{10}.
$$
The sphere has no bulk <kinetic energy> at turnaround, so $E_{\rm ta}=-A-B$. The final <virial theorem> gives
$$
T_f=\frac{A}{2x}-Bx^2,
\qquad
E_f=T_f-\frac Ax-Bx^2=-\frac A{2x}-2Bx^2.
$$
Since $\rho_{\rm ta}=3M/(4\pi r_{\rm ta}^3)$,
$$
\frac BA=\frac{\Lambda r_{\rm ta}^3}{6GM}=\frac\eta2,
\qquad
\eta=\frac{\Lambda}{4\pi G\rho_{\rm ta}}.
$$
<Conservation of energy> therefore gives
$$
1+\frac\eta2=\frac1{2x}+\eta x^2,
\qquad
\boxed{2\eta x^3-(2+\eta)x+1=0.}
$$
Select the collapsing branch continuous from $x=1/2$ at $\eta=0$, rather than an unrelated root of the <cubic equation>.

For $|\eta|\ll1$, the root lies close to $1/2$. Linearize $x^3$ there:
$$
x^3=\frac18+\frac34\left(x-\frac12\right)
+O\!\left((x-\tfrac12)^2\right)
=\frac34x-\frac14+O\!\left((x-\tfrac12)^2\right).
$$
Substitution into the <cubic equation> gives $(\eta/2-2)x+1-\eta/2\simeq0$, whence
$$
\boxed{\frac{r_f}{r_{\rm ta}}\simeq\frac{1-\eta/2}{2-\eta/2}
=\frac12-\frac\eta8+O(\eta^2).}
$$
The rational expression is an approximation, not an exact solution of the <cubic equation>. In fact both it and the exact collapsing root agree through order $\eta^2$; their first difference is of order $\eta^3$.

With zero <cosmological constant>, <spherical collapse> gives $r_f=r_{\rm ta}/2$. For small positive $\Lambda$, the same sphere with the same <turnaround radius> reaches a smaller final radius. This does not mean that repulsion promotes collapse: as the sphere contracts, $W_\Lambda$ becomes less negative, so some released gravitational binding energy pays the energetic cost of moving inward against the repulsive force. Combined with the modified <virial theorem>, energy conservation requires a more compact endpoint. Positive $\Lambda$ can prevent turnaround altogether; an inward acceleration at $r_{\rm ta}$ requires
$$
-\frac{GM}{r_{\rm ta}^2}+\frac\Lambda3r_{\rm ta}<0,
\qquad\boxed{\eta<1.}
$$
The perturbative radius formula applies well inside this limit, for spheres that actually turn around. A small negative <cosmological constant> instead gives $r_f/r_{\rm ta}>1/2$ at fixed turnaround data.