This reminds on when i learned programming as a child from the C64 manuals. There was an example moving a sprite within a loop, and it took me weeks to figure out i can just change the position every frame based on key press, NOT using a loop, haha
Here is a snippet comparing closed from solution to integration for free fall under gravity:
const float timestep = 1.0f / 60.0f;
const float start = 0;
float p = start; // position
float v = 0; // velocity
float a = -10.0f; // constant gravity acceleration
for (float t = 0; t <= 2; t += timestep)
{
v += a * timestep;
p += v * timestep;
cout << "integrated position: " << p << " velocity: " << v << endl;
float pCF = start + 0.5f * a * t*t;
float vCf = a * t;
cout << "closed form position: " << pCF << " velocity: " << vCF << endl;
}
The numbers should closely match, aside from some small integration error. (Otherwise i did something wrong)
Closed form would be more accurate, but it's useless for what you want to do.
You want to use integration, likely doing it once each frame with a fixed timestep to advance time for the 'small movement'.
And to make a jump you would add an impulse to velocity, somehow like this:
GameLoop ()
{
if (KeyUP && onGround) sprite.velocity -= 5;
const float dt = 1/60;
IntegratePhysics(dt); // sprite.velocity += gravity*dt; sprite.position += sprite.velocity * dt;
Draw();
}