Computing Ramanujan asymptotic formula from Rademacher's formula for the partition function I am trying to derive the Hardy-Ramanujan asymptotic formula
$$p(n) \sim \frac{1}{4n\sqrt{3}}e^{\pi\sqrt{\frac{2n}{3}}}$$
from Radmacher's formula for the partition function $p(n)$ given by
$$p(n)=\frac{1}{\pi\sqrt{2}}\sum_{k=1}^{\infty}A_{k}(n)\sqrt{k}\left[\frac{d}{dx}\frac{sinh\left(\frac{\pi}{k}\sqrt{\frac{2}{3}\left(x-\frac{1}{24}\right)}\right)}{\sqrt{x-\frac{1}{24}}}\right]_{x=n}$$
where
$$A_{k}(n)=\sum_{h=0, (h,k)=1}^{k-1}e^{\pi i(s(h,k)-2n\frac{h}{k})}$$ and
$$s(h,k)=\sum_{r=1}^{k-1}\frac{r}{k}\left(\frac{hr}{k}-\left\lfloor\frac{hr}{k}\right\rfloor-\frac{1}{2}\right)$$
G.E. Andrews, and any other literature on this topic, says that we can obtain the H-R asymptotic expression from the first term of the Rademacher series, i.e. for $k=1$. I don't know how to approach this as simply calculating for $k=1$ does not give the desired result. Could we perhaps try and use Lapalce's method, or the method of steepest descent?
 A: Using the leading term of Radmacher's formula, we have
\begin{align*}
p(n) & \sim \frac{1}{{\pi \sqrt 2 }}\left[ {\frac{\mathrm{d}}{{\mathrm{d}x}}\frac{{\sinh \left( {\pi \sqrt {\frac{2}{3}\left( {x - \frac{1}{{24}}} \right)} } \right)}}{{\sqrt {x - \frac{1}{{24}}} }}} \right]_{x = n}  
\\ &
 = \frac{{4\sqrt 3 }}{{24n - 1}}\cosh \left( {\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)} } \right) - \frac{1}{\pi}\frac{{24\sqrt 3 }}{{(24n - 1)^{3/2} }}\sinh \left( {\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)} } \right).
\end{align*}
Now
\begin{align*}
\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)}  = \pi \sqrt {\frac{2}{3}n} \sqrt {1 - \frac{1}{{24n}}} & = \pi \sqrt {\frac{2}{3}n} \left( {1 + \mathcal{O}\!\left( {\frac{1}{n}} \right)} \right) \\ &= \pi \sqrt {\frac{2}{3}n}  + \mathcal{O}\!\left( {\frac{1}{{\sqrt n }}} \right).
\end{align*}
Thus,
\begin{align*}
& \cosh \left( {\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)} } \right),\sinh \left( {\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)} } \right) \sim \frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}\left( {n - \frac{1}{{24}}} \right)} } \right) \\ & = \frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n}  + \mathcal{O}\!\left( {\frac{1}{{\sqrt n }}} \right)} \right) = \frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right)\left( {1 +\mathcal{O}\!\left( {\frac{1}{{\sqrt n }}} \right)} \right) \\ & \sim \frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right).
\end{align*}
And therefore,
\begin{align*}
p(n) & \sim \frac{{4\sqrt 3 }}{{24n - 1}}\frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right) - \frac{1}{\pi }\frac{{24\sqrt 3 }}{{(24n - 1)^{3/2} }}\frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right)
\\ &
 \sim \frac{{4\sqrt 3 }}{{24n}}\frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right) - \frac{1}{\pi }\frac{{24\sqrt 3 }}{{(24n)^{3/2} }}\frac{1}{2}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right)
\\ &
 = \frac{1}{{4n\sqrt 3 }}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right)\left( {1 - \frac{{\sqrt 3 }}{{\sqrt 2 \pi n^{1/2} }}} \right) \sim \frac{1}{{4n\sqrt 3 }}\exp \left( {\pi \sqrt {\frac{2}{3}n} } \right).
\end{align*}
A: $$Q_k(n)=A_{k}(n)\sqrt{k}\left[\frac{d}{dx}\frac{sinh\left(\frac{\pi}{k}\sqrt{\frac{2}{3}\left(x-\frac{1}{24}\right)}\right)}{\sqrt{x-\frac{1}{24}}}\right]_{x=n}$$
$$p(n)=Q_1(n)+\sum_{k=2}^n Q_k(n) + \sum_{k=n+1}^\infty Q_k(n)$$
$$ = Q_1(n)+ O(n Q_2(n))  + \sum_{k=n+1}^\infty O(n^{1/2}k^{-3/2})$$
$$ = Q_1(n)+O(n e^{\frac\pi2\sqrt{\frac{2n}{3}}})$$
($O(n^{1/2}k^{-3/2})$ is not completely obvious, it is because the main term $\frac{\pi}{\sqrt6 k(n-1/24)}$ cancels in the expression for the derivative)
A: Rough sketch: Take the first term, and you'll get:
$$\begin{align}p\left(n\right)&\sim\frac{1}{\pi\sqrt{2}}A_{1}\left(n\right)\cdot\frac{d}{dx}\left(\frac{\sinh\left(\pi\sqrt{\frac{2}{3}\left(x-\frac{1}{24}\right)}\right)}{\sqrt{x-\frac{1}{24}}}\right)\\&\sim\frac{1}{\pi\sqrt{2}}\frac{d}{dx}\left(\frac{\sinh\left(\pi\sqrt{\frac{2x}{3}}\right)}{\sqrt{x}}\right)\\&\sim\frac{1}{2\pi\sqrt{2}}\frac{d}{dx}\left(\frac{\exp\left(\pi\sqrt{\frac{2x}{3}}\right)}{\sqrt{x}}\right)\\&=\frac{1}{2\pi\sqrt{2}}\left(\frac{\pi\exp\left(\pi\sqrt{\frac{2x}{3}}\right)}{\sqrt{6}x}-\frac{\exp\left(\pi\sqrt{\frac{2x}{3}}\right)}{2x\sqrt{x}}\right)\\&=\frac{\exp\left(\pi\sqrt{\frac{2x}{3}}\right)}{4x\sqrt{3}}\left(1-\frac{\sqrt{6}}{2\pi\sqrt{x}}\right)\\&\sim\frac{\exp\left(\pi\sqrt{\frac{2x}{3}}\right)}{4x\sqrt{3}}\end{align}$$
In the first line, we take the first term (as it is the leading term). We can see $A_1(n)=1$ and we write $x-1/24$ as $x$, since we're looking for as $x \rightarrow \infty$.
In the third-line, we take the leading term of the $\sinh(x)$ function.
$$\sinh\left(x\right)=\frac{e^{x}-e^{-x}}{2}\sim\frac{e^{x}}{2}$$
