Let x be the amount of 80% antifreeze to be added, in gallons.

In terms of percentage of antifreeze, we write:

40% of 3 gallons+80% of x gallons=50% of 3+x gallons

0.4(3)+0.8(x)=0.5(3+x)

Solve for x:

1.2+0.8x=1.5+0.5x

0.8x=0.3+0.5x

0.3x=0.3

x=1

So, Kaitlin needs to add 1 gallon of 80% antifreeze.

In terms of percentage of antifreeze, we write:

40% of 3 gallons+80% of x gallons=50% of 3+x gallons

0.4(3)+0.8(x)=0.5(3+x)

Solve for x:

1.2+0.8x=1.5+0.5x

0.8x=0.3+0.5x

0.3x=0.3

x=1

So, Kaitlin needs to add 1 gallon of 80% antifreeze.