We observe that modulii in the given equation (eqn.) vanish at #x=1 and x=5.#
So, very naturally, we consider these 3 cases :
(i) #x<1#, (ii) #1<#x#<5# (iii) #x>5#
Case (i) #x<1#.
#:. #(x-1)#<0#, #(x-5)#<0#. #:. #|x-1|=1-x, |x-5|=5-x#
#:.# given eqn. becomes, #5-x+2(1-x)=7, or, 7-3*x=7, so, x=0.# We verify that this also satisfies the given eqn.
Case (ii) #1<#x#<5#.
In this case, #(x-1)#>#0# and #(x-5)#<#0#, so that #|x-1|=x-1#, #|x-5|#=#5-x#.
#:.# Eqn. becomes #5-x+2*x-2=7#. #:.# #x=4#.
We verify that #1#<#4#<#5#, and this satisfy the eqn.
Case (iii) #x>5#
Here, #(x-5)#>#0#, #(x-1)#>4>0, so, #|x-5|=x-5, |x-1|=x-1#
#:.# eqn. becomes, #x-5+2*x-2=7#, giving #x=14/3#which is non-permissible as #x>5#. Hence no root in this case!
Altogether, the roots are #x=0, x=4#.