I want definitions for problems like:-

1) (x-1) * O(x)

2) O((x-a)

^{2}) where a is some positive number

etc.

Since I want to implement this on a computer I would prefer some algorithm or paper that defines and tells you how to deal with operations on big O terms.

Thank you!