  Linear stability of both sign-definite (positive) and sign-indefinite
solitary waves near pitchfork bifurcations is analyzed for the generalized
nonlinear Schroedinger equations with arbitrary forms of nonlinearity and
external potentials in arbitrary spatial dimensions. Bifurcations of
linear-stability eigenvalues associated with pitchfork bifurcations are
analytically calculated. It is shown that the smooth solution branch switches
stability at the bifurcation point. In addition, the two bifurcated solution
branches and the smooth branch have the opposite (same) stability when their
power slopes have the same (opposite) sign. One unusual feature on the
stability of these pitchfork bifurcations is that the smooth and bifurcated
solution branches can be both stable or both unstable, which contrasts such
bifurcations in finite-dimensional dynamical systems where the smooth and
bifurcated branches generally have opposite stability. For the special case of
positive solitary waves, stronger and more explicit stability results are also
obtained. It is shown that for positive solitary waves, their linear stability
near a bifurcation point can be read off directly from their power diagram.
Lastly, various numerical examples are presented, and the numerical results
confirm the analytical predictions both qualitatively and quantitatively.
