Now why he used 'y' twice
once the length of the line
and once the tringle side ?
I said he used 'y' to the length of the line based on the term dy
It's not clear to me what you are asking.
y is used as part of the calculation of r using Pythagoras's theorem.
dy is used to indicate a small (infinitesimal) region of the linear charge distribution.
.