Margaret Baker Cochran, 57, a former teacher and guidance counselor with the Montgomery County public school system, died of cancer April 25 in Los Alamos, N.M.

She had moved there from her home of 30 years in Bethesda last December to be with her son, William W. Cochran II.

Mrs. Cochran worked for the county school system for about 16 years. She had earned a bachelor's degree in education from George Washington University in 1961 and a master's degree in education in 1969.

She was the widow of S. William Cochran, chief litigation attorney for the U.S. Patent Office who died here in 1974.

Mrs. Cochran was born in Buena Vista, Va. She grew up in Williamsburg, Va.

She was a pilor with an instrumeent rating, who took frequent cross-country flights and had flown to the Virgin Islands. She belonged to the Aircraft Owners and Pilots Association.

Mrs. Cochran belonged to St. Johns Episcopal Church in Chevy Chase.

In addition to her son, she is survived by three stepdaughters, Alice C. Hutcheson of Roanoke, Louise C. Schneider of Gaithersburg, and Ellen C. Moran of Vienna, two brothers, three sisters, and seven grandchildren.

The family suggests that expressions of sympathy be in the form of contributions to Trinity on the Hill Episcopal Church in Los Alamos.