Let x be the amount of money (in dollars) Eric had initially.
After giving half of the money to Kevin, Eric had remaining amount=x−x2=2x2−x2=x2.
After buying sandwitch for $5, Eric now has x2−$5 amount of money.
Given that Eric now has $20 with him.
⇒x2−$5=$20
Step I: Add 5 on both the sides of the equation
⇒x2−$5+$5=$20+$5
⇒x2=$25
Step I:Multiply by 2 on both the sides of the equation
⇒2×x2=$50⇒x=$50
∴ Eric had $50 with him initially.