Simple differential equation problem

1. Apr 2, 2016

NihalRi

1. The problem statement, all variables and given/known data
Find constants a and b such that y=ax + b is a solution to the differential equation
dy/dx = 4x - 2y

2. Relevant equations

3. The attempt at a solution
I already have the solution that is:
a=4x-2 (ax+b) (I'm fine with this part)
a = (4-2a) x - 2b (what happened here?)

4-2a=0 (why?) a= -2b (why?)
a= 2
b=-1

2. Apr 2, 2016

BvU

$a=4x-2 (ax+b) \Leftrightarrow a=4x-2ax-2 b \Leftrightarrow a= (4-2a) x-2 b$ can only be true for all x if $(4-2a)=0$. What remains is $a = -2b$ . Pick an a and a b follows.

3. Apr 2, 2016

Thank you