let log Y=Y' and log X=X'

Now equation (1) can be written as,

Y'=ß1 + ß2*X'+ ui.

where ß2=Cov(X',Y')/Var(X'), ß1=mean(Y')-ß2*mean(X')

Now consider equation (2), it can be written as,

log Y=a1 + a2*(logX+logw)+ui*

or, Y'=a1 + a2*(X'+logw)+ui* (since logY=Y' and logX=X')

here a2=Cov(X'+log w,Y')/Var(X'+ log w)

Now Cov(X'+log w,Y)=Cov(X',Y')

And var(x'+log w)=var(x') (since variance is independent of change in origin).

thus a2=Cov(X',Y')/Var(X')=ß2.

Mean (X')=Mean(X')+log w.

therefore a1=mean(Y')-a2*{Mean(X')+log w},

a1=mean(Y')-a2*Mean(x')-a2*log w.

a1=mean(Y')-ß2*Mean(x')-ß2*log w. (since a2=ß2).

thus a1=ß1-ß2*log w, (since ß1=mean(Y')-ß2*mean(X')).

"I don't ride side-saddle. I'm as straight as a submarine"