TH1: x<-2018 PT (1) <=>
-(x+2017)+2017x-(x+2018)+2018x=4040x
<=> -x-x+2017x+2018x-4040x=2017+2018
<=>-7x=4035
<=>x=(-4035/7)(loại).
TH2: -2018≤ x <-2017 PT (1) <=>
-(x+2017)+2017x+(x+2018)+2018x=4040x
<=> -x+x+2017x+2018x-4040x=2017-2018
<=>-5x=-1
<=>x=(1/5)(loại).
TH3: 2017≤x PT (1) <=>
(x+2017)+2017x+(x+2018)+2018x=4040x
<=> x+x+2017x+2018x-4040x=-2017-2018
<=>-3x=-4035
<=>x=1345
vậy PT (1) có một nghiệm duy nhất x=1345