>>4106086
T is the total income. N is the net income after salary. W is the wages. The optimal solution is when 20% of N equals 50% of W. T is the total of N plus W. 20% of N is equal to 50% of W. If you multiply both sides of that equation by 5 you get that N is equal to 250% of W. Go to the first equation and substitute giving you T=W+2.5W which is T= 3.5 W which is W=T/3.5.
https://www.forbes.com/sites/peterjreilly/2017/12/28/how-much-owner-salary-should-s-corp-pay-to-maximize-qualified-income-deduction/#290ed13a72ef