Why are there two different averages for the kinetic energy in a harmonic oscillator? Question:

A particle of mass m executes simple harmonic motion with amplitude a and frequency v. The average kinetic energy during its motion from the position of equilibrium to the end is?

Problem:
For trying to find the answer I used integration to find the average value of the velocity as time dependent function 
$$\frac{1}{2}mv^2=\frac{1}{2}mA^2\omega^2\cos^2{\omega t},$$
from $0$ to $\frac{\pi}{2\omega}$, I am getting $\pi^2ma^2\nu^2$, which is correct.
However when using velocity as a function of position 
$$\frac{1}{2}mv^2=\frac{1}{2}mw^2(A^2-x^2)$$
from $0$ to $A$ I am getting a different answer, $\frac{1}{3}\pi^2ma^2\nu^2$.
Why is that the case?
 A: Although your question is tagged "homework-and-exercises", it is clear that you are not asking us to help you get the right answer, but you are raising a side issue. So I see no problem in offering an answer.
The time-average of $\frac{1}{2}mv^2$ is indeed different from the position-average of the same quantity. There's a different weighting. Actually, any mean value might be defined to include a weighting function, but unless it is specified explicitly, we usually assume an unweighted mean. However, for continuous functions of some variable, the formula for the mean involves integrating with respect to that variable, which implies you have made some choice about the weight. 
In your case, you have two obvious candidates. Imagine sampling $N$ discrete values of the kinetic energy at regular intervals of time, and averaging them by adding them up and dividing by $N$. Now imagine that you sample the $N$ values at regularly spaced positions, and again average them in the same way. You would not expect to get the same result: the particle is moving much faster through the position $x=0$, so it spends far less time around that position than around the extremities of the oscillation. The time average will emphasize the lower speeds, compared with the position average.
Explicitly we can write
\begin{align*}
\langle \tfrac{1}{2}mv^2 \rangle_x &= 
\frac{\int_0^A \left(\tfrac{1}{2}mv(x)^2\right) dx }{\int_0^A  dx}
\\
\text{and}\quad
\langle \tfrac{1}{2}mv^2 \rangle_t &= 
\frac{\int_0^{\pi/2\omega} \left(\tfrac{1}{2}mv(t)^2\right) dt }{\int_0^{\pi/2\omega}  dt}
\end{align*}
If we change variables in the first equation, 
using $dx = v\, dt$,
we can see the weight appear explicitly
$$
\langle \tfrac{1}{2}mv^2 \rangle_x = 
\frac{\int_0^{\pi/2\omega} v(t)\, \left(\tfrac{1}{2}mv(t)^2\right) dt }{\int_0^{\pi/2\omega} v(t)\, dt}
$$
The time average is given by a similar expression,
but without the $v$ weighting in the numerator and denominator.
The position average has given more weight to the higher velocities. (Incidentally, if we integrate over a full period,
we need to take a little more care with the sign of the weighting factor)
Either average is "correct". Which one is wanted? Well, the context of the question should really make this clear, but I would probably make the same assumption that you did, and guess that the time-average kinetic energy is likely to be more relevant.
