Let b=speed of boat and c=speed of current. Time to go upstream against the current is 30/(b-c). Time to go downstream with the current is 42/(b+c). So 30/(b-c)=42/(b+c)=3. Take the first pair of expressions: 30(b+c)=42(b-c) (cross-multiplying); 30b+30c=42b-42c; 72c=12b, making b=6c mph.
Also, 30/(b-c)=3, 30=3b-3c=18c-3c=15c, making c=30/15=2 mph.
Check that this is satisfied in 42/(b+c)=3: 42=3b+3c=18c+3c=21c, making c=42/21=2 mph.