As I tried to learn quantum mechanics I have found two solutions of one-dimensional time-independent Schrödinger equation with constant potential in various resources.
One is,$$\psi(x) = A\sin(kx)+B\cos(kx)\\\text{where}, k = \frac{2π\sqrt{2m(E-U_0)}}{h}\\ \text{In this case, probability density: }P_1(x) = \psi(x)\cdot\psi^*(x) = |\psi(x)|^2\\$$ And another is, $$\psi(x) = Ce^{k'x} + De^{-k'x}\\\text{where}, k' = \frac{2π\sqrt{2m(U_0-E)}}{h}\\ \text{In this case, probability density: } P_2(x)=\psi(x)\cdot\psi^*(x)=|\psi(x)|^2$$ In both cases,
$A,B,C,D$ are arbitrary constants
$\psi(x) = $ The probability function of a particle
$\psi^*(x) = $ The conjugative function of $\psi(x)$
$m$ = the mass of the particle
$E$ = The total Energy of the particle
$U_0 =$ The potential energy of the particle
Now my question is, does $P_1(x)$ and $P_2(x)$ mean the same thing? If yes, then how? And if not, then which is actually the general solution of time independent Schrödinger's equation?
$$\\$$ [Edit: As far as I understood these two solutions are not same. (ie, if I put $C = 2$ and $D=3$ in the second solution, no value of $A\;and\;B$ can equalize these two solutions. Also if I put $A=2\;and\;B=3$ in the first solution no value of $C$ and $D$ can equalize them) So neither of them seems to be a general solution of TISE. Is there any mistake in this example? Or is there no general solution of TISE?]