 Leaving the family business to a brother, he went into politics as a Whig, and was one of the two Members of Parliament for Bolton from 1834 to 1847, before returning to the life of a country gentleman.Ainsworth was the great-grandson of the founder of the family firm, Peter Ainsworth (1713–80), who established a bleach works at Halliwell about 1740 with the financial support of a relation, Robert Ainsworth, the lexicographer.His grandfather, another Peter Ainsworth (1736-1807), expanded into chemical bleaching, and his father, Richard Ainsworth (1762-1833) continued the business and bought the Smithills Hall estate and another country house, Halliwell Hall, joining the landed gentry.