The former PM, who has so far kept out of the debate about Scotland's future, will use the Donald Dewar Lecture on August 13 to outline his views.
Mr Brown has, since leaving office after the 2010 General Election, devoted most of his time to charity work. During his tenure as PM, the MP for Kirkcaldy often beat the drum for "Britishness".
His appearance at the book festival will precede that of his former Cabinet colleague Alistair Darling, who has become the leader of the anti-independence Better Together campaign. The ex-Chancellor is due to speak on August 24.
The festival will include a debate on Scottish independence with Henry McLeish, the former Labour First Minister, arguing the merits of more powers for Holyrood, while Paul Henderson Scott, a veteran of the Scottish National Party, will put the case for independence.
The event will host a three-part debate series Rethinking the Union, featuring commentators such as former MP Tony Benn, constitutional expert Professor Stephen Tierney and former SNP MSP Andrew Wilson.
Other political events will see Roy Hattersley, former deputy leader of the Labour Party, argue for the reintroduction of ideology to mainstream politics; Tam Dalyell, veteran Labour politician, revisit the Falklands as the dispute with Argentina flares up again; and Paddy Ashdown, the former Liberal Democrat leader, call for a new perspective on political life in the wake of the Leveson Inquiry and the Libor rate-fixing scandal.
First Minister Alex Salmond will also discuss a "life beyond politics" with Ian McEwan, the award-winning novelist.