The equation
Close the switch and current flows into the capacitor, so its voltage v starts to rise. A differential equation is a rule that links a quantity to its own rate of change, dv/dt: how many volts per second v is rising right now.
Around the loop the source voltage is shared: Vs = iR + v. A capacitor's current is i = C·dv/dt. Substitute and you get RC·dv/dt + v = Vs. It is first order because only the first derivative of v appears.
Step by step
Rearrange to dv/dt = (Vs − v)/RC. Here RC = 1 kΩ × 100 µF = 0.1 s, so at v = 0 the slope is 10 ÷ 0.1 = 100 V/s. The emptier the capacitor, the steeper the rise; a full one barely moves.
Walk the rule forward in steps of dt = 0.05 s: new v = v + dt × slope. First 0 + 0.05 × 100 = 5 V. The slope drops to 50 V/s, so next v = 7.5 V. A loop repeats it.
Exact solution
For the exact answer, gather every v on one side: dv/(Vs − v) = dt/RC. Integrate both sides: −ln(Vs − v) = t/RC + K. At t = 0 the voltage is 0, which fixes the constant: K = −ln Vs.
Solve for v: v(t) = Vs(1 − e^(−t/RC)). Check it: at t = 0 it gives 0, and its slope (Vs/RC)·e^(−t/RC) equals (Vs − v)/RC at every moment. So it obeys both the equation and the starting value.
RC sets the speed, so it gets a name: the time constant τ (tau), here 0.1 s. At t = τ, v = 10(1 − e^−1) = 6.32 V, 63% of the way. Each further τ closes 63% of the gap that is left.
At t = 5τ = 0.5 s, v = 9.93 V, more than 99% of 10 V. The curve never quite reaches 10 V, but after five time constants engineers treat the capacitor as full. The current i = C·dv/dt has died away too.
In practice
At t = 0.1 s Euler says 7.5 V, but the exact value is 6.32 V. Each step uses the slope at its start, which is too steep by the end. Change line 2 to dt = 0.001 and Euler gives 6.34 V.
Every equation of the form dy/dt = (y∞ − y)/τ has the answer y = y∞ + (y0 − y∞)e^(−t/τ). The same curve describes a capacitor discharging, the current in an RL circuit and a cup of coffee cooling.
Try it in the Python prompt
;; step 1/10 · An equation about change >>> R, C, Vs = 1e3, 1e-4, 10 # 1 kΩ, 100 µF, 10 V >>> R * C # seconds 0.1
An equation like dv/dt = (Vs − v)/RC has a whole family of solutions; the starting value v(0) = 0 picks out one. Together they are called an initial value problem. Here ln is the natural logarithm (math.log in Python) and e ≈ 2.71828 is its base, so e^(−1) ≈ 0.368 and 1 − e^(−1) ≈ 0.632.