# Solving a partial differential equation given inhomogenous boundary conditions involving derivativesss

I want to solve the following partial different equation.

Find $u(x, t)$, satisfying $u_t = u_{xx}$ , $u(x, 0) = x − x^2$ , $u(0, t) = T_0$ , $u_x (1, t) = 0$ and $|u|$ is bounded.

Using separation of variables, and eliminating solutions that diverge with time, one gets $u(x,t)=e^{ \lambda^2t}(A \cos(\lambda x)+B\sin(\lambda x))$

How do I proceed after this? The condition $u_x (1, t) = 0$ gives $A=-B \tan(\lambda )$ which is giving me a contradiction for the condition $u(0, t) = T_0$ , as you get $-e^{ \lambda^2}B\tan(\lambda)=T_0$

-

Consider $v(x,t)=u(x,t)-T_0$. Then $v$ satisfies the equation $$v_t-v_{xx}=0$$ with initial condition $$v(x,0)=x-x^2-T_0$$ and homogeneous boundary conditions $$v(0,t)=0,\quad v_x(1,t)=0.$$ Now use separation of variables to solve for $v$.