Post exposure bake (PEB) Diffusion effect is one of the most difficult issues in modeling chemically amplified resists. These model equations result in a system of nonlinear partial differential equations describing the time rate of change reaction and diffusion. Verifying such models are difficult, so numerical simulations are needed to solve the model equations. In this paper, we propose a high speed 3D resist image simulation algorithm based on a novel method to solve the PEB Diffusion equation. Our major discovery is that the matrix formulation of the diffusion equation under the Crank– Nicolson scheme can be derived into a special form, AX+XB=C, where the X matrix is a 3D resist image after diffusion effect, A and B matrices contain the diffusion coefficients and the space relationship between directions x, y and z. These matrices are sparse, symmetric and diagonal dominant. The C matrix is the last time-step resist image. The Sylvester equation can be reduced to another form as (I⊗A + BT⊗I) X =C, in which the operator ⊗ is the Kronecker product notation. Compared with a traditional convolution method, our method is more useful in a way that boundary conditions can be more flexible. From our experimental results, we see that the error of the convolution method can be as high as 30% at borders of the design pattern. Furthermore, since the PEB temperature may not be uniform at multi-zone PEB, the convolution method might not be directly applicable in this scenario. Our method is about 20 times faster than the convolution method for a single time step (2 seconds) as illustrated in the attached figure. To simulate 50 seconds of the flexible PEB diffusion process, our method only takes 210 seconds with a convolution set up for a 1240×1240 working area. We use the typical 45nm immersion lithography in our work. The exposure wavelength is set to 193nm; the NA is 1.3775; and the diffusion coefficient is 1.455×10-17m2/s at PEB temperature 150°C along with PEB time 50 seconds with image resolution setup to be 1240×1240.