Make a table!!
The columns of your table should be: % solution, gallons of solution, gallons of salt
It doesn't make a lot of sense right away to think about gallons of salt, but you'll see what I mean.
Do you have your table drawn? Seriously, draw it.
Now, we have three different rows for the three different mixtures - 58%, 40%, and 52%. Go ahead and put those entries in your table.
The only other thing we can put in our table right away is the number of gallons of the 40% mixture. They tell us that we have 18 gallons of that, so go ahead and put that in the table too.
Now if we look at the 40% row in our table, we know the total number of gallons and we know the percent of those gallons that are salt. If 40% of 18 gallons is salt, how much salt is there? With some quick multiplication, we see that 18*40/100 = 7.2 gallons. That's how much salt we have, so go ahead and put that in our table for the third entry.
We could do the same thing for the other two rows if we only knew how many gallons we were dealing with... Well, in algebra, when we want to work with a number but don't know what number it is, we use a variable. I'd like to use x for the number of gallons of the 58% solution, so I'm putting that in my table now.
Now, just like we solved for the amount of salt in the other mixture, we can solve for the first mixture algebraically. If 58% of x gallons is salt, than the amount of salt is x*58/100 = .58x.
Ok, do you have everything in your table filled out except for the 52% row? If you're missing something try to re-read what I have and reason your way through before finishing.
For our final mixture, the 52%, we're really combining the two other mixtures. We have 18 gallons of one mixture, and we have x gallons of the other mixture, and we're going to add them together. So how many gallons will we have in total? This is addition, so we can write x+18 for the gallons of solution entry.
What do you think we're gonna do with that? Same drill, we're gonna multiply together our first and third entry from the 52% row, resulting in something like .52(18+x)
But wait, I could have found that final entry a DIFFERENT way. Since we're not inventing any salt, we're just adding from the two other mixtures, I should really be able to add together the amounts of salt from the other two mixtures (.58x and 7.2) and get the same answer.
These two expressions were found in different ways but represent the same thing, so I should be able to set them equal to each other -
.52(18+x)=.58x+7.2
Now we have one equation and one unknown. It's really important how we got this though, so feel free to respond if you don't understand the steps.
Solving this is hopefully not a problem - we'll distribute and move our variable all to one side, then we'll undo addition/subtraction then undo multiplication/division. In this case,
9.36+.52x=.58x+7.2
9.36=.06x+7.2
2.16=.06x
36=x