I'm trying to solve the pde $u_{t}= 2u_{xx}-2u_{x}+u$, $0<x<1$, if $u(0,t) = 0$, $u(1,t)=0$ and $u(x,0)=1$.
I tried the change of variables $u(x,t)= e^{x-t}v(x,t)$, but when I do so, only the linear term $u$ disappears and my b.c.'s and I.c.'s have exponential terms in the denominator.
I'm thinking this probably isn't the best change of variables to pick. Any hints on one that could be better at achieving my goals?
Continuing on from caverac's answer, I'm going to approach this slightly differently - I'll call the separation constant $-c^2$, which will make things easier in the long run. It's no restriction, because $c$ could be complex (it will turn out that it isn't).
So, we have two ordinary differential equations to solve.
\begin{align} T'(t) + c^2T(t) &= 0\\ 2X''(x) - 2X'(x) + (1+k^2)X(x) &= 0 \end{align}
The first one is easily solved and we have
$$T(t) = Ae^{-c^2t}$$
Looking at the second equation we recognise it as a linear equation. The characteristic equation is
$$2\lambda^2-2\lambda+1+c^2=0 \Leftrightarrow \lambda^2-\lambda+\frac{1+c^2}{2}=0$$
Its roots are given by
$$\lambda_{1,2} = \frac{1\pm\sqrt{-1-2c^2}}{2}$$
(which could be complex or real, as we don't know if $c$ is real a priori) and thus we have
$$X(x) = Be^{\lambda_1x}+Ce^{\lambda_2x}$$
Now recall that our assumption was that $u(x,t) = X(x)T(t)$. Letting $a:=AB, b:=AC$, we thus have
$$u(x,t) = e^{-c^2t}\left(ae^{\lambda_1x}+be^{\lambda_2x}\right)$$
We now plug in the boundary conditions and the initial condition. First, we have $u(0,t) = 0$, and thus
$$0=e^{-c^2t}\left(a+b\right)$$
This gives us one equation: $a=-b$. Using this information, we rewrite the solution slightly:
\begin{align} u(x,t) &= e^{-c^2t}\left(ae^{\lambda_1x}+be^{\lambda_2x}\right)\\ &=e^{-c^2t+\frac{x}{2}}\left(ae^{\frac{\sqrt{-1-2c^2}}{2}x}-ae^{-\frac{\sqrt{-1-2c^2}}{2}x}\right)\\ &=2ae^{-c^2t+\frac{x}{2}}\sinh\left(\frac{\sqrt{-1-2c^2}}{2}x\right) \end{align}
We now use the second boundary condition, that $u(1,t)=0$.
$$0=2ae^{-c^t+\frac{x}{2}}\sinh\left(\frac{\sqrt{-1-2c^2}}{2}\right)$$
If the argument of the $\sinh$-function is real, then this is only possible for either that argument being zero or $a=0$, both which yield the trivial solution $u(x,t)=0$. However, if the argument of the $\sinh$-function is complex, then it becomes (apart from some factor) a $\sin$-function. Thus, we assume that $c\in\mathbb{R}$ (as this leads to the argument of the $\sinh$-function becoming complex) and we can rewrite the solution as follows:
$$u(x,t) = 2ae^{-c^2t+\frac{x}{2}}\sin\left(\frac{\sqrt{1+2c^2}}{2}x\right)$$
For this to be equal to $0$ for $x=1$, the following must hold:
$$\frac{\sqrt{1+2c^2}}{2}=n\pi$$
for some integer $n\in\mathbb{N}$.
This implies that
$$c=\sqrt{\frac{4n^2\pi^2-1}{2}}$$
This, however is a solution for any integer $n$ - thus, we write the general solution as a Fourier Sine series (where we absorb the factor $2$ into our arbitrary constant $a$):
$$u(x,t) = e^{\frac{x}{2}}\sum_{n=1}^\infty a_ne^{-\frac{4n^2\pi^2-1}{2}t}\sin(n\pi x)$$
Now, we must determine the coefficients $a_n$, and then we are done. To do this, use the initial condition that $u(x,0)=1$, which implies
$$e^{-\frac{x}{2}}=\sum_{n=1}^\infty a_n\sin(n\pi x)$$
Thus, $a_n$ are simply the Fourier coefficients of $e^{-\frac{x}{2}}$, which can be easily calculated by the relation
\begin{align} a_n &= 2\int_0^1 e^{-\frac{x}{2}}\sin(n\pi x)dx\\ &=2\Im\left[\int_0^1e^{\left(-\frac{1}{2}+in\pi\right)x}dx\right]\\ &=4\Im\left[\frac{e^{-\frac{1}{2}+in\pi}-1}{-1+2in\pi}\right]\\ &=4\Im\left[\frac{\left(e^{-\frac{1}{2}+in\pi}-1\right)(-1-2in\pi)}{1+4n^2\pi^2}\right]\\ &=4\Im\left[\frac{1+2in\pi-e^{-\frac{1}{2}+in\pi}-2in\pi e^{-\frac{1}{2}+in\pi}}{1+4n^2\pi^2}\right]\\ &=4\Im\left[\frac{1+2in\pi-e^{-\frac{1}{2}}\left(\cos(n\pi)+i\sin(n\pi)\right)-2in\pi e^{-\frac{1}{2}}\left(\cos(n\pi)+i\sin(n\pi)\right)}{1+4n^2\pi^2}\right]\\ &=4\frac{2n\pi-\frac{\sin(n\pi)}{\sqrt{e}}-\frac{2n\pi\cos(n\pi)}{\sqrt{e}}}{1+4n^2\pi^2}\\ &=\frac{8n\pi}{1+4n^2\pi^2}\left(1-\frac{(-1)^n}{\sqrt{e}}\right) \end{align}
Plugging this in, we have the final solution