How do capacitors and inductors behave when they are charging in a circuit with a DC source?
They behave according to the capacitor and inductor equations. Here they are:

$$
i_c(t) = C\frac{dv_c(t)}{dt}
$$

$$
v_l(t) = L\frac{di_l(t)}{dt}
$$

where


\$i_c(t)\$ is the current through the capacitor with capacitance \$C\$ at time \$t\$
\$v_c(t)\$ is the voltage across the capacitor with capacitance \$C\$ at time \$t\$
\$i_l(t)\$ is the current through the inductor with inductance \$L\$ at time \$t\$
\$v_l(t)\$ is the voltage across the inductor with inductance \$L\$ at time \$t\$


Notice the \$\frac{d}{dt}\$ terms are precisely the "when they are changing" factors you're concerned with.