Weight of red package = 4 pound 1
Weight of blue package = 6 pound 1
Let x and y are the number of red and blue package respectively.
Given x+y = 40... Eq 1
4x + 6y = 180... Eq 2
By multiplying equation 1 from 4 and subtracting it from eq 2
4x + 64 -4x -4y = 180-160
2x = 20
x = 20/2
x = 10
Putting the value of of x in equation 1,
10+y = 40
y = 40-10 = 30
The purple line represents equation x+ y = 40
And green line represents equation 4x+6y = 180 and point of intersection is x = 10, y = 30