Let [tex]A(t)[/tex] be the amount of salt (in lbs) in the tank at time [tex]t[/tex]. Then
[tex]\dfrac{\mathrm dA(t)}{\mathrm dt}=\dfrac{1\text{ lb}}{1\text{ gal}}\dfrac{4\text{ gal}}{1\text{ min}}-\dfrac{A(t)\text{ lbs}}{80+(4-8)t)\text{ gal}}\dfrac{8\text{ gal}}{1\text{ min}}[/tex]
[tex]\dfrac{\mathrm dA(t)}{\mathrm dt}=4-\dfrac{2A(t)}{20-t}[/tex]
[tex]\dfrac{\mathrm dA(t)}{\mathrm dt}+\dfrac{2A(t)}{20-t}=4[/tex]
[tex]\dfrac1{(20-t)^2}\dfrac{\mathrm dA(t)}{\mathrm dt}+\dfrac{2A(t)}{(20-t)^3}=\dfrac4{(20-t)^2}[/tex]
[tex]\dfrac{\mathrm d}{\mathrm dt}\left[\dfrac{A(t)}{(20-t)^2}\right]=\dfrac4{(20-t)^2}[/tex]
[tex]\dfrac{A(t)}{(20-t)^2}=\dfrac4{20-t}+C[/tex]
[tex]A(t)=4(20-t)+C(20-t)^2[/tex]
Given that [tex]A(0)=\dfrac{1\text{ lb}}{8\text{ gal}}\times(80\text{ gal})=10\text{ lbs}[/tex], we have
[tex]10=4(20-0)+C(20-0)^2\implies C=-\dfrac7{40}[/tex]
so that the amount of salt in the tank is given by
[tex]A(t)=4(20-t)-\dfrac7{40}(20-t)^2[/tex]
[tex]A(t)=10+3t-\dfrac7{40}t^2[/tex]
which is valid for [tex]0\le t\le20[/tex], since the tank will be empty when [tex]80+(4-8)t=0[/tex].
The tank will contain 40 gal of solution when [tex]80+(4-8)t=40\implies t=10[/tex], at which point the amount of salt in the tank would be
[tex]A(10)=10+3(10)-\dfrac7{40}(10)^2=\dfrac{45}2=22.5\text{ lbs}[/tex]