Brahmagupta gave the solution of the general linear equation in chapter eighteen of Brahmasphutasiddhanta.