ut = uxx = K implies a solution of the form

u = K(x^2/2 + t) + Bx + C

First condition : Kx^2/2 + Bx + C = f(x)

Second condition: K + B = K/2 + Kt + B + C

or Kt + C = K/2

or C = K/2 - Kt

Third condition: B = 0

Thus u(x,t) = K/2(1+x^2)

K is found from condition one.

K = 2f(x)/(x^2 + 1 - 2t)

Thus u(x,t) = (1+x^2)f(x)/(1-2t+x^2)