Given:
Weight of solution = 300 g
Sugar percentage = 40\%
Step 1: Calculate amount of sugar in original solution
Sugar weight = $40\%$ of 300 = $\frac{40}{100} \times 300 = 120$ g
Step 2: Let $x$ be the amount of sugar to be added
After adding $x$ g of sugar, total sugar = $120 + x$ g
Total solution weight = $300 + x$ g
Step 3: Set up equation for 50\% sugar concentration
$\frac{120 + x}{300 + x} = \frac{50}{100} = 0.5$
Step 4: Solve for $x$
$120 + x = 0.5(300 + x)$
$120 + x = 150 + 0.5x$
$x - 0.5x = 150 - 120$
$0.5x = 30$
$x = 60$ g
Therefore, 60 grams of sugar should be added.