How to write a wave function for infinite potential well with different width than from 0 to a? I am working on the perturbation theory problem with the infinite potential well. However, I am not sure how to write a wavefunction for different than the infinite potential well from $0$ to $a$ and in my problem the well is from $0$ to $2a$. 

Is it necessary to solve the potential well all over again? Maybe it is possible just to apply the transformation as $a\rightarrow2a$, for the initial wavefunction 

$$\psi(x)=\sqrt\frac{2}{a}\sin\left(\frac{n \pi x}{a}\right)$$ ?
Well, yes; the original length $a$ is just a symbol and you can replace it with whatever other quantity you wish. The relevant wavefunctions are thus just

$$\psi_n = \sqrt{\frac{1}{a}}\sin\left(\frac{n\pi x}{2a}\right)$$

You can verify that these wavefunctions are still normalised correctly by explicit integration.