\[V_a=V_S+\left({V_p-V_S}\right)\frac{R_g}{R_g+R_S}\]
\[Def\ :\ \frac1{\mathbf{R_X}}=\frac1{R_g+R_S}+\frac1{R_P}=\\ =\frac{R_g+R_S+R_P}{\left({R_g+R_S}\right)R_P}\]
\[V_n=V_Z+\left({V_O-V_Z}\right)\frac{R_X}{R_X+R_f}\]
\[V_p=V_S+\left({V_R-V_S}\right)\frac{R_X}{R_X+R_f}\]
\[V_b=V_Z+\left[{\cancel{V_Z}+\left({V_O-V_Z}\right)\frac{R_X}{R_X+R_f}\cancel{-V_Z}}\right]\frac{R_g}{R_g+R_S}=V_Z+\left({V_O-V_Z}\right)\frac{R_X}{R_X+R_f}·\frac{R_g}{R_g+R_S}\]
\[V_a=V_S+\left[{\cancel{V_S}+\left({V_R-V_S}\right)\frac{R_X}{R_X+R_f}\cancel{-V_S}}\right]\frac{R_g}{R_g+R_S}=V_S+\left({V_R-V_S}\right)\frac{R_X}{R_X+R_f}·\frac{R_g}{R_g+R_S}\]
\[V_S-V_Z=\left({V_O-V_R+V_S-V_Z}\right)\frac{R_X}{R_X+R_f}·\frac{R_g}{R_g+R_S}\]
\[\boxed{\quad A_V\quad}=\frac{V_O-V_R}{V_S-V_Z}=\left({1+\frac{R_f}{R_X}}\right)\left({1+\frac{R_S}{R_g}}\right)-1=\cancel{1}+\frac{R_f}{R_X}+\frac{R_S}{R_g}+\frac{R_fR_S}{R_XR_g}\cancel{-1}=\]
\[=\frac{R_gR_f+R_XR_S}{R_XR_g}+\frac{R_fR_S}{R_XR_g}=\frac{R_fR_S}{R_XR_g}\left({\frac{R_g}{R_S}+\frac{R_X}{R_f}+1}\right)=\]
\[=\frac{R_fR_S}{R_g}·\frac{R_g+R_S+R_P}{\left({R_g+R_S}\right)R_P}\left({\frac{R_g}{R_S}+1+\frac1{R_f}·\frac{\left({R_g+R_S}\right)R_P}{R_g+R_S+R_P}}\right)=\]
\[=R_f·\frac{R_S}{R_g}\left({\frac1{R_P}+\frac1{R_g+R_S}}\right)\left({\frac{R_g+R_S}{R_S}+\frac1{R_f}·\frac1{\frac1{R_P}+\frac1{R_g+R_S}}}\right)=\]
\[=R_f\left({\frac1{R_P}+\frac1{R_g+R_S}}\right)\frac{R_g+R_S}{R_g}+\frac{R_S}{R_g}=\boxed{\quad\frac1{R_g}\left[{R_f\left({\frac{R_g+R_S}{R_P}+1}\right)+R_S}\right]\quad}=\]
\[=R_f\left({\frac{1+\frac{R_S}{R_g}}{R_P}+\frac1{R_g}}\right)+\frac{R_S}{R_g}\]
\[\frac{A_V-\frac{R_S}{R_g}}{R_f}-\frac1{R_g}=\frac{1+\frac{R_S}{R_g}}{R_P}\]
\[\boxed{\quad R_P\quad}=\frac{1+\frac{R_S}{R_g}}{\frac{A_V-\frac{R_S}{R_g}}{R_f}-\frac1{R_g}}=\boxed{\quad \frac{R_g+R_S}{\frac{A_VR_g-R_S}{R_f}-1}\quad}\]
about :
Uses the LM324 transistor model (the simulation)[Eop]