In the same way you can to find a solution to your 1st, more general equation (with appropriate abbreviations):
r = (a0 +
Integrate[ u[t]/f[t] Exp[Integrate[(A + D[f[tt], tt])/f[tt], {tt, c2, t}]], {t, c1, x}])
Exp[-Integrate[(D[f[tt], tt] + A)/f[tt], {tt, c2, x}]]
In[57]:= f[x] D[r, x] + r (D[f[x], x] + A) // FullSimplify
Out[57]= u[x]