Hi, Stanislav
I am not sure whether there is a function coping with this directly.
But, if you suspect how your expression should look like, for instance, in your case:

then you can use Solve[] to find a. FullSimplify[] it (eventually with additional assumptions) and there is your result.