Calculating the energy of a particle using the Time Independent Schrodinger Equation If we have a wave function $\Psi(x,t=0)$ which is a solution to the TISE for a zero potential in an infinite square well, would calculating the energy at $t = 0$ at a position be as easy as rearranging the TISE to solve for energy like $$\frac{-\hbar^2}{2m\Psi(x)}\frac{\mathrm d^2\Psi(x)}{\mathrm dx^2} = E$$
or would we need to use $$\langle E \rangle = \int_0^{a}\Psi^*(x)\ H \Psi(x)\ \mathrm dx$$?
What have I become confused about?
 A: Let's take as an example the example 2.2 in page 35 of Griffith's "Introduction to Quantum Mechanics". It gives the initial wave function Ψ(x,0)=Ax(a-x) with A being the normalization constant and a being the width of the well.
Plugging this into the differential equation that you provided(TISE), we get E as a function of the variable x! Which, in this case, is absurd! And, as you might have guessed, it is certainly not the answer that we get if we use the second method(which is the correct one).
But, you are getting wrong something very fundamental. The second method is used to obtain the expectation value(the mean value) of the energy and it works for any wave function(any wave function that is well behaved) either being an energy eigenstate or being in a superposition of energy eigenstates. After some mathematical steps, we obtain from the second method that the expectation value of the energy is simply ΣEn*|Cn|^2 with Cn being the coefficient of each energy eigenstate in the superposition that gives us the wave function and En the corresponding energy of each energy eigenstate. So, you can now see more clearly why the second method gives the mean value of the energy(if not, i can further explain it to you in the comments).
Now, the first method is obtained through applying the separation of variables method to the time depended Schroedinger equation. But that means that the wave function that we obtain from solving the equation has a very specific time dependence. If you obtain the wave function Ψ1(x)(because the differential equation has only the variable x in it) then you just multiply it by a complex exponential function exp[iAx] with i being the imaginary unit and A being a coefficient. It turns out(and you can check any book or in the internet for this) that the coefficient A is analogous to a specific energy and that energy is the energy that corresponds to that specific solution. So, the most general solution can be written as a sum of all the solutions times their time dependent exponential factor. So, when you solve the TISE, you just find the solutions which for each one corresponds a specific energy, so you are solving for energy eigenfunctions!
So, if you are given an energy eigenfunction and you are told to find its corresponding energy, then you can do it with both methods. But, if you are given a wave function that is not an energy eigenfunction but it is in a superposition of them, then you can just do it the second way, as the first works only for finding energies for the energy eigenstates.
You can understand all these just by looking at the time dependence of the wave function you are given.
Lastly, to give you a little bit more motivation behind my answer, i will say something that i should have probably stated from the very beginning and this is the only thing that really needs to be said in order to make you see why using the first method for a general wave function(in a superposition of energy eigenstates) to find the energy is wrong. What does it even mean to solve the TISE to find the energy? What energy?? What does E(not ) stand for if we are talking about a superposition of energy eigenstates? It is in a superposition of energy eigenstates! So, what is E is that equation for a wave function that is in that superposition? I can see why someone would (wrongly)say that E here might stand for the mean energy(expectation value), but why would it? If you tried to answer this question, you might have concluded that there is no reason for E to stand for  as it is in the second method.  
Hope i have provided you with enough details(although i am sure you knew some or most of it, so sorry for being so wordy!) and motivation and i hope i did not confuse you more! And please feel free to ask anything!
