Find the rule, which gives the number of matchsticks required to make

Find the rule, which gives the number of matchsticks required to make the following matchstick patterns. Use a variable to write the rule.

image
image
image
image