There are many integrals for f(x). Infinitely many, in fact. You need to use an initial condition to determine the correct constant of integration. You have:
So, the integral of f on [5,7] is:
On the interval [3,5], you have:
So, now, you want .
Basically, at each point between two intervals, you want the A(x) function to be continuous, so you find the value of the constant of integration to make it continuous.