In this work, an inverse design method that couples the multi-physics model for a solar trough thermochemical reactor (SPTR) and shape optimization model is proposed to find out optimal solar flux distribution for maximizing overall reactor performance. The gradient-based segmentation method is applied to convert the continuous solar flux into step-like flux to guide the concentrator system design. Performance comparisons among uniform flux, linear decreasing flux, and the optimized non-linear flux are also conducted to discuss the reliability of SPTR performance improvement. The results show that the optimized non-linear solar flux can improve the methanol conversion, solar thermochemical conversion, and hydrogen yield of SPTR by 2.5, 3.3, and 2.4%, respectively, compared with the uniform flux. This is attributed to the fact that the optimized non-uniform flux distribution enhances the synergy between temperature and reaction fields, and achieves a better match between spatial solar flux supply and local energy demand by reactions. Also, it is shown that the optimized step-like flux, achieved by regressing the optimized non-linear flux, can perfectly maintain SPTR performance and is effective in boosting SPTR performance under different operating conditions.