Writing about your ex-boss, who also happens to be the president of the United States, can be profitable.

A sampling of the crop of books on President Reagan by former administration officials shows that some of the authors have done quite well.There was a first printing of 250,000 copies for Donald T. Regan's "For the Record: From Wall Street to Washington," to be published by Harcourt Brace Jovanovich on May 23. There's a second printing of 75,000, and the former White House chief of staff was given a $1 million advance. Regan says he is donating the advance and the proceeds of the book to charity.

Harper & Row spent a reported $2.4 million in 1986 for David Stockman's "The Triumph of Politics: Why the Reagan Revolution Failed." The investment seems to have paid off for both the publisher and the former director of the Office of Management and Budget with 325,000 books in print.

"Revolution," a book written by Martin Anderson, former assistant to the president for policy development, to be published on May 18, has a first printing from Harcourt of 25,000.