.
The average rate of change of a function f(x) as x changes from "a" to "b" on the number line, is the ratio
average rate of change = .
Step by step, it means that you calculate
(a) f(a);
(b) f(b);
(c) the difference f(b)-f(a) <<<--=== in this order (!)
(d) the difference (b-a) <<<---=== in this order (!)
(e) then divide the difference f(b)-f(a) by the difference (b-a).
Your question is answered and the procedure is described in full, step by step.
For more information, and to see many solved examples (your templates), look at numerous web-sites in the internet,
for example, this web-site
https://byjus.com/average-rate-of-change-formula/#:~:text=The%20Average%20Rate%20of%20Change,amount%20of%20change%20in%20another.
The keywords for such search are " average rate of a function ".
Come again to this forum soon to learn something new ( ! )