How to proceed with this Second Order PDE? I would really like to solve the following with the method you will see below. I have done some work but I have no idea how to continue. Any help would be greatly appreciated.  
$$
\frac{\partial u(x, t)}{\partial t} = -k(x)u(x, t) 
+A\frac{\partial u(x, t)}{\partial x}+B\frac{\partial^{2}u(x, t)}{\partial x^{2}}
$$
$$ u(x, 0) = 1 $$
Where ... lets say:
$A = 0.05, \ B = 0.5, \ k(x) = 0.5x^{2}$
and Boundary Conditions: 
$ u(0, t) = 0, \ u(5, t) = 1 $

$ \\ $
Assume: $ u(x, t) = \phi (x)T(t) \\ $
$
\frac{\partial u(x, t)}{\partial t} = \frac{\partial(\phi (x)T(t))}{\partial t} 
 = \phi (x)T^{\prime}(t)
$
$
A\frac{\partial u(x, t)}{\partial x} = A\frac{\partial(\phi (x)T(t))}{\partial x} 
 = A\phi ^{\prime}(x)T(t)
$
$
B\frac{\partial^{2}u(x, t)}{\partial x^{2}} = B\frac{\partial^{2}(\phi (x)T(t))}{\partial x^{2}} 
 = B\frac{\partial(\phi ^{\prime}(x))}{\partial x}T(t) = B\phi ^{\prime\prime}(x)T(t) \\
$
Once, all terms are defined - write out the whole equation: 
$
\phi (x)T^{\prime}(t) = -k(x)\phi (x)T(t) 
+A\phi ^{\prime}(x)T(t)+B\phi ^{\prime\prime}(x)T(t) \\
$
Manipulate it a little bit, set it equal to some constant: 
$
\frac{T^{\prime}(t)}{T(t)} = \frac{-k(x)\phi (x)}{\phi (x)}+A\frac{\phi ^{\prime}(x)}{\phi (x)} +B\frac{\phi ^{\prime\prime}(x)}{\phi (x)} 
$
$
\frac{T^{\prime}(t)}{T(t)} = 
\frac{-k(x)\phi (x)+A\phi ^{\prime}(x)+B\phi ^{\prime\prime}(x)}{\phi (x)}
 = -\lambda 
$
We end up with two separate equations:
$
T^{\prime}(t)+\lambda T(t) = 0 
$
and
$
-k(x){\phi (x)}+A\phi ^{\prime}(x)+B\phi ^{\prime\prime}(x) 
+\lambda \phi (x) = 0
$
I do not know how to continue beyond this point... 
 A: First observation: your boundary conditions are not consistent. If your left boundary condition is $u(0,t) = 0$, while the initial condition is $u(x,0) = 1$, then these conditions do not match at $(x,t) = (0,0)$. So, let's take a look at two situations: a) ignoring the initial condition, and b) ignoring the left boundary condition. We're going to try tackle both situations with separation of variables. Following the analysis in your question (which is entirely correct), we end up with two equations:
\begin{equation}
\frac{1}{2}\phi'' + \frac{1}{20} \phi' - \left(\frac{x^2}{2}-\lambda\right) \phi = 0 \tag{1}
\end{equation}
and
\begin{equation}
 T' + \lambda T = 0. \tag{2}
\end{equation}
The solution to $(2)$ is very easy: we obtain $T(t) = T_0 e^{-\lambda t}$. The solution to the second ODE can be expressed in terms of the Hermite polynomial and the hypergeometric function $_1F_1$, as
\begin{equation}
 e^{-\frac{x^2}{2}-\frac{x}{20}} \left[c_1 \,H_{-\lambda-\frac{401}{800}}(x) + c_2 \phantom{1}_1 F_1(\frac{401}{1600}+\frac{\lambda}{2},\frac{1}{2},x^2)\right]. \tag{3}
\end{equation}
a) Ignoring the initial condition, we have to find a way to incorporate the boundary conditions $u(0,t) = 0$ and $u(5,t) = 1$. From $u(x,t) = T(t) \phi(x)$, the left boundary condition gives $\phi(0) = 0$, since $T(t) = T_0 e^{-\lambda t}$ is only zero if $T_0 = 0$, which would yield the trivial solution $u = 0$; this trivial solution obviously does not satisfy the right boundary condition $u(5,t) = 1$.
This right boundary condition yields for the general solution $T(t) \phi(5) = 1$. This implies that $T(t)$ is constant in $t$, which in turn implies that $T_0=0$, violating the right boundary condition. 
We conclude that a solution obtained by separation of variables cannot obey the right boundary condition $u(5,t) = 1$. Note that changing this boundary condition to $u(5,t) = 0$ could be a way forward, since the equations $\phi(0) = 0$ and $\phi(5) = 0$ can be used to determine the constants $c_1$ and $c_2$ in $(3)$.
b) Ignoring both boundary conditions for the moment, we try to incorporate the initial condition $u(x,0) = 1$. In terms of the solution obtained by separation of variables, this means that $T(0) \phi(x) = T_0 \phi(x) = 1$. This means that $\phi(x)$ is constant in $x$. One way to make sure this happens is to choose $c_1 = c_2 = 0$, but this would yield $\phi(x) = 0$, violating the initial condition. Therefore, the alternative would be to look for $\lambda$-values for which both the Hermite polynomial and the hypergeometric function are equal to $e^{\frac{x^2}{2}+\frac{x}{20}}$. However, from the ODE $(1)$, we already see that the only constant solution is the zero solution: if $\phi(x) = \frac{1}{T_0}$, then $\phi' = 0$ and $\phi'' = 0$, yielding (see $(1)$)
\begin{equation}
\left(\frac{x^2}{2}-\lambda\right)\phi = 0,
\end{equation}
which can only be true for all $x \in (0,5)$ if $\phi = 0$. So, a solution obtained by separation of variables cannot obey the initial condition $u(x,0) = 1$.
To conclude: If you want have a chance to obtain a solution to this equation by separation of variables, choose different boundary conditions.
A: The PDE isn't nonlinear; it is linear. It is only non-linear if $u$ shows up in some non-linear function. Like if there was a $u^2$ or an $e^u$ or $u \frac{\partial u}{\partial t}$ then it would be nonlinear. But this equation has nothing like that.
From where you are, you have $$B\phi'' + A\phi' + \lambda \phi = \tfrac 1 2 x^2, \,\,\,\,\,\, \phi(0) = 0, \phi(5) = 1.$$ To solve this, you need a particular solution and a homogeneous solution. For the particular solution, since you have a polynomial on the right hand side, you can just guess $$\phi_p(x) = \alpha x^2 + \beta x + \gamma,$$ plug it in and just solve for $\alpha, \beta, \gamma$ in terms of $A,B,\lambda$. For the homogeneous solution, you can guess $$\phi_h(x) = Ce^{mx},$$ where $C$ is an arbitrary constant. When you plug this in, you get a quadratic equation for $m$; solving this gives two roots, $m_+$ and $m_-$ (where the $\pm$ corresponds to the $\pm$ in the quadratic formula). Then your full solution for $\phi$ is $$\phi(x) = \phi_p(x) + \phi_h(x) = \alpha x^2 + \beta x + \gamma + C_1e^{m_+x} + C_2 e^{m_-x}$$ and you need to pick $C_1, C_2$ so that the boundary conditions are satisfied. 
For $T$ the procedure is similar, but the equation is much easier: $$T' + \lambda T = 0, \,\,\,\, T(0) = 1$$ gives $T(t) = e^{-\lambda t}.$
