Bound states in semi-infinite potential well Suppose we have a semi-infinite potential well described be the potential 
$$V(x)=\begin{cases}
V_0,&\text{if }\,x<0\\
0,&\text{if }\,0<x<L\\
\infty,&\text{if }\,x>L
\end{cases}$$
For a particle in the case where $E=V_0$, the energies come out to be quantised by the formula $$E=\frac{h^2}{32mL^2}(2n+1)^2$$
The problem starts here.
The energy states corresponding to different values of $n$ exist independently of the potential of the well, ie, the spectrum of energy levels are independent of $V_0$.
So now if I have a system with, say, $V_0 = \frac{25h^2}{32mL^2}$, the energy level $E=\frac{h^2}{32mL^2}$ should be a bound state, right?
But on solving the Schrodinger's equation for these values and applying the boundary conditions, I get $$\tan\left(\frac{\sqrt{2mE}L2\pi}{h}\right)=-\sqrt{\frac{E}{V_0-E}}$$
Now on plugging in the value of E, I get $\tan\frac\pi2$ on the LHS, which is absurd.
What's going on here? Shouldn't the energy level be a bound state for the the chosen potential?
 A: Since you didn't present the complete derivation, I'll just say some general words based on what you showed.
You have infinite values on both sides of the equation, not only on the LHS. Try looking earlier into your derivation. You'll most likely get a sane result if you don't divide by $\cos$ to obtain $\tan$ or if you take a limit of $E\to V_0$ instead of exactly setting $E=V_0$.
If you are just trying to verify that the boundary conditions are satisfied, but can't avoid the division by zero at the boundary for some reason, try setting $E$ early in the process, and compare limits of the wavefunction and of its derivative on both sides to confirm they are equal.

...the energies come out to be quantised by the formula...

This statement sounds very strange: you assert that well depth is quantized. This is absurd. But the equation itself does have a meaning in it, discussed below. I didn't check whether the expression is correct though.
Since $E=V_0$, the wavelength outside of the well is infinite, i.e. the wave function is constant. But the only way you can match a constant with a sinusoid is when the sinusoid is at its extremum. There is only a countable infinity of such sinusoids which are $0$ for $x=L$, and have an extremum at $x=0$. So this means that the state of $E=V_0$ exists only for some well depths (a countable set of such depths), not that the energies are quantized. In fact the energy of this state is not in the discrete part of Hamiltonian's spectrum: the eigenfunction corresponding to this $E$ can't be normalized due to infinitely-extended constant value.
A: At the beginning you somehow find a quantisation condition when $E=V_o$ and then later on try and apply it when $E\ne V_o$.
Your solution to the Schrodinger equation will give you the correct value of $E$.
