We have equation of line y=x and equation of circle x2+y2−2x=0
Now, intersecting points of given line and circle, x2+x2−2x=0 ⇒2x2−2x=0 ⇒2x(x−1)=0 ⇒x=0,1
when x=0 then y=0 and when x=1 then y=1 ∴ Coordinates of end points of diameter AB are (0,0) and (1,1) ∴ Required equation of circle with diameter AB (x−0)(x−1)+(y−0)(y−1)=0 ⇒x2−2+y2−y=0 ⇒x2+y2−x−y=0