Why must I solve the de Broglie relationship in a single dimension instead of all three? Context: a particle of mass $m$ can move in 3D and is trapped inside of a sphere of radius $R$ and impenetrable walls (in a more mathematical sense, the potential energy is 0 inside of the sphere and $+\infty$ everywhere else). 
What I want to derive is the particle's energy $E_0$ in the fundamental state using the de Broglie relationship $\lambda = \frac{h}{p}$, where $p$ is linear momentum and $h$ is Planck's constant.
If I visualize a standing wave inside of a sphere, it appears that its wavelength must be $\lambda = \frac{4R}{n} (n = 1, 2, 3...)$. Therefore:
$$\frac{4R}{n} = \frac{h}{p}$$
Since $p = \sqrt{2mE}$:
$$\frac{16R^2}{n^2} = \frac{h^2}{2mE}$$
Therefore
$$E = \frac{n^2h^2}{32mR^2}$$
And in the fundamental state, $n = 1$, so:
$$E_0 = \frac{h^2}{32mR^2}$$
Should (?) be the answer. The actual answer to the problem however is 
$$E_0 = \frac{3h^2}{32mR^2}$$
Which is 3 times the answer I found. According to the actual solution, the energy found using the de Broglie relationship is 

[...]The energy in just one dimension. We must multiply by 3 to find the total energy, i.e., the energy in 3 dimensions.

Now, what bothers me about this is that de Broglie's relationship is $\lambda = \frac{h}{p}$, not $\lambda = \frac{h}{p_x}$ or $\frac{h}{p_y}$ or $\frac{h}{p_z}$. It's just $p$. Where does it say that the momentum in the relationship is just a component instead of the total momentum?
As far as I'm aware, we should use the total momentum, not just a component, so the energy found should be the total energy, not just a component. Where does my logic fail? Why does the de Broglie relationship give us the energy in just one of the dimensions instead of the total energy if nowhere in my attempt to solve the problem did I assume I was working in a single dimension? This has been bothering me and I haven't found an answer, but I have a guess.
Perhaps I am misunderstanding how the three-dimensional standing wave works and simply got the wavelength wrong. Either this or the de Broglie relationship is somehow meant to be one-dimensional, but I doubt it.
Or maybe it's something entirely different. Anyway, what is it?
(The same applies to the particle trapped inside of a bidimensional circle, being able to move in the $x$ and $y$ directions inside of the circle. But in this case the energy is multiplied by 2.)
EDIT: this is a high school physics problem. I have discussed with the professor and he has confirmed this is just an approximation, as I was meant to estimate the energy, and therefore the "multiply by $3$" thing is just for approximation by analogy with the 3D box.
 A: $\let\lam=\lambda \let\om=\omega$
You (or your teacher) shouldn't stress de Broglie's idea beyond its
limits. Maybe a brief history sketch can help.
1913: Niels Bohr "explains" hydrogen spectrum introducing some new
postulates:


*

*The electron can't move in all orbits allowed by Newtonian
mechanics. For circular orbits, only those radii are possibile which
correspond to an angular momentum $L$ multiple of $\hbar=h/(2\pi)$.

*The atom can absorb or emit radiation only by "jumping" from one
allowed (stationary) state to another. Frequency (and wavelength) of
emitted/absorbed radiation is determined by conservation of energy
together with Planck's rule:
$$E_2 - E_1 = h\,\nu = \hbar\,\om.$$
By combining these postulates with 2nd Newton's Law and Coulomb's Law for electrical force between electron and proton, Bohr got to the famous formula
$$E_n = {m\,e^4 \over 2\,n^2 \hbar^2} \qquad \hbox{(Gauss' units)}$$
which accounted with extraordinary precision for the observed spectral
lines.
However both postulates were incompatible with mechanics and
electromagnetism as known at that time. So it was clear Bohr's idea
was a first tentative step towards a new physics.
De Broglie's (1924) idea was to justify the first Bohr postulate as
a consequence of a more general one: 


*

*to every particle there is "associated" a wave, whose wavelength is
determined by particle's momentum, according to the relation
$$\lam = {h \over p}.$$
He added another idea:


*

*Bohr stationary states are those where the associated wave is a
standing wave along electron's orbit.


It's easy to see how Bohr follows from de Broglie. In a standing wave
ve must have
$$2\,\pi\,r = n\,\lam = n\,{h \over p}.$$
Then
$$L = r\,p = {n\,h \over 2\,\pi} = n\,\hbar.$$
Wonderful, but... It sounds peculiar to have a wave oscillating along
a circle in the form of a standing wave, more or less like a guitar string.
What keeps the wave bound to that orbit? How to explain a
unidimensional wave in a 3D space? What constrains it that way?
The answer came just two years later and was given by Schrödinger,
who wrote a wave equation for de Broglie waves. He could also solve
it for several cases, included the hydrogen atom. It wasn't an easy
task, but the way towards solution had been traced in the 19th
century, thanks to the work of great mathematical physicists on wave
equations.
I believe you haven't still heard of Schrödinger equation, so I'll
stop here my historical sketch. My aim was only at showing you that
it's incorrect to use de Broglie waves to solve 3D physical problems.
Its proper place and its full merit is in the history of physics, in
having traced part of the way that brought a few years later to the
fully developed quantum mechanics.
To be fair de Broglie's waves are still used sometimes. There are
cases where they can give reasonable results, and are often an easy
way to get an order-of-magnitude value for significant quantities
(e.g. density of states in statistical calculations). Even in your
problem using de Broglie is ok if you content yourself of the order of
magnitude, not the exact value of energy. This I'm going to show.

Now for your problem. You found
$$E_0 = {h^2 \over 32\,m\,R^2}$$
and ask why the "right" solution brings a factor of 3. My answer is
simple: your solution is an order of magnitude, for the reasons I
explained above, and within these limits it's correct. The "actual"
answer (where did you find it?) is plainly wrong. 
It would be right for a cubical box (I mean as a solution
of Schrödinger equation) but yours is spherical and can't be
treated viewing the three space dimensions as if they were independent and
simply additive as to energy. I wish to give you the exact solution
for a spherical box. The wave function corresponding to the lowest
energy is
$$\psi(r) = {1 \over r}\>\sin{\pi\,r \over R}$$
(an irrelevant normalization factor apart).  If you try to plot this
function and to compare it with the one you had found, you'll see they are
rather alike.
The exact energy eigenvalue is 
$$E_0 = {h^2 \over 8\,m\,R^2}$$
i.e. 4 times the one you had found. Note that it's still larger than
the one was sold you as exact. You may wonder why.
I'll give you a handwaving answer. I already said that the factor 3 is
right for a cubical box (of side $2R$). Incidentally, the right
wavefunction for a cubical box is
$$\psi(x,y,z) = \cos {\pi\,x \over 2\,R}\,\cos {\pi\,y \over 2\,R}\,
\cos {\pi\,z \over 2\,R}.$$
The spherical box is enclosed in the cubical one and has a smaller
volume. Then the wavefunction for the cubical box is more
"constrained" and the uncertainty principle says that we must expect a
greater value for $\langle p^2\rangle$. This entails a greater energy.
