Satisfy the schrodinger equation using this wave function with the borders 
Given the wave function
$$
 \Psi(x,t) = \left\{
        \begin{array}{ll}
            A\cdot \sin(\frac{2\pi x}{a})\cdot\exp\big(\frac{-iE\cdot t}{\hbar}\big)  &,-\frac{a}{2}  \lt  x \lt \frac{a}{2}\\
            0 & ,x  \lt  -\frac{a}{2} \text{ or }  x \gt \frac{a}{2}
        \end{array}
\right.
$$
$i)$ Show that the wave function above satisfies the Schrödinger equation.

So, I tried it this way:


*

*Change in Schrödinger function


*Differentiate with respect to $x$ and $t$


*Insert the derivatives into Schroedinger equation
Is the final result correct? I think doesn't exist this function for $E$, but I don't have a good answer to explain this.
 A: Your answer is almost correct, it just has an extra negative sign and is missing a factor of Plank's constant. Regardless, your process is correct. Here, I'll suggest a faster way of getting to the answer.
When one has an eigenstate of the Hamiltonian, $\hat{H} \Psi(x) = E\Psi(x)$, the complete wavefunction also dependant on time is given by $\Psi(x,t) = \Psi(x) \cdot \exp\big(\frac{-iE\cdot t}{\hbar})$. (This comes from considering the time dependent Schrödinger equation acting on an energy eigenstate). So look at the wavefunction you have been given for $|x| < \frac{a}{2}$:
$$\Psi(x,t) = A\cdot \sin(\frac{2\pi x}{a})\cdot\exp\big(\frac{-iE\cdot t}{\hbar})$$
All you must show is there exists some Hamiltonian operator that has $A\cdot \sin(\frac{2\pi x}{a})$ as an eigenfunction. It is pretty well known that the second derivate has sine as an eigenfunction. So start from the eigenvalue equation
$$\frac{d^2}{dx^2} A \sin(\frac{2\pi x}{a}) = E \cdot A \sin(\frac{2\pi x}{a})  $$
Cancel $A$ from both sides and apply the derivatives on the left,
$$-(\frac{4\pi^2}{a^2}) \sin(\frac{2\pi x}{a}) = E \cdot \sin(\frac{2\pi x}{a})  $$
And so we have shown $A\cdot \sin(\frac{2\pi x}{a})$ is an eigenvalue of the operator $\frac{d^2}{dx^2}$ with eigenvalue $E = -\frac{4\pi^2}{a^2}$. Hence there does exist the Hamiltonian we sought and so the wave function is a solution to the Schrödinger equation (when also considering that it is zero on the rest of the real numbers is a trivial solution).
Notice we get something very much like your result if we take the more physically meaningful Hamiltonian of a free particle
$$\hat{H} = - \frac{\hbar^2}{2m} \frac{d^2}{dx^2}$$
This of course gives an eigenvalue that is a scaling of what we got last time:
$$\boxed{E = - \frac{\hbar^2}{2m} \cdot-\frac{4\pi^2}{a^2} = \frac{4\hbar^2 \pi^2}{2ma^2} }$$
You can find this energy expression in any quantum mecahnics textbook as the energy of a free particle in an infinite potential well with width $a$ centered at $x = $ (this is the wavefunction you have been given, so it is indeed a real scenario).
