Analysis of Carrier's problem

Abstract: A computational and asymptotic analysis of the solutions of Carrier's problem is presented. The computations reveal a striking and beautiful bifurcation diagram, with an infinite sequence of alternating pitchfork and fold bifurcations as the bifurcation parameter tends to zero. The method of Kuzmak is then applied to construct asymptotic solutions to the problem. This asymptotic approach explains the bifurcation structure identified numerically, and its predictions of the bifurcation points are in excellent agreement with the numerical results. The analysis yields a novel and complete taxonomy of the solutions to the problem, and demonstrates that a claim of Bender & Orszag is incorrect.

\section{Introduction}
\label{intro}
In 1970, G.~F.~Carrier \cite[eq.~(3.5)]{carrier1970} introduced
the following singular perturbation problem
\begin{equation}
 \epsilon^2 y'' + 2(1-x^2) y + y^2 = 1, \qquad y(-1) = y(1) = 0,\label{maineqn}
\end{equation}
where $0< \epsilon \ll 1$, and a prime represents $\fdd{}{x}$.
This remarkably beautiful and complex problem is discussed in more
detail in the textbooks of Carrier \& Pearson
\cite[p.~197]{carrier1985} and Bender \& Orszag
\cite[p.~464]{bender1999}. We briefly review their discussion.

Since \eqref{maineqn} is singularly perturbed, we expect the solution
to comprise an outer solution valid for $1-|x| \gg \epsilon$ combined with
possible boundary layers near $x = \pm 1$.
Na\"ively setting $\epsilon = 0$ gives the leading-order outer solution as
\begin{equation}
 y_{\mathrm{out}} = x^2-1 \pm \sqrt{1+(1-x^2)^2}.\label{outersol}
\end{equation}
For neither choice of sign does $y_{\mathrm{out}}$ satisfy the
boundary conditions at $x = \pm 1$, so there are indeed boundary layers.
In the boundary layer near $x=-1$ we set $x = -1 + \epsilon X$,
$y(x) = y_{\mathrm{in}}(X)$ to give
\begin{equation}
\sdd{y_{\mathrm{in}}}{X} + y_{\mathrm{in}}^2 = 1, \qquad
    y_{\mathrm{in}}(0) = 0.\label{innereqn}
\end{equation}
In order to match with the outer solution, $y_{\mathrm{in}}$ must tend
to $\pm 1$ as $X \rightarrow \infty$. Bender \& Orszag show that there are no
solutions  tending to $1$, so that the minus sign must be chosen in
the outer approximation (\ref{outersol}). On the other hand, there are
{\em two} solutions of (\ref{innereqn}) which tend to $-1$ at infinity, namely
\begin{equation}
y_{\mathrm{in}} = -1 + 3\, \mathrm{sech}^2\left( \pm \frac{X}{\sqrt{2}} +
   \tanh^{-1}\left(\sqrt{\frac{2}{3}}\right) \right).\label{inner}
\end{equation}
Similarly there are two possible boundary layer solutions near $x =
1$.
Thus it seems that a matched asymptotic analysis has produced four
independent solutions of the equation.
As Bender \& Orszag say, ``it
is a glorious triumph of boundary layer theory that all four solutions
actually exist and are extremely well approximated by the
leading-order uniform approximation'' generated from (\ref{outersol}) and
(\ref{inner}).  These uniform approximations are shown in Figure
\ref{fig1}.
\begin{figure}
\centering
\subfigure[]{
{\includegraphics[width=0.45\textwidth]{figures/outerpp.pdf}}
}
\
\subfigure[]{
{\includegraphics[width=0.45\textwidth]{figures/outermp.pdf}}
}
\\
\subfigure[]{
{\includegraphics[width=0.45\textwidth]{figures/outerpm.pdf}}
}
\
\subfigure[]{
{\includegraphics[width=0.45\textwidth]{figures/outermm.pdf}}
}
\caption{The four asymptotic solutions with $\epsilon^2 = 0.00223$, generated
  using the outer approximation (\ref{outersol}) and the boundary layer
  approximations (\ref{inner}). }
\label{fig1}
\end{figure}

However, the story does not end there. Bender \& Orszag show that it
is also possible to have a solution with an internal  layer
near $x=0$. Writing $x = \epsilon X$, $y(x) = y_{\mathrm{in}}(X)$ gives
\begin{equation}
\sdd{y_{\mathrm{in}}}{X} + 2 y_{\mathrm{in}}+ y_{\mathrm{in}}^2 = 1, \label{innereqn0}
\end{equation}
with the spike solution
\begin{equation}
y_{\mathrm{in}} = 3 \sqrt{2}\, \mathrm{sech}^2(2^{-1/4}X + A) - 1 - \sqrt{2},
\end{equation}
where we have matched with the outer solution by requiring that
$y_{\mathrm{in}} \rightarrow - 1 - \sqrt{2}$ as $|X| \rightarrow \infty$.
The constant $A$ (corresponding to a translation in the centre of the
spike) is left undetermined in \cite{bender1999}, although it is
shown in \cite{macgillivray2000} that it must be zero.
Since this internal spike solution can be combined with any
combination of boundary layers at $x = \pm 1$, we have generated
another four solutions to \eqref{maineqn}.

One might ask whether it is possible to have more than one internal
spike.
Bender \& Orszag  claim that ``for a given positive value of $\epsilon$
there are $4(N+1)$ solutions to \eqref{maineqn} which have from 0 to
$N$ internal boundary layers at definite locations, where $N$ is a
finite number depending on $\epsilon$''.

There seems to have been remarkably little work following up on this
claim. MacGillivray et al.~\cite{macgillivray2000} considered the
solutions with two spikes in detail. They showed that the spikes must be
symmetrically placed about
$x=0$, and that the separation between them is $O(\epsilon \log \epsilon)$. In
view of the rather intricate asymptotic analysis in
\cite{macgillivray2000}, it is perhaps not surprising that no attempt has
been made to analyze the three spike solutions.

On the other hand, the asymptotic dependence of the maximum number of
spikes  $M_{\rm max}$
on $\epsilon$ has been determined. Ai \cite{ai2003} showed that $M_{\rm max}$ is
$O(1/\epsilon)$, and
subsequently Wong
and Zhao
\cite{wong2008} showed that
\[ M_{\rm max} \sim \left\lfloor \frac{K}{\epsilon} \right\rfloor,\]
where $K \approx  0.4725$ and $\lfloor x \rfloor$ is the greatest
integer less than or equal to $x$. Wong
and Zhao also showed that the number of solutions of (\ref{maineqn})
is between $4 M_{\rm max}-3$ and $4 M_{\rm max}$.

We also note that Kath has developed a general method  which
gives a qualitative understanding of the number and type of solutions to
equations such as (\ref{maineqn}) in terms of slowly varying phase
planes \cite{kath1985}. Kath's conclusions are similar to those of
Bender and Orszag.

In this paper we investigate the claim of Bender \& Orszag, both
numerically and asymptotically.

We first apply a powerful new algorithm for computing bifurcation
diagrams, deflated continuation \cite{farrell2015d}, to Carrier's
problem. This computation reveals a striking and intricate bifurcation
diagram, with new solutions coming into existence via an apparently infinite
sequence of alternating pitchfork and fold bifurcations as $\epsilon \rightarrow
0$. Furthermore, its results suggest that the claim of Bender \&
Orszag is incorrect: for each fixed value of $\epsilon$, the number of
solutions is divisible by 2, but is not always a multiple of 4. (However,
the proportion of values of $\epsilon$ for which the number of solutions
is not divisible by 4 shrinks rapidly as $\epsilon \rightarrow 0$.)

We then apply the method of Kuzmak \cite{kuzmak1959} to construct
asymptotic solutions to \eqref{maineqn} with a large number of
internal spikes. This method is a generalisation of both the method of
multiple scales and the WKB method, producing a solution in the form
of a slowly modulated fast oscillation. The frequency and amplitude of
the fast oscillation are allowed to vary slowly with position
(as in the WKB method), but the underlying oscillator is nonlinear, so
that the oscillations are not simply harmonic. We will find that this
asymptotic approach is able to capture very well the bifurcations
identified numerically, providing a more-or-less complete asymptotic
description of the solutions of (\ref{maineqn}).

\section{Numerical analysis and computational results}
\label{num}

\begin{figure}
\centering
\includegraphics[width=12.75cm]{figures/bifurcation-diagram.pdf}

\begin{tabular}{rrrr}
\includegraphics[width=2.8cm]{figures/src/results/epssq-0dot25-n-0.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-0dot25-n-1.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-0dot08135-n-2.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-0dot02953-n-3.pdf}
\\
\includegraphics[width=2.8cm]{figures/src/results/epssq-4.0000e-02/solution-3.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-4.0000e-02/solution-4.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-4.0000e-02/solution-5.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-4.0000e-02/solution-6.pdf}
\\
\includegraphics[width=2.8cm]{figures/src/results/epssq-2.2300e-03/solution-3.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-2.2300e-03/solution-4.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-2.2300e-03/solution-33.pdf} &
\includegraphics[width=2.8cm]{figures/src/results/epssq-2.2300e-03/solution-34.pdf}
\end{tabular}

\caption{Bifurcation diagram for Carrier's equation \eqref{maineqn}
as a function of the singular perturbation parameter $\epsilon$. The diagram
should be read from right to left, as $\epsilon \rightarrow 0$. For large $\epsilon$,
there are two solutions; as $\epsilon \rightarrow 0$, the system undergoes
alternating pitchfork and fold bifurcations (vertical lines). Green circles
denote fold bifurcations; red circles denote pitchfork bifurcations; blue
circles refer to solutions shown in the panels.}
\label{fig:bifurcation-diagram}
\end{figure}

The central task of bifurcation theory is to determine how
the number of solutions to an equation changes as a
parameter is varied.  The main algorithm used to compute
this is the combination of arclength continuation and branch
switching, as invented by Keller in 1977 \cite{keller1977}
and implemented in popular software packages such as AUTO
\cite{doedel1986}. This algorithm is mature and highly
successful, but has a significant drawback: it can only
compute that part of the bifurcation diagram connected to
the initial data, i.e.~it computes connected
\emph{components} of the bifurcation diagram and cannot
``jump'' from one disconnected component to another.
Unfortunately, the bifurcation diagram for Carrier's
problem is indeed disconnected: from any initial datum
branch switching discovers at most four solutions, as we
will see shortly. Since we already know from the analysis
of Section \ref{intro} that at least eight solutions exist
for moderate values of $\epsilon$, branch switching along $\epsilon \to 0$
offers only a limited insight into the solutions of \eqref{maineqn}.

In recent work, Farrell, Beentjes \& Birkisson have
developed an entirely new algorithm for computing
bifurcation diagrams, called \emph{deflated continuation}
\cite{farrell2015d}. One of the central advantages of
deflated continuation is that it is capable of computing
disconnected bifurcation diagrams, such as that arising in
Carrier's problem\footnote{The other central advantage is
that deflated continuation scales to very large
discretizations, which is more relevant to partial
differential equations than ordinary differential
equations.}. The main weakness of branch switching is that
it relies on identifying critical points at which different
branches meet; this is what renders it incapable of
discovering branches that do not meet the known data at any
point. In contrast, deflated continuation relies instead on
a \emph{deflation} technique for eliminating known solutions
from consideration. Suppose $N$ regular solutions $y_1, y_2,
\dots, y_N$ are known to a discretization of
\eqref{maineqn}. Deflation constructs a new problem residual
for Newton's method with the property that \emph{no initial
guess will converge to $y_1, y_2, \dots, y_N$}.  By
guaranteeing that Newton's method will not converge to known
solutions, deflation enables the discovery of unknown
branches, even if those branches are not connected to the
known data. For more details, see Farrell et al.~\cite{farrell2015d}.

Equation (\ref{maineqn}) was discretized with $5 \times 10^4$ standard
piecewise linear finite elements using FEniCS
\cite{logg2011} and PETSc \cite{balay2015}. We applied
deflated continuation to this discretization from $\epsilon =
\sqrt{1/2}$ to $\epsilon = 1/20$, with a continuation step of
$10^{-5}$ in $\epsilon^2$. Deflation was applied using the $H^1$
norm. All nonlinear systems were solved with Newton's method
and all arising linear systems were solved with LU factorization. Once
deflated continuation had completed, arclength continuation was applied
backwards in $\epsilon$ from the solutions found at $\epsilon = 1/20$. The
intricate bifurcation diagram computed in this way is shown
in Figure \ref{fig:bifurcation-diagram}.

The algorithm discovers two solutions to \eqref{maineqn} for $\epsilon =
\sqrt{1/2}$ from the initial guess ${y}(x) = 1$; at $\epsilon =
1/20$, 36 solutions were found. The system undergoes an initial pitchfork
bifurcation at $\epsilon \approx 0.4689$, and subsequently alternates
between fold and pitchfork bifurcations. At each bifurcation, two new
solutions come into existence, and thus there are regions of the
diagram for which the claim of Bender \& Orszag that the number of
solutions is divisible by 4 does not hold. These regions are
precisely the gaps between each fold bifurcation and its
subsequent pitchfork. However, these gaps tend to zero as
$\epsilon \rightarrow 0$.

The diagram is highly fragmented; no connected component
comprises more than four solutions, which is why branch
switching applied to this problem can never discover more
than four solutions from any single initial datum. We observe
that each connected component is characterized by the
number of interior maxima $M$.
The lowest component comprises
a single branch that undergoes no bifurcations, and
corresponds to $M = 0$; this branch exists for all $\epsilon$ and
is shown in panel 1 of Figure \ref{fig:bifurcation-diagram}.
The next component ($M = 1$) also exists for all $\epsilon$, and
is shown in panel 2 of Figure \ref{fig:bifurcation-diagram}.
After the  pitchfork bifurcation it comprises three
solutions, one with an interior spike but no boundary spikes,
one with no interior spike but a boundary spike on
the left (as in Figure \ref{fig1}(b)), and one with no interior spike but
a boundary spike on
the right (as in Figure \ref{fig1}(c)).

The other components do not exist for large $\epsilon$, and
come into existence at fold bifurcations as $\epsilon$ is reduced (panels
3 and 4 of Figure \ref{fig:bifurcation-diagram}).
Between each fold and its subsequent pitchfork bifurcation,
the two solutions are symmetric with $n$ local maxima; both
begin with $y'(-1) > 0$. In one of these solutions the
maxima are more concentrated near $x = 0$, whereas in the
other there are maxima near $x = \pm 1$. This is illustrated
in Figure \ref{fig:epssq-0.07} for $M = 2$ and
Figure \ref{fig:epssq-0.028} for $M = 3$. The
symmetry-breaking pitchfork bifurcation occurs on the branch
where the maxima are concentrated near $x = 0$ close to (but
not exactly at) the value of $\epsilon$ for which $y'(\pm 1) =
0$. The new branches consist of solutions where one maximum
leaves the centre and approaches one of the boundaries. This is
illustrated in the middle row of panels of Figure \ref{fig:bifurcation-diagram} for $M =
2$ and Figure \ref{fig:epssq-0.023} for $M = 3$. As
$\epsilon \rightarrow 0$, the symmetric solution with maxima concentrated
near the centre tends to a solution with $M$ interior spikes; the
symmetric solution with maxima near $x = \pm 1$ tends to a
solution with 2 boundary layer spikes and $M - 2$ interior spikes;
the solutions emanating from the pitchfork bifurcation tend
to solutions with 1 boundary layer spike and $M - 1$ interior
spikes. This is illustrated in the bottom row of panels of Figure
\ref{fig:bifurcation-diagram} for $M = 2$ and Figure
\ref{fig:epssq-0.00223-2} for $M = 3$.

There are two further remarks to make regarding these
observations. The first is that the number of interior
maxima $M$  does not change through the bifurcations;
hence our observation that each disconnected component is
characterized by $M$. One consequence of this is that
the four solutions we can generate  by choosing different
combinations of boundary layers (\ref{inner}) for a given
number of interior spikes are not all on the same component
of the bifurcation diagram. For example, in Figure
\ref{fig1}, solutions (b) and (c) are connected in the
bifurcation diagram, but lie on a different component to
solutions (a) and (d), which are themselves on different
components.

The second is that close to the bifurcations the
oscillations fill the domain. Thus a boundary layer analysis
in which there are a finite number of interior spikes
separated from boundary layers by a spike-free outer region
will never be able to capture the bifurcations. To capture
the bifurcations we need to generate asymptotic solutions in
which the interior spikes go all the way to the boundary.

Deflated continuation has successfully revealed an enormous
amount of information regarding the solutions to
\eqref{maineqn}, but it does not explain why the bifurcation
diagram possesses this structure or predict the locations of
the alternating fold and pitchfork bifurcations.  Using the
intuition we have gained from the numerical results, we now
turn to asymptotic methods to see if we can predict these
features analytically.

\begin{figure}
\centering
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-7.0000e-02/solution-3.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-7.0000e-02/solution-4.pdf}}
}
\
\caption{The two solutions for $M = 2$ at $\epsilon^2 =
0.07$, between the first fold (at $\epsilon^2 \approx 0.08135$)
and its subsequent pitchfork (at $\epsilon^2 \approx 0.05509$).
The maxima in (a) are more concentrated towards the centre,
whereas (b) has maxima near the boundaries.}
\label{fig:epssq-0.07}
\end{figure}

\begin{figure}
\centering
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.8000e-02/solution-5.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.8000e-02/solution-6.pdf}}
}
\
\caption{The two solutions for $M = 3$ at $\epsilon^2 =
0.028$, between its originating fold (at $\epsilon^2 \approx 0.02953$)
and its subsequent pitchfork (at $\epsilon^2 \approx 0.02466$).
The maxima in (a) are more concentrated towards the centre,
whereas (b) has maxima near the boundaries. Compare to Figure
\ref{fig:epssq-0.07}, the corresponding diagram for $M = 2$.}
\label{fig:epssq-0.028}

\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.3000e-02/solution-6.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.3000e-02/solution-32.pdf}}
}
\\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.3000e-02/solution-5.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.3000e-02/solution-31.pdf}}
}
\caption{The four solutions for $M = 3$ at $\epsilon^2 = 0.023$,
after its pitchfork bifurcation at $\epsilon^2 \approx 0.02466$.
The two symmetric solutions (a) and (b) lie on the same
branch as \ref{fig:epssq-0.028}a and \ref{fig:epssq-0.028}b
respectively. The branches (c) and (d) have bifurcated from
(a) and are characterized by one of the interior maxima
approaching the boundary. Compare to the middle row of panels of Figure
\ref{fig:bifurcation-diagram}, the corresponding solutions for $M =
2$.}
\label{fig:epssq-0.023}
\end{figure}

\begin{figure}
\centering
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.2300e-03/solution-6.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.2300e-03/solution-32.pdf}}
}
\\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.2300e-03/solution-5.pdf}}
}
\
\subfigure[]{
\scalebox{0.5}{\includegraphics{figures/src/results/epssq-2.2300e-03/solution-31.pdf}}
}
\caption{The four solutions for $M = 3$ at $\epsilon^2 =
0.00223$. The solutions are labeled as in
\ref{fig:epssq-0.023}. The symmetric solution with maxima
near the centre has $M$ interior layers; the symmetric
solution with maxima near the boundary has 2 boundary layers
and $M - 2$ interior layers; the asymmetric branches have 1
boundary layer and $M - 1$ interior layers. Compare to
the bottom row of panels of Figure \ref{fig:bifurcation-diagram}, the corresponding diagram
for $M = 2$.}
\label{fig:epssq-0.00223-2}
\end{figure}

\section{Asymptotic analysis}
\subsection{Asymptotic approximation using Kuzmak's method}
\label{kuzmak}
To be able to predict the bifurcations we have seen in solutions of
\eqref{maineqn} we need to be able to generate asymptotic solutions in
which the interior spikes fill the domain, that is, solutions which are
rapidly oscillating.
 We  construct such
asymptotic solutions using the
method of Kuzmak \cite{kuzmak1959}.

We need to allow the frequency of the oscillation to vary slowly. Thus
(as in the WKB method) we define the fast scale as $X = \phi(x)/\epsilon$,
where the function
$\phi(x)$ is to be determined. We then look for solutions
$y(x,X)$, treating the slow scale $x$ and the fast scale $X$ as
independent. We remove the indeterminacy this generates, and avoid
secular terms in $X$,  by imposing
exact periodicity in $X$ with period 1.

From the chain rule we have
\begin{eqnarray*}
\fdd{y}{x} & = & y_x + \frac{\phi'}{\epsilon} y_X,\\
\sdd{y}{x} & = & y_{xx} +  \frac{2\phi'}{\epsilon} y_{xX} + \frac{\phi''}{\epsilon}
y_X + \frac{(\phi')^2}{\epsilon^2} y_{XX},
\end{eqnarray*}
where $\phi' = \fdd{\phi}{x}$, and a subscript denotes partial differentiation.
Thus  equation \eqref{maineqn} becomes
\begin{equation}
 (\phi')^2 y_{XX} + \epsilon(2 \phi' y_{xX} + \phi'' y_{X}) + \epsilon^2
y_{xx} + 2(1-x^2) y + y^2 = 1.\label{eqn}
\end{equation}
We now pose a series expansion  in powers of $\epsilon$:
\[ y \sim y_0 + \epsilon y_1 + \cdots.\]
At leading order this gives
\begin{equation}
(\phi')^2 \spd{y_0}{X} + 2(1-x^2) y_0 + y_0^2 = 1,\label{leading}
\end{equation}
with $y_0$ periodic in $X$, with period 1.
If (\ref{leading}) were a linear equation then the solutions would be
exponentials and our asymptotic method would simply be the WKB
method. The fact that (\ref{leading}) is nonlinear means the fast
oscillator is not simply harmonic, and we have to work a little bit
harder to describe the oscillations.

Multiplying (\ref{leading}) by $2\pd{y_0}{X}$ and integrating gives
\[(\phi')^2 \left(\pd{y_0}{X}\right)^2 + 2(1-x^2) y_0^2 + \frac{2}{3}y_0^3 =
2y_0 + A(x),\]
where the constant of integration, $A$, depends on the slow scale $x$.
Separating the variables and integrating again gives
\begin{equation}
 \pm\phi' \int_0^{y_0}\frac{\d y}{(A(x) + 2y - 2(1-x^2)y^2 - 2
  y^3/3)^{1/2}}  = X + \mu(x) .\label{1}
\end{equation}
The relevant values of $A(x)$ are those for which the cubic in the
denominator has three
real roots, $Y_0 <Y_1 <Y_2$, say. The cubic is positive for values
$Y_1<y<Y_2$. Periodicity of $y_0$ in $X$ is achieved by integrating
the positive square root from $Y_1$ to $Y_2$ and then the negative
square root from
$Y_2$ to $Y_1$. Setting the period equal to unity therefore implies
\begin{equation}
\phi' = \left(2\int_{Y_1}^{Y_2} \frac{\d y}{(A(x) + 2y - 2(1-x^2)y^2 - 2
  y^3/3)^{1/2}} \right)^{-1}.\label{phiprime}
\end{equation}
Note\footnote{In the WKB method
$\phi'$ would be independent of $A$.} that $\phi'$ depends on $A$ but not on $\mu$.

We have thus far determined the leading-order solution $y_0$ and the fast
scale of oscillation $\phi$ in terms of the two unknown slow functions $A(x)$
and $\mu(x)$, which correspond roughly to the slowly modulated
amplitude and  phase of the oscillation. To determine these functions
we need to proceed to higher orders in the asymptotic expansion.

Equating coefficients of $\epsilon$ in (\ref{eqn}) gives
\[(\phi')^2 \spd{y_1}{X} + 2(1-x^2) y_1 + 2 y_0 y_1 = - 2 \phi'
\mpd{y_0}{x}{X} - \phi'' \pd{y_0}{X}.\]
The homogeneous version of this equation is satisfied by both
\[ \pd{y_0}{A} \quad \mbox{ and } \quad \pd{y_0}{\mu}.\]
Thus, by the Fredholm alternative, in order for there to be a
solution for $y_1$ we have the solvability conditions
\begin{eqnarray}
 2 \phi'
\int_0^1\mpd{y_0}{x}{X} \pd{y_0}{A}\, \d X  + \phi'' \int_0^1
\pd{y_0}{X} \pd{y_0}{A} \, \d X & = & 0,\\
 2 \phi'
\int_0^1\mpd{y_0}{x}{X} \pd{y_0}{\mu}\, \d X  + \phi'' \int_0^1
\pd{y_0}{X} \pd{y_0}{\mu} \, \d X & = & 0.\label{fred2}
\end{eqnarray}
These equations are our differential equations for $A$ and $\mu$ as
functions of $x$.

To enable us to write down these differential equations explicitly,
let us define  the function $Y(X,x,\Phi,A)$ by
\begin{eqnarray}
 \Phi \int_{Y_1(A,x)}^{Y}\frac{\d y}{c(A,x,y)^{1/2}}  &=&
 X  \label{2a}, \quad 0<X<X^*(A,x,\Phi) \\
X^*(A,x,\Phi) + \Phi \int^{Y_2(A,x)}_{Y}\frac{\d y}{c(A,x,y)^{1/2}}
&=& X  \label{2b}, \quad X^*(A,x,\Phi)<X<2X^*(A,x,\Phi), \qquad
\end{eqnarray}
and the function $\Phi(A,x)$ by
\begin{equation}
 \Phi(A,x) = \left(2\int_{Y_1(A,x)}^{Y_2(A,x)} \frac{\d y}{c(A,x,y)^{1/2}}
 \right)^{-1},\label{3}
\end{equation}
where
\begin{eqnarray}
 c(A,x,y) &=&  A + 2 y - 2(1-x^2)y^2
- \frac{2}{3}y^3,\label{c}\\
X^*(A,x,\Phi)& = & \Phi \int_{Y_1(A,x)}^{Y_2(A,x)}\frac{\d
   y}{c(A,x,y)^{1/2}}.
\end{eqnarray}
Then $y_0 = Y(X+\mu(x),x,\Phi(A(x),x),A(x))$. Note that (\ref{3}) gives
 $X^*(A,x,\Phi(x,A))=1/2$ as we would expect, since
 $\Phi(A(x),x)=\phi'$ was chosen
 to make the period 1 in $X$. We now have
\begin{eqnarray*}
 \mpd{y_0}{x}{X} &=&  \mpd{Y}{x}{X} +
\mpd{Y}{\Phi}{X}\left(\pd{\Phi}{x} + A'\pd{\Phi}{A}\right) +
\mpd{Y}{A}{X}A' +   \spd{Y}{X}\mu',\\
\pd{y_0}{A} & =& \pd{Y}{A} + \pd{Y}{\Phi}\pd{\Phi}{A},\\
\pd{y_0}{\mu} & =& \pd{Y}{X},\\
\phi'' & = &\pd{\Phi}{x} + A'\pd{\Phi}{A},
\end{eqnarray*}
and the solvability conditions are
\begin{eqnarray}
\lefteqn{ 2 \Phi
\int_0^1\left( \mpd{Y}{x}{X} +
\mpd{Y}{\Phi}{X}\left(\pd{\Phi}{x} + A'\pd{\Phi}{A}\right) +
\mpd{Y}{A}{X}A' +   \spd{Y}{X}\mu'\right) \left(\pd{Y}{A} +
\pd{Y}{\Phi}\pd{\Phi}{A}\right)\, \d X  }\nonumber \hspace{10cm}&&\\*
\mbox{ } +
\left(\pd{\Phi}{x} + A'\pd{\Phi}{A}\right)\int_0^1 \pd{Y}{X}
\left(\pd{Y}{A} + \pd{Y}{\Phi}\pd{\Phi}{A}\right) \, \d X & = &
0,\hspace{2cm}\label{mu}\\
\lefteqn{ 2 \Phi
\int_0^1\left( \mpd{Y}{x}{X} +
\mpd{Y}{\Phi}{X}\left(\pd{\Phi}{x} + A'\pd{\Phi}{A}\right)+
\mpd{Y}{A}{X}A' +   \spd{Y}{X}\mu'\right)
\pd{Y}{X}\, \d X}\nonumber \hspace{10cm}&&\\
\mbox{ }  + \left(\pd{\Phi}{x} + A'\pd{\Phi}{A}\right) \int_0^1
\left(\pd{Y}{X}\right)^2 \, \d X & = & 0.\hspace{2cm}\label{A}
\end{eqnarray}
Because of periodicity, any terms which are exact derivatives in $X$
will integrate to zero.
Moreover, $Y$ and its derivatives with respect to $x$, $\Phi$ and $A$ are even,
while $Y_X$ and derivatives with respect to $x$, $\Phi$ and $A$ are
odd.
Thus in
fact equation (\ref{mu}) reduces to
\begin{equation}
\mu'=0,\label{mu3}
\end{equation}
so that $\mu$ is in fact constant. Since $Y$ is periodic in $X$ with
period $1$ we may take $\mu \in [0,1)$ without loss of generality.
Equation (\ref{A}) can be written as
\begin{eqnarray}
\Phi \pd{\overline{Y_X^2}}{x} + \Phi \left(\pd{\Phi}{x} +
A'\pd{\Phi}{A}\right)  \pd{\overline{Y_X^2}}{\Phi} + \Phi A' \pd{\overline{Y_X^2}}{A}
+  \left(\pd{\Phi}{x} +
A'\pd{\Phi}{A}\right) \overline{Y_X^2} &=& 0,\label{A1}
\end{eqnarray}
where
\[ \overline{Y_X^2} = \int_0^1 \left(\pd{Y}{X}\right)^2 \, \d X.\]
Remarkably, eqn (\ref{A1}) is simply
\begin{equation}
\Phi \fdd{ \overline{Y_X^2}}{x}+  \fdd{\Phi}{x}\overline{Y_X^2} =
\fdd{}{x}\left(\Phi \overline{Y_X^2}\right)= 0,\label{Asol1}
\end{equation}
so that
\begin{equation}
\Phi \overline{Y_X^2} = \mbox{constant} = k,\label{Asol}
\end{equation}
say.
Now, since
\[
\Phi^2 \left(\pd{Y}{X}\right)^2   =
 A+2Y - 2(1-x^2)Y^2-\frac{2}{3}Y^3,
\]
\begin{eqnarray}
\Phi \overline{Y_X^2} &=&\frac{1}{\Phi} \int_0^1 \left( A + 2 Y - 2(1-x^2)Y^2
- \frac{2}{3}Y^3\right)\, \d X \nonumber \\
& = & 2\int_{Y_1(A,x)}^{Y_2(A,x)} \left( A + 2 y - 2(1-x^2)y^2
- \frac{2}{3}y^3\right)^{1/2}\, \d y = k.\label{Asolution}
\end{eqnarray}
This is an implicit solution for $A(x)$, and is equivalent to equation
(54) in \cite{wong2008}, which was determined  by other means.
In fact, it is nothing more than the principle of adiabatic invariance
\cite{LandauLifshitz}, which states that a trajectory can be
approximated by moving slowly from one closed orbit to another as $x$
varies (closed
in terms of the fast scale $X$ when treating $x$ as constant) in such a
way that the enclosed area remains constant.
We see that equation (\ref{Asol1}) follows directly from (\ref{fred2}) once we
realise that $\pd{y_0}{\mu} = \pd{y_0}{X}$.

In Fig.~\ref{fig:Asoln} we show $A$ as a function of $x$ for integer
values of $k$ between $1$ and $15$. For
  $0<k<k_1 \approx 6.78823$ the solution (\ref{Asolution})
is valid in the whole domain $-1<x<1$. However, we will see in
\S\ref{sec:turningpoints} that
 for $k>k_1$ there are turning points at  $x=\pm x^*$ at which
  $\Phi=0$. For $|x|>x^*$ the solution will cease to be oscillatory
  and will instead be described by the outer solution
  (\ref{outersol}). Thus values $0<k<k_1$ correspond to solutions in
  which the spikes fill the domain, while values $k>k_1$ correspond to
  solutions in which there is an interior region near $x=0$ containing
  spikes, separated from the boundary layers by the  spike-less outer solution.

In Fig.~\ref{fig:Yexample} we show
 $Y$ as a function of $X$ when $k=5$ and $A$ is given by
(\ref{Asolution}), for $x = 0$, $0.2$, $0.4$, $0.6$, $0.8$, $1$. This
illustrates the fact that the form of the oscillation varies with
position, which is due to the leading-order nonlinearity in
(\ref{maineqn}), which causes the underlying oscillator
(\ref{leading}) to be nonlinear.

\begin{figure}
\centering
\includegraphics[height=8cm]{figures/figk.pdf}
\caption{$A$ as a function of $x$ for different values of $k$. The
  upper and lower curves are $A_1(x)$ and $A_2(x)$ respectively. For
  $0<k<k_1 \approx 6.78823$ the solution $A(x)$ stays between $A_1$
  and $A_2$ for all $-1<x<1$. For $k>k_1$ there are  turning points at
 $x=\pm x^*$ at which
  $A(\pm x^*) = A_1(\pm x^*)$.}
\label{fig:Asoln}
\end{figure}

\begin{figure}
\centering
\includegraphics[height=8cm]{figures/Yexample0to1step0dot2.pdf}
\caption{The function $Y(X,x,\Phi(x,A(x)),A(x)$  for $k=5$ at $x=0$
  (bottom), $0.2$, $0.4$, $0.6$, $0.8$, and $1$ (top). Because of the
  leading-order nonlinearity in (\ref{maineqn}), the underlying oscillator
  (\ref{leading}) is nonlinear, so that the form of the oscillation (and not
  just the amplitude) varies with position.}
\label{fig:Yexample}
\end{figure}

We have now determined the leading-order solution, up to the imposition
of the boundary conditions. To summarise, we have
\begin{equation}
y_0 = Y\left(\frac{\phi(x)}{\epsilon}+\mu,x,\Phi(x,A(x)),A(x)\right),
\qquad \phi'(x)  =  \Phi(A(x),x),
\end{equation}
where $Y(X,x,\Phi,A)$ is the function given by (\ref{2a})-(\ref{2b}) and
\begin{eqnarray*}
 \Phi & =& \left(2\int_{Y_1(A,x)}^{Y_2(A,x)}
  \frac{\d y}{(A +
    2y - 2(1-x^2)y^2 - 2
  y^3/3)^{1/2}} \right)^{-1},\\
k & = & 2\int_{Y_1(A,x)}^{Y_2(A,x)} \left( A + 2 y - 2(1-x^2)y^2
- \frac{2}{3}y^3\right)^{1/2}\, \d y,
\end{eqnarray*}
where $\mu$ and $k$ are constants to be determined by the boundary
conditions. Note that we can choose $\phi(0)=0$ without loss of generality.

\subsection{Turning Points}
\label{sec:turningpoints}
Before we investigate the imposition of the boundary conditions to
determine the remaining unknown constants, we first discuss in more
detail the turning points that may appear in the solution.
These occur whenever \mbox{$\phi'(x) =0$}, i.e.
$\Phi(A(x),x) = 0$. Looking at (\ref{3}), we see this will happen when
$Y_0 \rightarrow Y_1$, that is, the left-most roots of $c(y)$ coalesce. (We
might also expect something strange to happen when the right-most
roots of $c(y)$ coalesce, that is, when $Y_1 \rightarrow Y_2$. In that case,
however, because the range of integration in (\ref{3}) shrinks to zero
at the same rate at which the integrand blows up, $\Phi$ remains
finite. The case $Y_1 \rightarrow Y_2$ corresponds to the limit in which the
constant $k \rightarrow 0$.)

Thus, at the turning point, we have a double root of $c$, so that
there is a simultaneous root of $c$ and $\pd{c}{y}$.
Such a double root occurs when $A = A_1(x)$ or $A=A_2(x)$ where
\begin{eqnarray*}
A_1(x) & = & \frac{2}{3}\left(5 - 9 x^2 + 6 x^4 - 2 x^6 + 2(2  -
    2 x^2  +  x^4 )^{3/2}\right),\\
A_2(x) & = & \frac{2}{3}\left(5 - 9 x^2 + 6 x^4 - 2 x^6 - 2(2 -
   2 x^2  +  x^4  )^{3/2}\right).
\end{eqnarray*}
When $A(x) = A_1(x)$ the left most roots of $c(y)$ coalesce ($Y_0 \rightarrow
Y_1$). At $A(x) = A_2(x)$ the right most roots of $c(y)$ coalesce
($Y_1 \rightarrow Y_2$).
The functions
$A_1(x)$ and $A_2(x)$ form the upper and lower boundaries in
Fig. \ref{fig:Asoln} respectively.

The limiting value of $k$ for which there are no turning points in
$[-1,1]$ and the oscillations are present all the way to the boundary
is given by $A(1) = A_1(1)$, that is, it is the value of $k$ for which the
turning points lie at $x = \pm 1$.
We find this is
\[ k = k_1 \approx 6.78823 .\]
 For  $k>k_1$ there will be an interior region between the two turning
 points $x=\pm x^*$ in which the solution is rapidly oscillating
 (i.e.~in which there are spikes), separated from the boundary layers
 by the  spike-less outer solution (\ref{outersol}).

\subsection{Boundary conditions}

Let us now seek to determine the remaining unknown constants $k$ and
$\mu$ by imposing the boundary conditions on our asymptotic solution.
We first look for solutions in which there are no turning points,
that is, in which the Kuzmak
approximation we have derived is valid all the way to the boundary.
The conditions $y(-1) = y(1) = 0$ imply
\begin{equation}
 Y\left(\frac{\phi(\pm 1)}{\epsilon}+\mu,\pm 1,\Phi(\pm 1,A(\pm 1)),A(\pm
1)\right) = 0.\label{bc}
\end{equation}
Now, the function $Y(X,\pm 1,\Phi(\pm 1,A(\pm 1)),A(\pm
1))$ has two zeros in the unit cell $0<X<1$ (see
Fig.~\ref{fig:Yexample}). Let us denote the smaller by $
X_0$; the larger is then given by $1-X_0$.
Then,  at leading order, (\ref{bc}) gives
\begin{equation}
 \frac{\phi(1)}{\epsilon} + \mu = n\pm  X_0, \qquad \frac{\phi(-1)}{\epsilon}
+ \mu = m \pm  X_0,\label{bc1}
\end{equation}
where $n$, $m \in {\mathbb Z}$.
These are two equations for the two unknown constants $k$ and
$\mu$.

\iffalse
For ease of reference we write explicitly the equations using
different choices of sign, noting that $\phi(1) = -\phi(-1)$, to give
\begin{eqnarray}
\frac{\phi(1)}{\epsilon}  = n+  X_0 - \mu,&& \qquad \frac{\phi(1)}{\epsilon}
 = -m+  X_0+\mu,\label{pp}\\
\frac{\phi(1)}{\epsilon}  = n-  X_0 - \mu,&& \qquad \frac{\phi(1)}{\epsilon}
 = -m-  X_0+\mu,\label{mm}\\
\frac{\phi(1)}{\epsilon}  = n+  X_0 - \mu,&& \qquad \frac{\phi(1)}{\epsilon}
 = -m-  X_0+\mu,\label{pm}\\
\frac{\phi(1)}{\epsilon}  = n-  X_0 - \mu,&& \qquad \frac{\phi(1)}{\epsilon}
 = -m+  X_0+\mu.\label{mp}
\end{eqnarray}
\fi
Eliminating $\phi(1)$,  noting that $\phi(1) = -\phi(-1)$, gives the
four possibilities
\begin{equation}
  n+m  = \quad 2\mu, \quad 2 \mu, \quad -2X_0 + 2 \mu, \quad 2X_0 + 2
  \mu,\label{nm}
\end{equation}
corresponding to choosing the signs in (\ref{bc1}) as $+-$, $-+$, $++$
and $--$ respectively.
In the first two cases (which give a symmetric solution) we must have
$\mu=0$ (corresponding to a solution with a minimum at the origin) or
$\mu=1/2$ (corresponding to a solution with a maximum at the origin).
We first analyse these symmetric solutions, and their associated
bifurcations, before returning to consider the non-symmetric solutions.

\subsection{Symmetric Solutions}
We consider here  solutions in which $\mu=0$   or
$\mu=1/2$. In this case equations (\ref{bc1}) reduce to
\begin{equation}
\frac{\phi(1)}{\epsilon}  = n \pm  X_0
\qquad \mbox{ and } \qquad
\frac{\phi(1)}{\epsilon}  = n+ \frac{1}{2} \pm  X_0,\label{bc1a}
\end{equation}
respectively. We need to find the values of $k$ for which one of these
equations is satisfied.

We show in Figure \ref{fig:intersect} the curves
\[ n \pm X_0 \quad \mbox{ (black)}\qquad \mbox{and} \qquad n
+\frac{1}{2}\pm X_0
\quad\mbox{ (blue)}\]
as a function of $k$ for $n$ in the range $20$ to $24$.
The noses of these curves correspond to the value of $k$ at which $Y=
Y_X=0$ at $x = \pm 1$, which means that $A(\pm 1) = 0$.
This corresponds to
\[ k = k_0 = \frac{16\times 3^{3/4} \pi^{3/2}}{5 \Gamma(1/4)^2} \approx 3.08997 .\]
Also shown in Figure  \ref{fig:intersect} (green) are the curves
$\phi(1)/\epsilon$ for $\epsilon = 0.01 + 0.004 j$
with $j$ ranging from $-2$ to $4$. For a given value of $\epsilon$, the
intersections between the corresponding green curve and the black and
blue  curves give solutions of (\ref{bc1a}), and therefore correspond to
symmetric solutions of (\ref{maineqn}).
We see that as $\epsilon$ decreases there is a succession of fold
bifurcations as a new pair of intersection points appears near $k =
k_0$.

Initially, as $\epsilon$ decreases, one of the two new intersection points
moves to the left and one to the right. However, the left-moving point
soon reaches the nose of the blue/black curve, after which both
intersection points move to the right, in the direction of increasing $k$.
Eventually both approach  the limiting value $k =
k_1$, at which point a turning point appears near the boundary, and
another analysis takes over, since the boundary conditions should not
then be applied to the Kuzmak solution.
After the turning point appears these solutions transition into
solutions whose oscillations do not
encompass the whole domain, but are restricted some smaller interval.

\begin{figure}
\centering
\includegraphics[height=8cm]{figures/intersect.pdf}
\caption{The curves $n \pm X_0$ (black) and $n+1/2\pm X_0$
(blue) as a function of $k$ for $n$ in the range $20$ to $24$.
Also shown are the curves $\phi(1)/\epsilon$ for values of $\epsilon$
indicated (green). The intersections between
these curves give symmetric solutions of the problem.}
\label{fig:intersect}
\end{figure}

In Figure \ref{fig:bif} we show the figure analogous to Fig.~\ref{fig:intersect}
for  $\epsilon = 0.0335$. We illustrate the four intersection points,
along with the corresponding asymptotic approximation of the solutions.

\subsubsection{Maximum number of spikes}
The number of maxima in each solution is the number of complete periods
in $X$, which is
\[ \frac{\phi(1)- \phi(-1)}{\epsilon} =
\frac{2\phi(1) }{\epsilon}.\]
Since $\phi(1)$ is monotonically decreasing in $k$ (see
Fig.~\ref{fig:intersect}), the largest value
of $\phi(1)$ occurs for $k = k_0$. This gives
\[ 2\phi(1) \approx 0.472537.\]
Thus the maximum number of spikes is
\[ \left\lfloor\frac{0.472537}{\epsilon}\right\rfloor \]
where $\lfloor x \rfloor$ denotes the largest integer less than $x$,
in agreement with the results of \cite{wong2008}.

\subsubsection{Proportion of solutions with oscillations filling the
  domain}
The description in the introduction indicated that we might gradually add
spikes into the
interior of the domain until there is no room to fit any more.
Thus we might have expected that the proportion of solutions
containing turning points (i.e.~the proportion containing some
spike-free region) should tend to 1 as $\epsilon \rightarrow 0$. However, minimum
number of spikes which may be present in a solution which does not
have turning points is given by the minimum value of
\[ \left\lfloor\frac{2\phi(1) }{\epsilon}\right\rfloor\]
for $k_0<k<k_1$, which occurs when $k=k_1$, and is
\[ \left\lfloor\frac{0.415}{\epsilon}\right\rfloor.\]
Only for solutions with fewer spikes will the oscillations not fill
the domain.
Thus the proportion of solutions which do not have turning points is
approximately $0.12$
in the limit as $\epsilon \rightarrow 0$.

\subsubsection{Position of the fold bifurcations}

The fold bifurcation is not exactly at  the nose of the blue or black
curve in Fig. \ref{fig:intersect}, though it approaches it as
$\epsilon \rightarrow 0$.
At the bifurcation point the green and blue/black curves are tangent,
so that
\begin{equation} \frac{1}{\epsilon}\fdd{\phi(1)}{k} = -\fdd{X_0}{k},\label{fold1}
\end{equation}
which must be satisfied at the same time as
\begin{equation} \frac{2\phi(1)}{\epsilon}  = n-  2X_0\label{fold2}
\end{equation}
(minus sign because the tangency is on the lower branch of the
blue/black curve).
Equations (\ref{fold1}) and (\ref{fold2}) form  two equations for $k$ and $\epsilon$
as a function of $n$.
\begin{figure}
\centering
\includegraphics[height=8cm]{figures/folds.pdf}
\caption{The values of $\epsilon$ at the fold bifurcations, as a function
  of $n$. Equations (\ref{fold1}) and (\ref{fold2}) are valid in the limit
  $\epsilon \rightarrow 0$, corresponding to $n \rightarrow \infty$. The first value of
  $n$ for which a tangency point exists is $n=4$, which
  corresponds to the third fold bifurcation. Crosses indicate
  numerical results, circles the asymptotic approximation.}
\label{fig:folds}
\end{figure}

We can approximate (\ref{fold1}), (\ref{fold2}) in the limit of small
$\epsilon$
(large $n$),
taking advantage of the fact that the bifurcation point is close to $k
=k_0$. Setting $k = k_0 + \delta$ we have
\[ X_0^2 \sim a \delta+\cdots \qquad \mbox{ where }\qquad
 a =  \left.\fdd{X_0^2}{k}\right|_{k=k_0}.
\]
Equation (\ref{fold1}) gives
\[
- \frac{a^{1/2}}{2 \delta^{1/2}} \sim
\frac{1}{\epsilon}\left.\fdd{\phi(1)}{k}\right|_{k=k_0}, \]
so that
\[ \delta \sim \frac{a
  \epsilon^2}{4}\left(\left.\fdd{\phi(1)}{k}\right|_{k=k_0}\right)^{-2}\]
Since
\[
\phi(1) \sim  \left.\phi(1)\right|_{k=k_0} + \delta
\left.\fdd{\phi(1)}{k}\right|_{k=k_0}+\cdots.\]
equation (\ref{fold2}) now gives
\[
\frac{2 \left.\phi(1)\right|_{k=k_0}}{\epsilon} +
 \frac{a
  \epsilon}{2}\left(\left.\fdd{\phi(1)}{k}\right|_{k=k_0}\right)^{-1} \sim n
+  a  \epsilon\left(\left.\fdd{\phi(1)}{k}\right|_{k=k_0}\right)^{-1}
\]
Thus
\begin{eqnarray}
\epsilon &\sim& \frac{2 \left.\phi(1)\right|_{k=k_0}}{ n
+  \frac{a
  \epsilon}{2}\left(\left.\fdd{\phi(1)}{k}\right|_{k=k_0}\right)^{-1}}
\sim\frac{2 \left.\phi(1)\right|_{k=k_0}}{ n
+
 \frac{a
   \left.\phi(1)\right|_{k=k_0}}{n}
\left(\left.\fdd{\phi(1)}{k}\right|_{k=k_0}\right)^{-1}}\nonumber \\
&
\approx&\frac{0.472537}{ n
-
 \frac{0.8344}{n}}.\label{asyfold}
\end{eqnarray}

In Figure \ref{fig:folds} we show  the values of $\epsilon$ at the fold
bifurcations as a function
  of $n$.  The first value of
  $n$ for which a tangency point exists is $n=4$, which
  corresponds to the third fold bifurcation. Although the asymptotic
  approximation is valid as $n \rightarrow \infty$, the agreement with the
  numerical solution is
  remarkably good even at small $n$.

\subsection{Non-symmetric solutions}
Let us now return to consider the other solutions of (\ref{bc1}).
From (\ref{nm}) we see that for non-symmetric solutions we must have
 $\mu = \pm X_0$ (modulo 1) or  $\mu = 1/2 \pm X_0$ (modulo 1).
In each case we find $n=-m$. For $\mu = \pm X_0$ we find  that
(\ref{bc1}) becomes
\begin{equation} \frac{\phi(1)}{\epsilon} = n.\label{one}
\end{equation}
Similarly, for $\mu = 1/2\pm X_0$ we find that (\ref{bc1}) becomes
\begin{equation} \frac{\phi(1)}{\epsilon} = n-1/2.\label{half}
\end{equation}
Using Fig.~\ref{fig:intersect} to illustrate these solutions,
we see that they correspond to the intersection points between the green
curves $\phi(1)/\epsilon$ and the horizontal
lines $n$ and $n-1/2$. The value of $\mu$ then corresponds to the
vertical distance from this intersection point to the nearest black
curve (modulo 1). Each intersection point gives two asymmetric
solutions, corresponding to the two values $\mu =  \pm X_0$ in case
(\ref{one}) or $\mu = 1/2
\pm X_0$ in case (\ref{half}).

In Figure \ref{fig:bifa} we show these intersection points and
corresponding $\mu$ values for  $\epsilon = 0.0335$.
There are two intersection points, each corresponding to two
solutions.
The corresponding asymptotic approximation of the solutions is also
illustrated.

When $X_0 = 0$ we find $\mu = 0$ or $\mu = 1/2$, corresponding to a
pitchfork bifurcation  at which the non-symmetric solutions bifurcate
from one of the symmetric
branches.

\subsubsection{Position of the pitchfork bifurcations}

The pitchfork bifurcation occurs when the intersection point between
the green and blue/black curves lies exactly at the nose of those
curves. At that point
\begin{equation} X_0 = 0 \qquad \mbox{ and } \qquad \frac{2\phi(1)}{\epsilon}  =n.
\label{pitch}
\end{equation}
The first equation gives $k = k_0 \approx 3.08997$. Then $\phi(1)$ is
determined and the second equation gives
\begin{equation}
 \epsilon = \epsilon_n = \frac{2\phi(1)}{n}\approx \frac{0.472537}{n}.\label{asypitch}
\end{equation}

\begin{figure}
\centering
\includegraphics[height=8cm]{figures/pitch.pdf}
\caption{The values of $\epsilon$ at the pitchfork bifurcations, as a function
  of $n$. Equation (\ref{pitch}) is valid in the limit
  $\epsilon \rightarrow 0$, corresponding to $n \rightarrow \infty$.  Crosses indicate
  numerical results, circles the asymptotic approximation.}
\label{fig:pitch}
\end{figure}

In Figure \ref{fig:pitch} we show  the values of $\epsilon$ at the pitchfork
bifurcations as a function
  of $n$.  Although the asymptotic
  approximation is valid as $n \rightarrow \infty$, the agreement with the
  numerical solution is
  remarkably good even at small $n$.

From (\ref{asyfold}) and (\ref{asypitch}) we see that the separation
between the fold and pitchfork bifurcations is approximately
\[ \frac{0.3943}{n^3}\]
as $n \rightarrow \infty$, and that the proportion of values of $\epsilon$ for
which there are $4N+2$ solutions rather than $4N$ solutions therefore
shrinks as $3.737 \epsilon^2$ as $\epsilon \rightarrow 0$.

\begin{figure}
\centering
\scalebox{0.8}{\input{figures/bif.pdf_t}}
\caption{{\bf Symmetric Solutions}. The curves $n \pm X_0$ (black) and $n+1/2\pm X_0$
(blue) as a function of $k$ for $n = 6$, $7$.
The green curve is $\phi(1)/\epsilon$ with $\epsilon = 0.0335$.
The intersection points, highlighted, correspond to symmetric
solutions of the problem. The lower and upper envelopes of the
individual solutions are the curves $Y_1(A(x),x)$ and $Y_2(A(x),x)$
respectively.}
\label{fig:bif}
\end{figure}
\begin{figure}
\begin{center}
\scalebox{0.8}{\input{figures/bifa.pdf_t}}
\end{center}
\caption{{\bf Non-symmetric Solutions}. The curves $n \pm X_0$ (black)
  and $n+1/2\pm X_0$
(blue) as a function of $k$ for $n = 6$, $7$.
The green curve is $\phi(1)/\epsilon$ with $\epsilon = 0.0335$.
The intersection points of the green curve with integer and
half-integer values, highlighted, correspond to non-symmetric
solutions of the problem. The distance of these intersection points
to the nearest black curve give the (signed) value of $\mu$. The lower
and upper envelopes of the
individual solutions are the curves $Y_1(A(x),x)$ and $Y_2(A(x),x)$
respectively.}
\label{fig:bifa}
\end{figure}

\subsection{Solutions with turning points}
Thus far we have  analysed solutions in which the Kuzmak approximation is valid
all the way up to the boundary, which enabled us to capture quite well
the structure of the bifurcation diagram shown in Figure
\ref{fig:bifurcation-diagram}. We now complete our asymptotic analysis
by considering those solutions with turning points, in which the
oscillations are confined to an interior region.

Suppose there are turning points at $\pm x^*$ (with $x^*>0$), so that $A(x^*) =
A_1(x^*)$. For $|x|>x^*$ the solution does not oscillate, and (outside
the boundary layers) $y_0$ is simply given by the outer solution
(\ref{outersol}):
\begin{equation}
 y_{\mathrm{out}}(x) = -1 + x^2 - \sqrt{x^4-2 x^2+2}, \qquad
 |x|>x^*.\label{outer}
\end{equation}
In this case $k$ is determined  (at leading order) by the
condition that
\begin{equation}
 \pd{Y}{X}=0\label{derivative}
\end{equation}
at $x = x^*$, with $Y$ negative, so that the oscillating solution can
join smoothly onto the
non-oscillating solution. Note that
continuity in the solution is automatic, since
at the turning point $Y = Y_1 = Y_0$, so that $Y$ is a root of both
the cubic $c(Y)$ and also its derivative.
 Since, from (\ref{2a})-(\ref{2b}),  $\pd{Y}{X}=0$ (and
$Y$ is negative) when $X=0$, equation (\ref{derivative}) gives
\begin{equation}
 \frac{\phi(x^*)}{\epsilon}+\mu = n, \qquad  -\frac{\phi(x^*)}{\epsilon}+\mu =
 m.\label{jon}
\end{equation}
Thus we are forced to choose either $\mu=0$ or $\mu=1/2$: the central
part of the solutions is symmetric for all solutions with turning points.
Note that
\[ \phi' \sim \frac{a}{\log (x-x^*)},\]
for some constant $a$
as the turning point is approached with the result that the separation
between spikes is $O(\epsilon \log  \epsilon)$ there, in agreement with the
analysis in \cite{macgillivray2000} on the two spike solution.

\begin{figure}
\begin{center}
\scalebox{0.7}{\input{figures/biftp.pdf_t}}
\end{center}
\caption{{\bf Solutions with turning points}.
The green curve is $\phi(x^*)/\epsilon$ with $\epsilon = 0.0335$ and $x^*$
satisfying $A(x^*) =A_1(x^*)$, shown as a function
of $k$.
The intersection points with integer and
half-integer values, highlighted, correspond to solutions of the
problem. Each point gives four distinct solutions, corresponding to
the four combinations of boundary layers at $x=\pm1$.  The lower
and upper envelopes of the
individual solutions are the curves $Y_1(A(x),x)$ and $Y_2(A(x),x)$
respectively. Each solution plot shows both boundary layer
possibilities at each end. For $n=6$ and $n=5.5$ the turning point is
in the boundary layer, with the result that our approximation there is
inaccurate.}
\label{fig:biftp}
\end{figure}

As described in the introduction, the outer solution (\ref{outer})
does not satisfy the boundary conditions
at $x = \pm 1$, where there are boundary layers.
A uniform approximation valid for $|x|>x^*$
is
\begin{eqnarray*}
 y& \sim&
-1 + x^2 - \sqrt{2 - 2 x^2 + x^4} +
 3\, \mathrm{sech}^2\left( \pm \frac{(1 - x)}{\epsilon\sqrt{2}} +
   \tanh^{-1}\left(\sqrt{\frac{2}{3}}\right) \right)\\
&& \mbox { }+
 3\, \mathrm{sech}^2\left( \pm \frac{(1 + x)}{\epsilon\sqrt{2}}+
   \tanh^{-1}\left(\sqrt{\frac{2}{3}}\right) \right).
\end{eqnarray*}

In Figure \ref{fig:biftp} we show the solutions for $\epsilon=0.0335$, for
which $\phi(x^*)/\epsilon$ may take any integer or half-integer value up
to $n=6$. The discontinuity in the gradient of the solution at $x=\pm
x^*$ in these plots is due to the fact that we imposed continuity of
the derivative
only at leading order in $\epsilon$ there, using (\ref{derivative}). Full
continuity of the derivative implies
\[ \fdd{y_{\mathrm{out}}}{x} = \fdd{Y}{x} = \frac{\Phi}{\epsilon}
\pd{Y}{X} + \pd{Y}{x} + \pd{Y}{\Phi}\left(\pd{\Phi}{x} + \pd{\Phi}{A}
  \fdd{A}{x}\right) + \pd{Y}{A} \fdd{A}{x},
\]
which would introduce an $O(\epsilon)$ correction into equations (\ref{jon}).
Each solution curve in Figure \ref{fig:biftp} shows four distinct
solutions overlaid, corresponding to
the four combinations of boundary layers at $x=\pm1$.

These 48 solutions, together with the 8 solutions shown previously in
Figures \ref{fig:bif} and \ref{fig:bifa},
make up the 56 solutions to the problem when $\epsilon=0.0335$.

\section{Conclusion}

The computational and asymptotic analysis
  we have
presented gives a
novel and complete taxonomy of the solutions of Carrier's problem
(\ref{maineqn}).

Using deflated continuation we found a rather striking bifurcation
diagram, containing an apparently infinite
number of mutually disconnected components. Each component (except for the first two)
contains one fold bifurcation, at which two solutions of
(\ref{maineqn})   appear,
and one pitchfork
bifurcation, at which a further two solutions of (\ref{maineqn})
appear. Solutions on the same connected component have the  same
number of interior maxima.  For values of $\epsilon$ which do not lie between the
fold and pitchfork bifurcations of a connected component the number of
solutions of (\ref{maineqn}) is a multiple of 4, as claimed by
 Bender \& Orszag \cite{bender1999}. However, between the fold and
 pitchfork bifurcations the number of solutions is $4n+2$ with $n \in {\mathbb Z}$.

Our asymptotic analysis used Kuzmak's method to construct approximate
solutions of (\ref{maineqn}). Both the fold and pitchfork bifurcation
points were predicted accurately.
We found that the separation between these bifurcation points tends
quickly to zero as $\epsilon \rightarrow 0$, so that the proportion of values of
$\epsilon$ for which there are  $4n+2$ solutions rather than $4n$
solutions tends to zero as $3.737
\epsilon^2$ as $\epsilon
\rightarrow 0$.

We gave an alternative derivation of the result of Wong and Zhao that
the  maximum number of internal maxima
is asymptotically
\[ \left\lfloor\frac{0.472537}{\epsilon}\right\rfloor. \]
Moreover, we found that approximately 12\% of solutions of the problem
have oscillations which fill the domain. The remaining 88\% of
solutions have oscillations in an interior region near $x=0$
separated from boundary layers by a non-oscillating outer solution.

The methods we have used are in no way specific to
(\ref{maineqn}). Carrier's problem provides a nice example, but any
slowly-varying phase plane with closed orbits would be amenable to our
approach.

\bibliographystyle{siam}

Classical Analysis and ODEs (math.CA); Numerical Analysis (math.NA)

Analysis of Carrier's problem


Explicit expressions for the moments of the size of an (n, dn-1)-core partition with distinct parts

Abstract: In a previous paper (arXiv:1608.02262), we used computer-assisted methods to find explicit expressions for the moments of the size of a uniform random (n,n+1)-core partition with distinct parts. In particular, we conjectured that the distribution is asymptotically normal. However, our analysis hinged on a characterization of (n,n+1)-core partitions given by Straub, which is not readily generalized to other families of simultaneous core partitions.In another paper (arXiv:1611.05775) with Doron Zeilberger, we made use of the characterization in terms of posets to analyze (2n+1,2n+3)-core partitions with distinct parts; here, the distribution was found not to be asymptotically normal. Our method involved finding recursive structure in the relevant sequence of posets. We remarked that this method is applicable to other families of core partitions, provided that one can understand the corresponding posets.Here, we use the poset method (and, as before, a computer) to analyze (n,dn-1)-core partitions with distinct parts, where d is a natural number. (This problem was introduced by Straub inarXiv:1601.07161.) We exhibit formulas for the moments of the size, as functions of d with n fixed, and vice versa. We conjecture that the distribution is asymptotically normal as n approaches infinity. Finally, we find formulas for the first few moments, as functions of both n and d.

\section{Introduction}\label{sec:intro}

\begin{figure}[ht]
\begin{center}
\includegraphics[width=.5\textwidth]{young.png}
\caption{Young diagram of the partition $9=4+3+1+1,$ showing the hook lengths of each box.}
\label{fig:young}
\end{center}
\end{figure}

\subsection{$(s,t)$-core partitions}
Recall that the \emph{hook length} of a box in the Young diagram of a partition is the number of boxes to the right (the arm) plus the number of boxes below it (the leg) plus one (the head).  (We use the English convention for Young diagrams; see Figure \ref{fig:young}.)   A partition is an $s$-\emph{core} if its Young diagram avoids hook length $s$ and an $(s,t)$-\emph{core} if it avoids hook lengths $s$ and $t$ [AHJ].  For example, the partition $9=4+3+1+1$ in Figure 1 is a $(6,8)$-core but not a $(6,7)$-core.

The number of $(s,t)$-core partitions is finite iff $s$ and $t$ are coprime, which we shall assume from now on [AHJ].  Let $X_{s,t}$ be the random variable ``size of an $(s,t)$-core partition," where the sample space is the set of all $(s,t)$-core partitions, equipped with the uniform distribution.  In [EZ], with the help of Maple, Zeilberger derived explicit  expressions (as polynomials in $s$ and $t$) for the expectation, variance, and numerous higher moments of $X_{s,t}$.  The original paper noted that ``From the `religious-fanatical' viewpoint of the current `mainstream' mathematician, they are `just' conjectures, but nevertheless, they are \textbf{absolutely certain} (well, at least as absolutely certain as most proved theorems)," and a donation to the OEIS was offered for the theory to make the results rigorous.  Later, it was found that such theory did exist and the results are entirely rigorous; see the updates at the paper's site.

Zeilberger also computed some standardized central moments of $X_{s,t}$ and the limit of these expressions as $s,t\to \infty$ with $s-t$ fixed.  From this he conjectured the limiting distribution.  Perhaps surprisingly, it is abnormal.
\subsection{$(n,n+1)$-core partitions with distinct parts}
Things are not as easy if look at the random variable  ``size of an $(s,t)$-core partition \emph{with distinct parts}.''  In this case, there does not seem to a single formula for the moments in terms of $s$ and $t$.  However, we can consider certain indexed families of core partitions and look for explicit formulas for the moments.

For example, in [S], Straub remarks in a lemma that a partition with distinct parts is an $(n,n+1)$-core iff it has perimeter (largest hook length) less than $n$. Using this, it is easy to show that the number of such partitions is the Fibonacci number.  Further, in [Z], we used Straub's lemma and some experimentation with Maple to derive explicit expressions for the moments, as rational functions of Fibonacci numbers.  Our results give strong evidence that the limiting distribution as $n\to\infty$ \emph{is} normal in this case.
\subsection{The poset characterization}
Unfortunately, we do not see how to generalize the characterization above to other indexed families of partitions.  However, there is another characterization of $(s,t)$-core partitions due to Anderson [A].

Given coprime $s$ and $t$, define the poset
\begin{equation}\label{eq:Pst}
P_{s,t} := \N \setminus (s\N + t\N),
\end{equation}
where $\N=\{ 0,1,2,3, \dots, \}$, where the partial-order relation $c \, \leq_P \, d$
holds whenever $d-c$ can be expressed as $\alpha s + \beta t$ for some $\alpha,\beta \in \N$.  (It can be shown that $P_{s,t}$ is finite with largest element $st-s-t$.)

Anderson defined a bijection between $(s,t)$-core partitions and \emph{order ideals} of $P_{s,t}$.  (Under our convention, a subset  $I$ of a poset $P$ is an order ideal iff $x \in I, y\leq_P x$ $\implies $ $y \in I$.)  Further, the hook lengths of the boxes in the leftmost column in the partition's Young diagram correspond to the labels of the order ideal.

Now, a partition has distinct parts iff there are no consecutive hook lengths in the leftmost column. Thus:
\begin{itemize}
\item[] \emph{$(s,t)$-core partitions with distinct parts are bijective to order ideals of $P_{s,t}$ with no consecutive labels.}
\end{itemize}
\subsection{$(2n+1,2n+3)$-core partitions with distinct parts}
So, given a family of core partitions, we have a corresponding sequence of posets which we can hopefully understand.  In [ZZ], we plotted some of the posets corresponding to $(2n+1,2n+3)$-core partitions with distinct parts and were able to see a recursive structure.  This led to recursions for the generating functions of the partitions.  We were again able to derive explicit expressions for the moments in terms of $n$ and show that the distribution of size is not asymptotically normal as $n\to\infty$.
\section{$(n,dn-1)$-core partitions with distinct parts}
In [S], Straub generalizes the problem in Section 1.2 by considering $(n,dn-1)$-core partitions with distinct parts, where $n$ and $d$ are natural numbers. He proves in Theorem 4.1 that the number of such partitions, call it $N_d(n)$, satisfies a generalized Fibonacci recurrence:
\begin{align}
\begin{split} \label{eq:Nds}
&N_d(1)=1, \,\, N_d(2)=d,
\\
&N_d(n)=N_d(n-1)+dN_d(n-2).
\end{split}
\end{align}
Of course, this reduces to the usual Fibonacci numbers when $d=1$.  Note that we can view $N_d(n)$ as a sequence of polynomials in $d$.

Here, we shall use the poset characterization in Section 1.3 to easily recover Straub's result and discover new conjectures about the distribution of the sizes of the partitions.

\subsection{Understanding the posets}
By Section $1.3$, we know that $(n,dn-1)$-core partitions with distinct parts are bijective with order ideals of $P_{n,dn-1}$ containing no consecutive labels.  We can use the procedure \verb+PW+ in the Maple package \verb+Armin+ accompanying [ZZ] to plot $P_{n,dn-1}$ for various $n$ and $d$.

\begin{figure}[ht]
\begin{center}
\includegraphics[width=.6\textwidth]{pw.png}
\caption{The poset $P_{4,19}=P_{4,4\cdot5-1}$.}
\label{fig:pw}
\end{center}
\end{figure}

For example, Figure \ref{fig:pw} depicts the poset $P_{4,19}$, i.e., the $n=4, d=5$ case.  (When plotting $P_{s,t}$, we use the convention to increment $s$ in the $\downarrow$ direction and $t$ in the $\leftarrow$ direction.  Thus, the largest label, $st-s-t$, is in the lower left corner.)  It is easy to show that this general trapezoidal shape persists for arbitrary values of $n$ and $d$.  We can also see $P_{n,dn-1}$ as a colonnade of $n-1$ vertical pillars with heights $d(n-1)-1,d(n-2)-1,\dots,d-1$.  Further, the tops of the pillars have labels $1,2,\dots,n-1$.

\subsection{Characterizing the order ideals}
Next,  we recover the recursion \eqref{eq:Nds} by enumerating the order ideals of $P_{n,dn-1}$ with no consecutive labels.

Referring to the $n=4, d=5$ example, let $I$ be an order ideal of $P_{4,19}$.  Let $I_k$ be the part of $I$ contained in the $k$th pillar.
\begin{itemize}
\item
If $I_1=\emptyset$, then $I$ is isomorphic to an order ideal of $P_{n-1,d(n-1)-1}=P_{3,5\cdot 3-1}$.
\item
Otherwise, let $x$ be the largest member of $I_1$.  Then $x \in \{1,1+n,\dots,1+(d-1)n\}=\{1,5,9,13,17\}$. For if $21 \in I_1$, then $1,2\in I$, contradicting the assumption that $I$ contains no consecutive labels.  So there are $d=5$ choices for $I_1$.  Further, $I_2$ must be empty; otherwise, again, we have $1,2 \in I$.  Thus the remainder of $I$ is isomorphic to an order ideal of $P_{n-2,d(n-2)-1}=P_{2,5\cdot2-1}$.
\end{itemize}

To summarize, if $I$ is an order ideal of $P_{n,dn-1}$ with no consecutive labels, then either $I$ is isomorphic to an order ideal of $P_{n-1,d(n-1)-1}$, or $I_1$ has $d$ options and the rest of $I$ is isomorphic to an order ideal of $P_{n-2,d(n-2)-1}$.  This proves \eqref{eq:Nds}.

From the above observation, we have the following characterization:

\begin{itemize}
\item[]Any order ideal of  $P_{n,dn-1}$ with no consecutive labels is of the form $I=I_1\cup\cdots\cup I_{n-1}$, where
\begin{itemize}
\item
 Each $I_k$ is either empty or of the form $\{k,k+n,\cdots,k+i_kn\}$, where $i_k \leq d-1$ if $k<n-1$, and $i_{n-1}<d-1$.
 \item
 If $I_k$ is nonempty, then $I_{k+1}$ is empty.
 \end{itemize}
 \end{itemize}

 In short: To make an order ideal, we hang strings of beads from the tops of the pillars in such a way the strings are not too long and adjacent pillars are not both decorated.

 \subsection{Computing the generating function}
 Our ultimate goal is to investigate the distribution of the size of $(n,dn-1)$-core partitions with distinct parts.  To this end, we define the generating function
 \begin{equation}
 G_{d, n}(q):=\sum_p q^{|p|},
 \end{equation}
 where $p$ ranges over $(n,dn-1)$-core partitions with distinct parts, and $|p|$ denotes the size of the partition $p$, i.e., the sum of its parts.  We shall give an efficient scheme for computing $G_{d,n}(q)$ for fixed $d$ and $n$.

Proceeding as in [ZZ], we first compute the auxiliary generating function
 \begin{equation} \label{eq:Fdn}
 F_{d, n}(q,t):=\sum_I q^{w(I)}t^{|I|},
 \end{equation}
 where $I$ ranges over all order ideals of $P_{n,dn-1}$ with no consecutive labels;  $w(I)$ is the sum of the labels in $I$; and $|I|$ is the number of labels in $I$.  Then, as explained in [ZZ], we can obtain $G_{d, n}(q)$ by replacing occurrences of $t^k$ in $F_{d, n}(q,t)$ with $q^{-k(k-1)/2}$.

 To compute $F_{d, n}(q,t)$, we use the reasoning of the previous section, but this time we keep track of the weight of the order ideal.

 First, we introduce yet another auxiliary generating function.  For $1\leq k \leq n-1$, let $P^k_{n,dn-1}$ be the sub-poset  of $P_{n,dn-1}$  obtained by chopping off everything to the left of the $k$th column (note $P^1_{n,dn-1}=P_{n,dn-1}$).  Define  $F^k_{d, n}(q,t)$ as in \eqref{eq:Fdn}, except $I$ ranges over order ideals of $P^k_{n,dn-1}$ with no consecutive labels (note $F^1_{d, n}(q,t)= F_{d, n}(q,t)$).

 By the reasoning of the previous section, the first column of an order ideal of $P^k_{n,dn-1}$ is either empty or of the form $\{k,k+n,\cdots,k+in\}$, where $0\leq i\leq d-1$).  Since the latter set has weight
 $$
 q^{\sum_{j=0}^i (k+jn)}t^{i+1} = q^{(i+1)(in/2+k)}t^{i+1},
 $$
 we have the recursion
 \begin{align}
 \begin{split}  \label{eq:Fkdn}
 &F^k_{d, n}(q,t)=F^{k+1}_{d, n}(q,t)+\left(\sum_{i=0}^{d-1} q^{(i+1)(in/2+k)}t^{i+1} \right) F^{k+2}_{d, n}(q,t) \text{ for } 1\leq k \leq n-2;
 \\
 &F^{n-1}_{d, n}(q,t)=\sum_{i=0}^{d-2} q^{(i+1)(in/2+k)}t^{i+1};
 \\
 &F^{n}_{d, n}(q,t):=1.
 \end{split}
 \end{align}

 Note that this is a recursion in the auxiliary index $k$, not in $n$ and $d$.

 Given $n$ and $d$, we can use \eqref{eq:Fkdn} to find $F^1_{d, n}(q,t)= F_{d, n}(q,t)$.  Finally, we make the substitution $t^k \to q^{-k(k-1)/2}$ to find $G_{d,n}(q)$.  All of this is done in the procedure \verb+Gdn+ in the Maple package.

 \section{Distribution of the size}
 Given fixed $n$ and $d$, we can pick a uniform random $(n,dn-1)$-core partition with distinct parts, and consider its its size, call it $X_{n,d}$.  Then $X_{d,n}$ is a random variable, so it makes sense to inquire about its distribution.  Since $G_{d,n}$ is the  generating function for $X_{d,n}$, we can easily compute as many moments of the distribution as we please, for fixed $n$ and $d$.

Using this information, we can investigate how the moments behave as functions of $n$ and $d$.  We consider two cases: $n$ is variable and $d$ is fixed, and vice versa.  In each case, we consider the behavior of $X_{d,n}$ as the variable tends to infinity; in particular, we address the question of asymptotic normality. Finally, we derive formulas for the first few moments as functions of \emph{both} $n$ and $d$.

  \subsection{Varying $d$ and fixing $n$}
  First, we introduce some terminology. Given a natural number $k$, let us denote
  $$
 m_k(d,n):=\left[ \left(q\frac{d}{dq}\right)^kG_{d,n}(q)\right]_{q=1}
  $$
  the $k$th ``pre-moment'' of $X_{d,n}$.  Thus,
  $$
  M_k(d,n):=\frac{m_k}{G_{d,n}(1)}=\frac{m_k}{N_d(n)}=\mathbb{E}[X_{d,n}^k]
  $$
  is the $k$th (straight) moment of $X_{d,n}$.  For example, the mean is $\mu_{d,n}=M_1$.

  We denote the $k$th \emph{central moment} by
  $$
  M_k^c(d,n):=\mathbb{E}[(X_{d,n}-\mu)^k].
  $$
  For example, the variance is $\sigma_{d,n}^2:=M_2^c$.

  Finally, the $k$th \emph{standardized moment} is
  $$
  M_k^s(d,n):=\frac{M_k^c}{\sigma^k}.
  $$
  Note that the central, straight, and standardized moments can easily be computed from the pre-moments.

  Now, for numeric values of $d$ and $n$, we can easily compute all the quantities above.  Analyzing moment data for many values of $d$ and $n$ confirms the following:

  \begin{conj}
  For each $n$, the $k$th pre-moment $m_k(d,n)$ of $X_{d,n}$ is a polynomial in $d$.  Further, the degree of this polynomial is $2k+\lfloor n/2 \rfloor$.
  \end{conj}

For example, our experimental evidence indicates that

\begin{align}
\begin{split} \label{eq:lim}
\{\lim_{d\to\infty} M_k^s(d,3)\}_{k=3}^\infty &=
2/7\,\sqrt {5},{\frac {15}{7}},{\frac {100}{77}}\,\sqrt {5},{\frac {
6625}{1001}},{\frac {750}{143}}\,\sqrt {5},\dots
\\
& \approx .641, 2.14, 2.91, 6.62, 11.7,\dots
\\
\{\lim_{d\to\infty} M_k^s(d,4)\}_{k=3}^\infty &\approx
.162, 2.08, 1.19, 6.20, 7.05,\dots
\\
\{\lim_{d\to\infty} M_k^s(d,5)\}_{k=3}^\infty &\approx
.237, 2.22, 1.76, 7.43, 10.8,\dots
\\
\{\lim_{d\to\infty} M_k^s(d,6)\}_{k=3}^\infty &\approx
.052, 2.36, .671, 7.80, 5.15,\dots
\\
&\dots
\\
\{\lim_{d\to\infty} M_k^s(d,10)\}_{k=3}^\infty & \approx
-0.001, 2.62, .130, 10.1, 2.17,\dots.
\end{split}
\end{align}

Recall that the standard normal distribution has moments $0,1,0,3,0,15,\dots$.  The sequences above seem to approach this as $n\to\infty$, leading us to the following:
 \begin{conj}
 For each fixed $n$, the distribution of $X_{d,n}$ is \emph{not} asymptotically normal; in fact, $(X_{d,n}-\mu_{d,n})/\sigma_{d,n}$ tends to some abnormal distribution $X_n$ as $d\to\infty$.  However, $X_n$ \emph{is} asymptotically normal; that is, $(X_n-\mu)/\sigma$ tends to the standard normal distribution as $n\to\infty$.
 \end{conj}

 \subsection{Varying $n$ and fixing $d$}
 Next, we fix $d$, and look at $X_{d,n}$ as a sequence of random variables indexed by $n$.  The $d=1$ case was already addressed in [ZZ], where we found that the pre-moments are given by polynomials in $n$ and the Fibonacci numbers.  In light of \eqref{eq:Nds}, we might expect the same to be true for arbitrary $d$, except we use the generalized Fibonacci numbers, $N_d(n)$:

 \begin{conj}
  For each $d$, the $k$th pre-moment $m_k(d,n)$ of $X_{d,n}$ is of the form $a(n)N_d(n)+b(n)N_d(n+1)$, where $a$ and $b$ are polynomials in $n$.
  \end{conj}

Again, experimental evidence verifies this claim.  The one anomalous case seems to be $d=2$, for which $N_d(n)=2^{n-1}$.  In this case, our methods do not yield nice formulas for the moments.

Upon computing the limits standardized moments, we do get the familiar sequence $0,1,0,3,0,15,\dots$ in this case, leading to the following:

\begin{conj}
For fixed $d$, the distribution of $X_{d,n}$ is asymptotically normal.  That is, $(X_{d,n}-\mu_{d,n})/\sigma_{d,n}$ approaches the standard normal distribution as $n\to \infty$.
\end{conj}
 \subsection{Varying $n$ and $d$}
 Finally, it is possible (but computationally taxing) to obtain a single formula for the $k$th moment as a function of \emph{both} $k$ and $d$.  In the previous section, we \emph{fixed} $d$ and $k$, we and used \verb+GuessRecPol+ to fit the sequence $\{m_k(d,n)\}_{n=2}^\infty$ to the ansatz $a(n)N_d(n)+b(n)N_d(n+1)$, where $a(n)$ and $b(n)$ are polynomials.  However, using the methods Section 3.1, we can fix \emph{only} $k$ and look at $\{m_k(d,n)\}_{n=2}^\infty$ as a sequence of polynomials in $d$.  Further,  due to Maple's ability to handle linear systems with symbolic coefficients, \verb+GuessRecPol+ can still be applied to this sequence.  Of course, now $a(n)$ and $b(n)$ will be polynomials in $n$ whose coefficients are rational functions in $d$:

 \begin{conj}
  The $k$th pre-moment $m_k(d,n)$ of $X_{d,n}$ is of the form $A(n,d) N_d(n) + B(n,d)N_d(n+1)$, where $A$ and $B$ are degree $2k$ polynomials in $n$ whose coefficients are rational functions in $d$.
  \end{conj}

 Due to the amount of data needed to fit the $k$th moment to the ansatz, it takes a few minutes even to generate the formula for the 3rd moment.

 \subsection{Sample formulas for the moments}
 Here, we present a small taste of the conjectures yielded by our Maple package.  In the first two conjectures to follow, we could easily have presented formulas for many more moments, but we omit them to save space.  See the next section for instructions to replicate these results and many more for yourself.

 In general, we conjectured that $M_k(d,n)$ is a rational function in $d$ for $n$ fixed.  However, for $n=3$ the straight moments seem to be polynomials:

 \begin{conj}
 The expectation of $X_{d,3}$ is $d^2/3+d/4-1/12$, and the variance is $4d^4/45+d^3/12-d^2/144+d/24+31/720$.
\end{conj}

 Here is an example where we fix $d$.

 \begin{conj}
 The expectation of $X_{3,n}$ is
 $$
 {\frac {25}{39}}\,{n}^{2}-{\frac {479}{507}}\,n+{\frac {406}{507}}+\frac{N_3(n+1)}{N_3(n)}\, \left( -\frac{1}{39}{n}^{2}+{\frac {29}{169}}\,n-{\frac {158}{
507}} \right).
 $$
 \end{conj}

 Finally, here is the expectation once and for all, in terms of both $n$ and $d$:

 \begin{conj}
 The expectation of $X_{d,n}$ is
 \begin{align*}
 &{\frac { \left( 5\,{d}^{3}+7\,{d}^{2}+d-1 \right) {n}^{2}}{24(4\,d+
1)}}-{\frac { \left( 8\,{d}^{5}+21\,{d}^{4}+7\,{d}^{3}-{d}^{2}+3
\,d-2 \right) n}{24(16\,{d}^{3}-24\,{d}^{2}-15\,d-2)}}
\\
&+{\frac {17\,{
d}^{4}+13\,{d}^{3}-9\,{d}^{2}-7\,d-2}{12(16\,{d}^{3}-24\,{d}^{2}-15\,d-2)}
}+\frac{N_d(n+1)}{N_d(n)}\,
\\
&\cdot \left( -{\frac { \left( {d}^{2}-1 \right) {n}^{
2}}{24(4\,d+1)}}-{\frac { \left( 2\,{d}^{4}-9\,{d}^{3}-16\,{d}^{2}-3
\,d+2 \right) n}{8(16\,{d}^{3}-24\,{d}^{2}-15\,d-2)}}-{\frac {{d}^{
4}+20\,{d}^{3}+9\,{d}^{2}-20\,d-10}{ 12\left( d-2 \right)  \left( 4\,d+1
 \right) ^{2}}} \right).
\end{align*}
 \end{conj}

 Note that this formula is singular at $d=2$, explaining anomaly mentioned earlier.  However, we can still make sense of the $d=2$ case by first plugging in a numeric value of $n$, (so that the $N_d$'s become polynomials in $d$), then taking the limit as $d\to 2$.  So this formula effectively works for \emph{all} $n$ and $d$.

\section{Using the Maple package}
The Maple package \verb+core2.txt+ accompanying this paper may be found at the following URL:
 \\ \url{http://www.math.rutgers.edu/~az202/Z}.

 To use the Maple package, place \verb+core2.txt+ in the working directory and execute \verb+read(`core.txt`);+.

 To see the main procedures, execute \verb+Help();+.  For help on a specific procedure, use \verb+Help(<procedure name>);+.

 Here are some things to try:
 \begin{itemize}
 \item \verb+Gdn(q,3,7);+ gives the generating function (according to size) of $(3,3\cdot 7-1)$-core partitions with distinct parts.
 \item \verb+MdnK(d,3,1);+ and \verb+McdnK(d,3,2);+ reproduce Conjecture 3.6.
 \item \verb+MdnK(3,n,1);+ reproduces Conjecture 3.7.
 \item \verb+MdnK(d,n,1);+ reproduces Conjecture 3.8.
 \item \verb+map(p->limit(p,d=infinity),MsdnK(d,3,7));+ reproduces the first equation in \eqref{eq:lim}.
 \end{itemize}
\section*{Acknowledgements}
The author thanks Dr. Doron Zeilberger for introducing this project to him and  guiding his research in the right direction. The author also thanks Dr. Neil Sloane for proofreading the draft.
\section{References}
\begin{itemize}
\item[{[A]}]
J. Anderson, Partitions which are simultaneously $t_1$- and $t_2$-core, Discrete Math. 51 (2014) 205-220.
\item[{[AHJ]}]
D. Armstrong, C. R. H. Hanusa, B. C. Jones, Results and conjectures
on simultaneous core partitions, European J. Combin. 41 (2014) 205-
220.
\item[{[EZ]}]
S. B. Ekhad, D. Zeilberger, Explicit expressions for the variance and higher moments of the size of a simultaneous core partition and its limiting distribution, The Personal Journal of Shalosh B. Ekhad and Doron Zeilberger, posted Aug. 30, 2015,
\\
\url{http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/stcore.html}.
\item[{[S]}]
A. Straub, Core partitions into distinct parts and an analog of Euler's theorem, European J. Combin. 57 (2016) 40-49.
\item[{[Z]}]
A. Zaleski, Explicit expressions for the moments of the size of an $(s,s+1)$-core partition with distinct parts, Adv. Appl. Math. 84 (2017) 1-7.
\item[{[ZZ]}]
A. Zaleski, D. Zeilberger, Explicit (polynomial!) expressions for the expectation, variance, and higher moments of the size of a $(2n+1,2n+3)$-core partition with distinct parts, preprint, arXiv:1611.05775, 2017.
\end{itemize}
\end{document}


A note on commuting graphs of matrix rings over fields

Abstract: We will give a short proof of the fact that if the algebraic closure of a field $\mathbb F$ is a finite extension, then for $n\geq 3$ the commuting graph $\Gamma(M_n(\mathbb F))$ is connected and its diameter is four.

\section{Introduction}
Let $\mathds F$ be a field and $M_n(\mathds F)$ be the algebra of all $n\times n$ matrices over $\mathds F$. The commuting graph of $M_n(\mathds F)$, denoted by $\Gamma(M_n(\mathds F))$,
is the graph whose vertices are all non-central matrices and two distinct vertices $A$ and $B$ are adjacent if and only if $AB=BA$.

The connectedness and diameter of the commuting  $\Gamma(M_n(\mathds F))$  have
been  studied extensively; see \cite{ak2,dol, do,gi}. Note that for $n=2$ the commuting graph $\Gamma(M_n(\mathds F))$ is always disconnected; see \cite[remark 8]{ak4}. So, from now on we assume that $n$ is an integer greater than $2$.   If the field $\mathds F$ is algebraically closed, then the commuting graph $\Gamma(M_n(\mathds F))$ is connected and its diameter is always equal to four; see \cite{ak2}. If the field $\mathds F$ is not algebraically closed, then the commuting graph $\Gamma(M_n(\mathds F))$ may be disconnected for an arbitrarily large integer $n$; see \cite{ak3}. However, in $\cite{ak2}$ S. Akbari et al.  proved that for any field $\mathds F$ if the graph $\Gamma(M_n(\mathds F))$ is connected, then its diameter is between four and six. Also in $\cite{ak2}$ the authors conjectured that the upper bounded six can be improved to five.
Recently, Yaroslav Shitov in \cite{sh} gave an example of a field $\mathds F$ such that $\Gamma(M_{38}(\mathds F))$ is connected with diameter six, disproving the conjecture of S. Akbari et al.

The aim of this note is to give a short proof that if the algebraic closure $\overline{\mathds F}$ of the field $\mathds F$ is a finite extension of $\mathds F$, then the commuting graph $\Gamma(M_n(\mathds F))$ is connected and its diameter is four.
We will prove the following:

\begin{theorem}\label{tf} If the algebraic closure $\overline{\mathds F}$ of a field $\mathds F$ is a finite extension of $\mathds F$,
then
the commuting graph $\Gamma(M_n(\mathds F))$ is connected and its diameter is four. \end{theorem}

Notice that, the well-known fact that for matrix rings over algebraically closed fields, if the commuting graph is connected, then its diameter ir four, is a particulary case of theorem \ref{tf}. Moreover, the results proved in \cite{mi} and \cite{ga} for the field $\mathds R$ of real numbers can also be deduced from
theorem \ref{tf}.

\section{Preliminaries.}

Our proof involves looking at the idempotents and nilpotent matrices and apply results from the structure theory of rings.
Recall that in a ring $R$ both the zero and the identity are always idempotent. An indempotent wich is different from these is called non trivial idempotent. Note that, For a field
$\mathds F$ the central idempotent in the matrix ring $M_n(\mathds F)$ are exactly the trivial idempotent.

\begin{lemma}\label{lf} Let $\mathds F$ be field and assume that all the irreducible polynomials in $\mathds F[x]$ have
degree $< n$. Then, every matrix $A\in M_n(\mathds F)$ commute with a non zero nilpotent matrix or with a nontrivial idempotent matrix.\end{lemma}

{\bf Proof.} First observe that, if the matrix $A$ is  derrogatory, then by the rational canonical form we can find  a nonsingular matrix $S\in M_n(\mathds F)$ such that
\begin{equation*}A=S^{-1}(C_1\oplus\ldots\oplus C_k)S,\end{equation*}
where $k\geq 2$ and $C_i$, for $i=1,\ldots ,k$, is a companion matrix of a monic polynomial over $\mathds F$. Hence, $A$ commutes with the non trivial idempotent
\begin{equation*}E=S^{-1}(I_{C_1}\oplus 0_{C_2}\oplus\ldots\oplus 0_{C_k})S,\end{equation*}
where $I_{C_1}$ is the identity matrix whose order equals the order of $C_1$ and $0_{C_i}$, for $i=2, \ldots, k$, is the zero matrix whose order equals the order of $C_i$.

Now, assume that the matrix $A$ is non derrogatory and denote by $\langle A\rangle$ the $\mathds F$-subalgebra of $M_n(\mathds F)$ generated by $A$. Since the $\mathds F$-subalgebra
$\langle A\rangle$ is artinian it follows that the Jacobson radical $\mathcal{J}(\langle A\rangle)$ is nilpotent; see \cite[p.658]{lang}. Consequently, if $\langle A\rangle$ is not nilsemisimple it necessarily
contains a non zero nilpotent matrix $N$ and we get the result.

We are now reduced to the case where the matrix $A$ is non derrogatory and the $\mathds F$-algebra $\langle A\rangle$ is semisimple.
Since a semisimple artinian commutative ring is isomorphic to sum of fields; see \cite[p.661]{lang}, if follows that
\begin{equation}\label{eq1}\langle A\rangle\cong\mathds F_1\oplus\ldots\oplus\mathds F_s,\end{equation}
where each $\mathds F_i$, for $i=1\ldots, s$, is a field.
If in equation (\ref{eq1}) we have $s\geq 2$, then  $\mathds F_1\oplus\ldots\oplus\mathds F_s$ contains the non-trivial   idempotent $(1, 0, \ldots , 0)$. Let $\psi:F_1\oplus\ldots\oplus\mathds F_s\rightarrow \langle A\rangle $ be an isomorphism. Clearly, a non-trivial idempotent of $\mathds F_1\oplus\ldots\oplus\mathds F_s$ is mapped
by $\psi$ to a non-trivial idempotent in $\langle A\rangle$.
 As we have noted before, in the matrix ring $M_n(\mathds F)$ the central idempotent are exactly the trivial idempotent. Hence, the idempotent $\psi(1, 0, \ldots , 0)$ is not central and we get the result.

 We conclude the proof by showing that in equation (\ref{eq1}) we necessary have $s\geq 2$. Indeed, if we had $s=1$ in equation (\ref{eq1}), then
 the subalgebra  $\langle A\rangle$ is
itself a field and by the first isomorphism theorem for rings we obtain
\begin{equation*}\langle A\rangle\cong\mathds F[x]/( p_A),\end{equation*}
where $( p_A)$ is the ideal, in the polynomial ring $\mathds F[x]$, generated by the minimum polynomial $p_A$ of $A$, over the field $\mathds F$. Since the ideal $( p_A)$ is maximal it follows that $p_A$ is irreducible over $\mathds F$. Now the fact that $A$ is non derrogatory implies that $p_A$ has degree $n$, contrary to hypothesis. $\Box$

\

 Observe that if a matrix $A$ commutes with  a noncentral nilpotent matrix $N$ with index of  nilpotency  $\alpha$, that is, $\alpha=min\{i\in\mathds N : N^i=0\}$, then the matrix $A$ also commutes with $N^{\alpha-1}$. Consequently, if a matrix commutes with a noncentral nilpotent matrix $N$ we may assume that its index of nilpotency is $2$.

\section{Proof of the main theorem.}

We can now prove our main result.

\

{\bf Proof of Theorem \ref{tf}.} Following \cite[theorem\;11]{ak2}, if $E_1, E_2\in M_n(\mathds F)$ are two noncentral idempotent matrices, then $d(E_1, E_2)\leq 2$ in the commuting graph $\Gamma(M_n(\mathds F))$. Also by  \cite[theorem\;9]{ak2}
 if $N_1, N_2\in M_n(\mathds F)$ are two non-zero nilpotent matrices, both of index of nilpotence $2$, then $d(N_1, N_2)\leq 2$ in $\Gamma(M_n(\mathds F))$. Finally, from \cite[proposition 1]{ga} if $E, N\in M_n(\mathds F)$ are  such that $E$ is idempotent and $N$ is nilpotent of index of nilpotence $2$, then $d(E, N)\leq 2$ in $\Gamma(M_n(\mathds F))$.
  By  combining these three results with lemma \ref{lf} we get the result. $\Box$

\

{\bf Final Remarks:} For a field $\mathds F$ if the commuting graph $\Gamma(M_n(\mathds F))$ is connected,  then there are three possibilities
for the diameter namely $4$, $5$ or $6$. According to theorem \ref{tf}  for fields $\mathds F$ with an algebraic closure that is a finite extension the graph
$\Gamma(M_n(\mathds F))$ is connected with diameter $4$.  On the other hand, Yaroslav Shitov in \cite{sh} gave an example of a field $\mathds F$ such that $\Gamma(M_{38}(\mathds F))$ is connected with diameter $6$. However, there is no known example of a connected commuting graph of a matrix ring over a field with diameter $5$. The question natural arises
  whether a field $\mathds F$ exists such that for some integer $n$ the commuting $\Gamma(M_n(\mathds F))$ is connected with diameter five?

\

{\bf Acknowledgments.}

This work was supported by FCT project UID/EEA/50008/2013.