To convert a liter to a gallon, set a proportion of one gallon to the number of liters it contains versus the number of liters known to x gallons. A gallon is legally defined in the United States as 2.31 cubic inches, or 3.785411784 liters.
The equation for this proportion is simple algebra. First set a ratio of liters to gallons based on the known conversion rate. That results in 3.785411784 liters / 1 gallon. Then set that proportionate to the number of liters there are to x gallons. For example, if there are 5 liters, the correct ratio is 5 liters / x gallons. Solve the equation 3.785411784 liters / 1 gallon = 5 liters / x gallons for x. The solution for x is the number of liters there are in gallons.