How can I solve this impulsive heat equation please?

I need to solve the following impulsive heat equation:

$$
\left\{\begin{array}{ll}
\partial_{t} \psi(x,t)-\partial_{xx} \psi(x,t)=0, & (x,t)\in (0,1) \times((0, 2) \backslash\{1\}) \\
\psi(0,t)= \psi(1,t)=0, & t \in  (0, 2) \\
\psi(x, 0)= x (1-x), & x \in (0,1) \\
\psi(x, 1)=\psi\left(x, 1^{-}\right)+4, & x \in (0,1)
\end{array}\right.
$$

1^{-} denotes the limit to the left!

This is the code I tried in Mathematica, but it’s not giving the results

                               (* problem *)
homogen = If[x = 1, {f[x, t] == Limit[f[x, t], t -> 1, Direction -> "FromBelow"] + 4}, {D[f[x, t], {t, 1}] - D[f[x, t], {x, 2}] == 0}];
                         (*Initial conditions *)
ic = {f[x, 0] == x*(1 - x)};
                   (* Dirichlet boundary conditions*)
bc = {f[0, t] == 0, f[1, t] == 0};
                          (*solution*)
sol = DSolve[{homogen, ic, bc}, f[x, t], {x, 0, 1}, {t, 0, 2}]

If[x = 1 ? Perhaps you meant If[x == 1? Try using Piecewise rather than If.

thank you for your reply, but it’s not working!!

You will have to be more specific than

but it’s not working!!

Post the code you tried.