How to model log transformation & quadratic fit in regression analysis

How can I model quadratic fit after log transformation?

I am trying to recreate a regression model from Trade Analysis Textbook (Page 16, code for Stata):

According to my visualizations, such a model would fit the data better too.


This is how I modeled quadratic fit, but if I just try to add log_gdp_ppc instead of gdp_ppc R-squared decreases and squaring log seems a strange thing to do. It is also strange that the parabola changes direction (if I log transform openness too relationship becomes linear).