Clarification on Energy Levels for a Hyperbolic Wave Function in Introductory Quantum Theory I am working through an introductory problem that is part of an undergraduate course for Quantum Theory. I am self-studying currently.
$\DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\tanh}{tanh}$

A particle of mass $m$ moving on the $x$-axis has a ground-state wave function $$\psi_1(x)=\sech^2(x).$$
Show that the potential is $$V(x)=-\frac{3\hbar^2}{m}\sech^2(x).
$$
If $\psi(x)=\sech(x)\tanh(x)$ is an excited state wave function for the particle, what is the energy of this state?

Both answers seem to follow straightforwardly from the stationary state Schrödinger Equation, and I have obtained
$$E=-\frac{\hbar^2}{2m}$$
for the second part (hopefully correct).
From all examples I can find, the energy levels will typically be related by
$$E_1n^2=E_n.$$
My question is what is the precise $n$ giving the energy level that has been found? My guess would be the second, since the relation
$$\frac{1}{n^2}E_1=E_n$$
could make sense given that the ground state is the inverse of a standard hyperbolic function, and the examples I have covered lead to linear combinations of either $\cos$ & $\sin$, or $\cosh$ & $\sinh$, but I do not feel I am in a position this early on to understand how to explain such a result rigorously.
Please note I have only covered some fundamentals of Quantum Theory, namely:
$\;\;\;\;\;\;\;\;\;\;\;\;\bullet$ 'derivation' of Schrodinger's Equation
$\;\;\;\;\;\;\;\;\;\;\;\;\bullet$ modelling the wave function as a probability density funtion
$\;\;\;\;\;\;\;\;\;\;\;\;\bullet$ simple examples based around 'a particle in a box' (1D and 3D)
 A: You were given the information that $\psi_1$ is the wavefunction of a ground state. Ground state, by definition, is the lowest energy stationary state. All stationary states have to fulfill the Time-independent Schrödinger Equation (TISE), so $\psi_1$ also has to. The final piece of the puzzle is that the Hamiltonian of a scalar particle in a potential is
$$
  H = -\frac{\hbar^2}{2m} \, \frac{\mathrm d^2}{\mathrm dx^2} + V(x) \: ,
$$
where $V(x)$ is the unknown function. And now it's just algebra:
\begin{align}
  H \, \psi_1 &= E_1 \, \psi_1 \tag{TISE} \\
  - \frac{\hbar^2}{2m} \, \frac{\mathrm d^2}{\mathrm dx^2} \, \psi(x) + V(x) \, \psi_1 &= E_1 \, \psi_1 \\[5pt]
  - \frac{\hbar^2}{2m} \, \frac{\mathrm d^2}{\mathrm dx^2} \, \operatorname{sech}^2(x) + V(x) \, \operatorname{sech}^2(x) &= E_1 \, \operatorname{sech}^2(x) \\[5pt]
  - \frac{\hbar^2}{2m} \big( 4 \operatorname{sech}^2(x) - 6 \operatorname{sech}^4(x) \big) -E_1 \, \operatorname{sech}^2(x) &= - V(x) \, \operatorname{sech}^2(x) \tag{1} \label{wolfram} \\[5pt]
  \frac{\hbar^2}{2m} \big( 4 - 6 \operatorname{sech}^2(x) \big) + E_1 &= V(x) \\[5pt]
  -\frac{3\hbar^2}{m} \operatorname{sech}^2(x) + \Big( E_1 + \frac{2\hbar^2}{m} \Big) &= V(x) \\[5pt]
\end{align}
At the step marked \eqref{wolfram} I used WolframAlpha (link). Since we weren't told the value of the ground-state energy $E_1$, we can fix it on any value we wish, choosing $E_1 = -2\hbar^2/m$ in particular gives us
$$
  V(x) = -\frac{3\hbar^2}{m} \operatorname{sech}^2(x) \: .
$$
Now we know the entire Hamiltonian and, in principle, we can find all of its energies and stationary states by solving the TISE, this time with $E$ and $\psi$ as unknowns. However, you have it easy, since you're already been told what $\psi$ is, so you just solve for $E$:
$$
  \frac{\hbar^2}{m} \Bigg( {- \frac{1}{2}} \frac{\mathrm d^2}{\mathrm dx^2} \, -3 \operatorname{sech}^2(x) \Bigg) \, \operatorname{sech}(x) \, \operatorname{tanh}(x) = E \, \operatorname{sech}(x) \, \operatorname{tanh}(x)
  \: .
$$
I trust you can pull this off ;)
Notice that we aren't using the equation $E_1n^2=E_n$. Why? Because it doesn't hold – at least not generally! It is an equation that holds for the energies of a hydrogen atom, but not for a general Hamiltonian. And even the hydrogen atom Hamiltonian has energies $E>0$ for which the equation is useless. To find the energies of a generic system, you just have to find the spectrum of $H$, there is no short way around it.
