Alexander Reid repeatedly told Department of Work and Pensions staff in application forms and at interviews that he was single.
But in reality he was living with his wife Kathleen Reid, despite having claimed to be separated.
Reid was found guilty following a trial at Dundee Sheriff Court.
The 59-year-old, from Dundee, had denied a charge under the Social Security Administration Act that he fraudulently claimed employment support allowance and income support totalling £39,808.
Defence solicitor John Boyle asked that Reid be spared jail and given a community payback order as an alternative to a prison sentence.
Sheriff Tom Hughes told Reid: "Because of the sum of money involved a custodial sentence is the only option."
A man who fraudulently claimed nearly £40,000 in benefits over the course of almost 11 years has been jailed for 18 months.