Newton's second law for a body that ejects mass: m dv/dt = T - m g - D, with thrust T = mdot * ve and exhaust speed ve = Isp * g0 (g0 = 9.80665 m/s2). With no external forces the integral is the Tsiolkovsky rocket equation dv = ve ln(m0/mf).
Gravity costs g * t_burn of that budget; drag is D = 1/2 rho Cd A v|v| with an exponential atmosphere rho = 1.225 e^(-h/8.5 km) and a fixed 10 m2 frontal area. The orange curve is the ideal dv, the blue one the real speed: the gap is gravity and drag loss.
Simplifications: purely vertical flight, constant thrust and Isp (no staging, no vacuum Isp gain, no gravity turn), flat Earth with constant g. The check button integrates the equations again at a fine time step and compares with the closed formulas.