Let x represent length of smallest piece.
We have been given that the longest piece is 13 inches longer than three times the smallest piece. So length of longest piece would be
.
The middle piece is 5 inches less than the longest piece. So length of middle piece would be
.
We have been given that the length of pipe is 7 foot.
1 feet = 12 inches.
7 feet = 7*12 inches = 84 inches.
Now we will equate the sum of lengths of 3 pipes with 84 as:

Let us solve for x.





Length of middle piece would be
.
Therefore, the middle piece is 35 inches long.