How do I solve this equation with 3 constants? (Setting one constant to an arbitrary case value?) $$m+re^{rx}=3x+2(mx+b+e^{rx}) +1 $$
Solution says:
if (r != 0) then m=2b+3; r=0; 0=3+2m  ...and then solves for m, r, and b.
if (r == 0) then m=2b+1; r=0; 0=3+2m  ...and then solves for m, r, and b.
I'm not sure how to follow this.  If r can be anything, how did they force others to become a fixed expression?   Are they matching terms and positions ?
Also, what is this method called ?
How am I supposed to know to force r to be different cases?

You have two questions here: 


*

*What's it called when you split into multiple cases like this? 

*How am I supposed to know to do this? 
For the first, I've heard it called "case analysis". 
For the second: Suppose I tell you that the difference of my son's and my daughter's ages is twice my son's age, and my daughter is $12$ (and they're not twins) and ask how old my son is. You might say to yourself "the difference in ages is $s-d$ (where $s$ is the son's age, $d$ the daughter's age). Or maybe it's $d - s$...it depends on which kid is older. Hmmm." 
There are three possibilities: my son is younger than my daughter, or older (they're not twins). So you split your work into two cases. If my son is older, the age difference is $s-d$; otherwise it's $d - s$. And then you go on and do some algebra. 
In the same way, you can look at 
$$m+re^{rx}=3x+2(mx+b+e^{rx}) +1 $$
and perhaps do a little algebra to turn it into
$$
re^{rx}- 2e^{rx}=3x+2mx+2b+ 1 -m $$
and say to yourself "Those $e^x$ terms on the left are a pain. If $r$ was zero, they'd be nice and simple. Hmmm. Let's split into cases. Case 1: $r$ is zero. That'll be easy. Case 2: $r$ is not zero. That'll be harder, but at least it'll delay things a bit."
So for case 1, you say: "Suppose $r = 0$. Then the equation becomes
\begin{align}
-2 &= 3x+2mx+2b+ 1 -m 
0 &= 3x+2mx+2b+ 1 -m + 2
0 &= (3+2m)x+(2b -m + 3)
\end{align}
This is an equality of polynomials: $0x + 0$ on the left, and $(3+2m)x + (2b-m+3)$ on the right, The coefficients must match up, so I have
$3 + 2m = 0$ and $(2b-m + 3) = 0$, and that gets you part 1 of the solution. 
Then for case 2 you say, "OK. Now let's suppose that $r$ is not zero. Then we have
$$
(r-2) e^{rx} = 3x+2mx+2b+ 1 -m = (3 + 2m) x + (2b + 1 - m)
$$
where on the left side we have an exponential function, and on the right side we have a polynomial. The only way these can be equal is if the exponential function is zero, i.e., if $r = 2$. Ah..so now we know that 
$$r = 2$$
and then using the same matching-of-coefficients trick, we see that $3 + 2m = 0$ and $(2b + 1 -m) = 0$. 
And we've matched the second part of the solution. 
