Say we have the points $(x_1,y_1),(x_2,y_2),(x_3,y_3),\dots,(x_n,y_n)$ and we need to find the best fit equation that is of the form $y=a-be^{-x}$ (the red curve). See the illustration plot:
Based on least-squares, how to get the values of $a$ and $b$, theoretically, without using softwares?
Your help would be really appreciated. THANKS!

Let $t_i=e^{-x_i}$ and the model is just $$y=a-bt$$ which is easy.