Simple in principle, but a pain in practice because the pressure changes constantly throughout the launch of the bullet and expulsion of propellant gas.

What matters to the slide's blowback function is that it pick up enough momentum to carry it through cocking the hammer (where there is one) and compressing the recoil springs and arriving fully in counter-battery with enough momentum to spare to compensate for build up of dirt, cold temperature thickening of lubricant, etcetera, so the gun operates reliably.

Momentum is mass times velocity, so in order to have that momentum the slide has to have been accelerated. Acceleration results from the application of some amount of force for some period of time. Force×time is called impulse. It has units of Newton-seconds, but those convert to units of kg-m/s or lb-ft/sec, which happen to be the same units as momentum has. The impulse that introduces momentum is thus exactly equal to the difference in momentum between the start and end of the impulse.

The mathematical way to quantify the impulse applied the slide is to integrate the force applied rearward with respect to time from start to finish. That's calculus 101 applied to physics 101. It would be simple, within those disciplines, except that to proceed you first need a function that describes the force as a time dependent variable. That will equal breech pressure as a time dependent variable after multiplying by the cartridge head area. But the pressure function varies with every powder and bullet combination you choose. Indeed, a blowback operated .22 LR or .25 Auto often has a fairly light slide, and with a stiff enough recoil spring, that is good enough. But when you get to a 9 mm or .45 Auto blowback operated gun, like the Sten gun and M3 Grease gun, respectively, you've got to have either very stiff springs or a very heavy bolt mass to prevent the force from pushing the bolt back a significant distance before the bullet can clear the muzzle and pressure has dropped. Otherwise you would burst the cases.

There are additional complexities in how you allow for friction of the brass in the chamber, the force needed for brass stretching, where it occurs, and so on. For that reason, you have to decide whether you want to know the total force pushing the inside of the case or just the portion left over after friction; the force actually applied to the slide.

You can arrive at rough estimates of those. For overall momentum applied to the gun, you can take advantage of Newton's third law of motion that says equal and opposite forces act on the gun and expelled mass, which means you have an equal and opposite impulse, which means you wind up with equal and opposite momentum. So, you take the momentum of the bullet, less an allowance of perhaps 3% or so of velocity being gained from muzzle blast after leaving the barrel, add momentum of the portion of the gas mass accelerated inside the bore, and finally the momentum imparted to the gas mass during its very rapid acceleration as muzzle blast (rocket effect). Your gun's momentum will be equal and opposite to all that.

SAAMI has a free publication with recommended values for estimating the above,

here. SAMMI is interested in perceived recoil, so they calculate estimated free recoil energy, but they give you the needed elements of combined velocity and mass to arrive at momentum instead. Just multiply the mass times the velocity (the top two formulas on the third page). You now have a good estimate of the total rearward momentum. The portion that goes to bolt will be what is left over after subtracting the portion spent starting back against the initial force of the recoil springs and the friction of the case drag in the chamber under pressure.

How much all that adds up to can be estimated pretty well for a particular gun, too. You just need to carefully empty the gun, then see how much force it takes to cock the gun by using a dowel in through the muzzle to push down on the breech while the butt is against a scale. You probably want to take that force every quarter inch or so and be sure to include the cocking of the firing mechanism. From that, you can plot force over distance, arriving at the average force over each quarter inch. You then take the mass of the bolt assembly and half the mass of the recoil spring and apply those forces to them to see how fast each quarter inch would accelerate that mass if it was a push rather than a resistance. At the end you'll have the minimum slide momentum needed to cock the gun and reach full counter-battery, except for the extraction friction of the case. This will also will not take the inertia of the mass of the hammer and mainspring into account, but you can figure some of that out, too, once you have approximate velocities and if you really want more detail. Friction is omitted, too, but if you subtract the resultant momentum from this approximation from the total momentum you found for the recoiling gun, then you'll have a range of difference within which all the missing elements fall.

The above is not analytically perfect, but will get you in the ballpark.