From my lecture notes:
$$\frac{\partial u}{\partial t}(x,t)-K\frac{\partial^2 u}{\partial x^2}(x,t)=f(x,t), \qquad 0<x<L, \qquad 0<t<T,$$ $$u(0,t)=\mu_1(t), \qquad u(L,t)=\mu_2(t), \qquad u(x,0)=u_0(x).$$
One can reduce the problem to an initial boundary problem with homogeneous boundary conditions. To do this, we choose any function $g(x,t)$ satisfying the boundary conditions
$$g(0,t)=\mu_1(t), \qquad g(L,t)=\mu_2(t).$$
Now if $u(x,t) = v(x,t)+g(x,t)$ and $u(x,t)$ is the solution of the PDE, then $v(x,t)$ must satisfy the inital boundary value problem
$$\frac{\partial v}{\partial t}(x,t)-K\frac{\partial^2 v}{\partial x^2}(x,t)=\tilde{f}(x,t), \qquad 0<x<L, \qquad 0<t<T,$$ $$v(0,t)=0, \qquad v(L,t)=0, \qquad v(x,0)=v_0(x),$$
where
$$\tilde{f}(x,t)=f(x,t)-\frac{\partial g}{\partial t}(x,t)+K\frac{\partial^2 g}{\partial x^2}(x,t).$$
Question: How does this simplify the PDE? Wouldn't you still have to include the function $g(x,t)$ and the non-homogeneous boundary conditions associated to it when performing numerical methods?