Let one number be X, then the other number is 40 - X
X(40−X)=375
40X−X2=375
X2−40X=−375
Add square of the half of the coefficient of X to both side
X2−40X+400=25
(X−20)2=25
X−20=25
X−20=5
X=20+5=25
one number is 25 and the other number is 40 -25 = 15